1 package net.sourceforge.blogentis.om.map; 2 3 import org.apache.torque.Torque; 4 import org.apache.torque.TorqueException; 5 import org.apache.torque.map.DatabaseMap; 6 import org.apache.torque.map.MapBuilder; 7 import org.apache.torque.map.TableMap; 8 9 /*** 10 */ 11 public class TurbineGroupMapBuilder implements MapBuilder 12 { 13 /*** 14 * The name of this class 15 */ 16 public static final String CLASS_NAME = 17 "net.sourceforge.blogentis.om.map.TurbineGroupMapBuilder"; 18 19 20 /*** 21 * The database map. 22 */ 23 private DatabaseMap dbMap = null; 24 25 /*** 26 * Tells us if this DatabaseMapBuilder is built so that we 27 * don't have to re-build it every time. 28 * 29 * @return true if this DatabaseMapBuilder is built 30 */ 31 public boolean isBuilt() 32 { 33 return (dbMap != null); 34 } 35 36 /*** 37 * Gets the databasemap this map builder built. 38 * 39 * @return the databasemap 40 */ 41 public DatabaseMap getDatabaseMap() 42 { 43 return this.dbMap; 44 } 45 46 /*** 47 * The doBuild() method builds the DatabaseMap 48 * 49 * @throws TorqueException 50 */ 51 public void doBuild() throws TorqueException 52 { 53 dbMap = Torque.getDatabaseMap("blogentis"); 54 55 dbMap.addTable("TURBINE_GROUP"); 56 TableMap tMap = dbMap.getTable("TURBINE_GROUP"); 57 58 tMap.setPrimaryKeyMethod(TableMap.NATIVE); 59 60 tMap.setPrimaryKeyMethodInfo("TURBINE_GROUP_SEQ"); 61 62 tMap.addPrimaryKey("TURBINE_GROUP.GROUP_ID", new Integer(0)); 63 tMap.addColumn("TURBINE_GROUP.GROUP_NAME", new String()); 64 tMap.addColumn("TURBINE_GROUP.OBJECTDATA", new Object()); 65 } 66 }