1 package org.paneris.jammyjoes.model; 2 3 import java.sql.ResultSet; 4 5 import org.melati.poem.Database; 6 import org.melati.poem.DefinitionSource; 7 import org.melati.poem.PoemException; 8 import org.paneris.jammyjoes.model.generated.StockTransactionTypeTableBase; 9 10 public class StockTransactionTypeTable extends StockTransactionTypeTableBase { 11 12 private StockTransactionType InternetSale, Purchase, ShopSale, StockCheckDecrease, StockCheckIncrease, TelephoneSale; 13 14 public StockTransactionTypeTable( 15 Database database, String name, 16 DefinitionSource definitionSource) throws PoemException { 17 super(database, name, definitionSource); 18 InternetSale = (StockTransactionType)newPersistent(); 19 InternetSale.setType_unsafe("Internet Sale"); 20 InternetSale.setReducestock_unsafe(Boolean.TRUE); 21 TelephoneSale = (StockTransactionType)newPersistent(); 22 TelephoneSale.setType_unsafe("Telephone Sale"); 23 TelephoneSale.setReducestock_unsafe(Boolean.TRUE); 24 Purchase = (StockTransactionType)newPersistent(); 25 Purchase.setType_unsafe("Purchase"); 26 Purchase.setReducestock_unsafe(Boolean.FALSE); 27 ShopSale = (StockTransactionType)newPersistent(); 28 ShopSale.setType_unsafe("Shop Sale"); 29 ShopSale.setReducestock_unsafe(Boolean.TRUE); 30 StockCheckDecrease = (StockTransactionType)newPersistent(); 31 StockCheckDecrease.setType_unsafe("Stock Check (Decrease)"); 32 StockCheckDecrease.setReducestock_unsafe(Boolean.TRUE); 33 StockCheckIncrease = (StockTransactionType)newPersistent(); 34 StockCheckIncrease.setType_unsafe("Stock Check (Increase)"); 35 StockCheckIncrease.setReducestock_unsafe(Boolean.FALSE); 36 } 37 38 public synchronized void unifyWithDB(ResultSet colDescs) 39 throws PoemException { 40 super.unifyWithDB(colDescs); 41 InternetSale = (StockTransactionType)getTypeColumn().ensure(InternetSale); 42 TelephoneSale = (StockTransactionType)getTypeColumn().ensure(TelephoneSale); 43 Purchase = (StockTransactionType)getTypeColumn().ensure(Purchase); 44 ShopSale = (StockTransactionType)getTypeColumn().ensure(ShopSale); 45 StockCheckDecrease = (StockTransactionType)getTypeColumn().ensure(StockCheckDecrease); 46 StockCheckIncrease = (StockTransactionType)getTypeColumn().ensure(StockCheckIncrease); 47 } 48 49 public StockTransactionType getInternetSale() { 50 return InternetSale; 51 } 52 53 public StockTransactionType getTelephoneSale() { 54 return TelephoneSale; 55 } 56 57 public StockTransactionType getPurchase() { 58 return Purchase; 59 } 60 61 public StockTransactionType getShopSale() { 62 return ShopSale; 63 } 64 65 public StockTransactionType getStockCheckDecrease() { 66 return StockCheckDecrease; 67 } 68 69 public StockTransactionType getStockCheckIncreasee() { 70 return StockCheckIncrease; 71 } 72 73 }