Coverage Report - org.paneris.bibliomania.generated.OrderStatusTableBase
 
Classes in this File Line Coverage Branch Coverage Complexity
OrderStatusTableBase
44%
8/18
N/A
1
OrderStatusTableBase$1
6%
1/15
N/A
1
OrderStatusTableBase$2
5%
1/17
N/A
1
 
 1  
 // Do not edit this file!  It was generated by Melati POEM's DSD preprocessor.
 2  
 
 3  
 package org.paneris.bibliomania.generated;
 4  
 
 5  
 
 6  
 import org.melati.poem.AccessPoemException;
 7  
 import org.melati.poem.Column;
 8  
 import org.melati.poem.Database;
 9  
 import org.melati.poem.DefinitionSource;
 10  
 import org.melati.poem.DisplayLevel;
 11  
 import org.melati.poem.Field;
 12  
 import org.melati.poem.JdbcPersistent;
 13  
 import org.melati.poem.Persistent;
 14  
 import org.melati.poem.PoemException;
 15  
 import org.melati.poem.Searchability;
 16  
 import org.melati.poem.StringPoemType;
 17  
 import org.melati.poem.TroidPoemType;
 18  
 import org.melati.poem.ValidationPoemException;
 19  
 import org.paneris.bibliomania.BibliomaniaDatabaseTables;
 20  
 import org.paneris.bibliomania.BibliomaniaTable;
 21  
 import org.paneris.bibliomania.OrderStatus;
 22  
 
 23  
 
 24  
 /**
 25  
  * Melati POEM generated base class for <code>Table</code> <code>OrderStatus</code>.
 26  
  *
 27  
  * see org.melati.poem.prepro.TableDef#generateTableBaseJava 
 28  
  */
 29  
 
 30  
 public class OrderStatusTableBase<T extends OrderStatus> extends BibliomaniaTable<T> {
 31  
 
 32  2
   private Column<Integer> col_id = null;
 33  2
   private Column<String> col_status = null;
 34  
 
 35  
  /**
 36  
   * Constructor. 
 37  
   * 
 38  
   * see org.melati.poem.prepro.TableDef#generateTableBaseJava 
 39  
   * @param database          the POEM database we are using
 40  
   * @param name              the name of this <code>Table</code>
 41  
   * @param definitionSource  which definition is being used
 42  
   * @throws PoemException    if anything goes wrong
 43  
   */
 44  
 
 45  
   public OrderStatusTableBase(
 46  
       Database database, String name,
 47  
       DefinitionSource definitionSource) throws PoemException {
 48  2
     super(database, name, definitionSource);
 49  2
   }
 50  
 
 51  
 
 52  
  /**
 53  
   * Get the database tables.
 54  
   *
 55  
   * see org.melati.poem.prepro.TableDef#generateTableBaseJava 
 56  
   * @return the database tables
 57  
   */
 58  
   public BibliomaniaDatabaseTables getBibliomaniaDatabaseTables() {
 59  0
     return (BibliomaniaDatabaseTables)getDatabase();
 60  
   }
 61  
 
 62  
 
 63  
  /**
 64  
   * Initialise this table by defining its columns.
 65  
   *
 66  
   * see org.melati.poem.prepro.TableDef#generateTableBaseJava 
 67  
   */
 68  
   public void init() throws PoemException {
 69  2
     super.init();
 70  2
     defineColumn(col_id =
 71  
         new Column<Integer>(this, "id",
 72  
                    new TroidPoemType(),
 73  2
                    DefinitionSource.dsd) { 
 74  
           public Object getCooked(Persistent g)
 75  
               throws AccessPoemException, PoemException {
 76  0
             return ((OrderStatus)g).getId();
 77  
           }
 78  
 
 79  
           public void setCooked(Persistent g, Object cooked)
 80  
               throws AccessPoemException, ValidationPoemException {
 81  0
             ((OrderStatus)g).setId((Integer)cooked);
 82  0
           }
 83  
 
 84  
           public Field<Integer> asField(Persistent g) {
 85  0
             return ((OrderStatus)g).getIdField();
 86  
           }
 87  
 
 88  
           public boolean defaultUserEditable() {
 89  0
             return false;
 90  
           }
 91  
 
 92  
           public boolean defaultUserCreateable() {
 93  0
             return false;
 94  
           }
 95  
 
 96  
           public DisplayLevel defaultDisplayLevel() {
 97  0
             return DisplayLevel.summary;
 98  
           }
 99  
 
 100  
           public int defaultDisplayOrder() {
 101  0
             return 0;
 102  
           }
 103  
 
 104  
           public Object getRaw_unsafe(Persistent g)
 105  
               throws AccessPoemException {
 106  0
             return ((OrderStatus)g).getId_unsafe();
 107  
           }
 108  
 
 109  
           public void setRaw_unsafe(Persistent g, Object raw)
 110  
               throws AccessPoemException {
 111  0
             ((OrderStatus)g).setId_unsafe((Integer)raw);
 112  0
           }
 113  
 
 114  
           public Object getRaw(Persistent g)
 115  
               throws AccessPoemException {
 116  0
             return ((OrderStatus)g).getId();
 117  
           }
 118  
 
 119  
           public void setRaw(Persistent g, Object raw)
 120  
               throws AccessPoemException {
 121  0
             ((OrderStatus)g).setId((Integer)raw);
 122  0
           }
 123  
         });
 124  
 
 125  2
     defineColumn(col_status =
 126  
         new Column<String>(this, "status",
 127  
                    new StringPoemType(false, -1),
 128  2
                    DefinitionSource.dsd) { 
 129  
           public Object getCooked(Persistent g)
 130  
               throws AccessPoemException, PoemException {
 131  0
             return ((OrderStatus)g).getStatus();
 132  
           }
 133  
 
 134  
           public void setCooked(Persistent g, Object cooked)
 135  
               throws AccessPoemException, ValidationPoemException {
 136  0
             ((OrderStatus)g).setStatus((String)cooked);
 137  0
           }
 138  
 
 139  
           public Field<String> asField(Persistent g) {
 140  0
             return ((OrderStatus)g).getStatusField();
 141  
           }
 142  
 
 143  
           public DisplayLevel defaultDisplayLevel() {
 144  0
             return DisplayLevel.primary;
 145  
           }
 146  
 
 147  
           public Searchability defaultSearchability() {
 148  0
             return Searchability.primary;
 149  
           }
 150  
 
 151  
           public String defaultDisplayName() {
 152  0
             return "Status";
 153  
           }
 154  
 
 155  
           public int defaultDisplayOrder() {
 156  0
             return 1;
 157  
           }
 158  
 
 159  
           public String defaultDescription() {
 160  0
             return "The status of an order or order item";
 161  
           }
 162  
 
 163  
           public int defaultWidth() {
 164  0
             return 30;
 165  
           }
 166  
 
 167  
           public Object getRaw_unsafe(Persistent g)
 168  
               throws AccessPoemException {
 169  0
             return ((OrderStatus)g).getStatus_unsafe();
 170  
           }
 171  
 
 172  
           public void setRaw_unsafe(Persistent g, Object raw)
 173  
               throws AccessPoemException {
 174  0
             ((OrderStatus)g).setStatus_unsafe((String)raw);
 175  0
           }
 176  
 
 177  
           public Object getRaw(Persistent g)
 178  
               throws AccessPoemException {
 179  0
             return ((OrderStatus)g).getStatus();
 180  
           }
 181  
 
 182  
           public void setRaw(Persistent g, Object raw)
 183  
               throws AccessPoemException {
 184  0
             ((OrderStatus)g).setStatus((String)raw);
 185  0
           }
 186  
         });
 187  2
   }
 188  
 
 189  
 
 190  
  /**
 191  
   * Retrieves the <code>Id</code> <code>Column</code> for this 
 192  
   * <code>OrderStatus</code> <code>Table</code>.
 193  
   * 
 194  
   * see org.melati.poem.prepro.FieldDef#generateColAccessor 
 195  
   * @return the id <code>Column</code>
 196  
   */
 197  
   public final Column<Integer> getIdColumn() {
 198  0
     return col_id;
 199  
   }
 200  
 
 201  
 
 202  
  /**
 203  
   * Retrieves the <code>Status</code> <code>Column</code> for this 
 204  
   * <code>OrderStatus</code> <code>Table</code>.
 205  
   * 
 206  
   * see org.melati.poem.prepro.FieldDef#generateColAccessor 
 207  
   * @return the status <code>Column</code>
 208  
   */
 209  
   public final Column<String> getStatusColumn() {
 210  0
     return col_status;
 211  
   }
 212  
 
 213  
 
 214  
  /**
 215  
   * Retrieve the <code>OrderStatus</code> as a <code>OrderStatus</code>.
 216  
   *
 217  
   * see org.melati.poem.prepro.TableDef#generateTableBaseJava 
 218  
   * @param troid a Table Row Oject ID
 219  
   * @return the <code>Persistent</code> identified by the <code>troid</code>
 220  
   */
 221  
   public OrderStatus getOrderStatusObject(Integer troid) {
 222  0
     return (OrderStatus)getObject(troid);
 223  
   }
 224  
 
 225  
 
 226  
  /**
 227  
   * Retrieve the <code>OrderStatus</code> 
 228  
   * as a <code>OrderStatus</code>.
 229  
   *
 230  
   * see org.melati.poem.prepro.TableDef#generateTableBaseJava 
 231  
   * @param troid a Table Row Object ID
 232  
   * @return the <code>Persistent</code> identified   */
 233  
   public OrderStatus getOrderStatusObject(int troid) {
 234  0
     return (OrderStatus)getObject(troid);
 235  
   }
 236  
 
 237  
   protected JdbcPersistent _newPersistent() {
 238  0
     return new OrderStatus();
 239  
   }
 240  
   public String defaultDisplayName() {
 241  0
     return "Order Status";
 242  
   }
 243  
 
 244  
   public String defaultDescription() {
 245  0
     return "The status of this order or order item";
 246  
   }
 247  
 
 248  
   public String defaultCategory() {
 249  0
     return "Shop";
 250  
   }
 251  
 
 252  
   public int defaultDisplayOrder() {
 253  0
     return 1260;
 254  
   }
 255  
 }
 256