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