1 package org.tigris.scarab.om.map; 2 3 import java.util.Date ; 4 import java.math.BigDecimal ; 5 6 import org.apache.torque.Torque; 7 import org.apache.torque.TorqueException; 8 import org.apache.torque.map.MapBuilder; 9 import org.apache.torque.map.DatabaseMap; 10 import org.apache.torque.map.TableMap; 11 12 14 public class ActivityMapBuilder implements MapBuilder 15 { 16 19 public static final String CLASS_NAME = 20 "org.tigris.scarab.om.map.ActivityMapBuilder"; 21 22 23 26 private DatabaseMap dbMap = null; 27 28 34 public boolean isBuilt() 35 { 36 return (dbMap != null); 37 } 38 39 44 public DatabaseMap getDatabaseMap() 45 { 46 return this.dbMap; 47 } 48 49 54 public void doBuild() throws TorqueException 55 { 56 dbMap = Torque.getDatabaseMap("scarab"); 57 58 dbMap.addTable("SCARAB_ACTIVITY"); 59 TableMap tMap = dbMap.getTable("SCARAB_ACTIVITY"); 60 61 tMap.setPrimaryKeyMethod(TableMap.ID_BROKER); 62 63 tMap.setPrimaryKeyMethodInfo(tMap.getName()); 64 65 tMap.addPrimaryKey("SCARAB_ACTIVITY.ACTIVITY_ID", new Long (0)); 66 tMap.addForeignKey( 67 "SCARAB_ACTIVITY.ISSUE_ID", new Long (0) , "SCARAB_ISSUE" , 68 "ISSUE_ID"); 69 tMap.addForeignKey( 70 "SCARAB_ACTIVITY.ATTRIBUTE_ID", new Integer (0) , "SCARAB_ATTRIBUTE" , 71 "ATTRIBUTE_ID"); 72 tMap.addForeignKey( 73 "SCARAB_ACTIVITY.TRANSACTION_ID", new Long (0) , "SCARAB_TRANSACTION" , 74 "TRANSACTION_ID"); 75 tMap.addColumn("SCARAB_ACTIVITY.OLD_NUMERIC_VALUE", new Integer (0)); 76 tMap.addColumn("SCARAB_ACTIVITY.NEW_NUMERIC_VALUE", new Integer (0)); 77 tMap.addForeignKey( 78 "SCARAB_ACTIVITY.OLD_USER_ID", new Integer (0) , "TURBINE_USER" , 79 "USER_ID"); 80 tMap.addForeignKey( 81 "SCARAB_ACTIVITY.NEW_USER_ID", new Integer (0) , "TURBINE_USER" , 82 "USER_ID"); 83 tMap.addForeignKey( 84 "SCARAB_ACTIVITY.OLD_OPTION_ID", new Integer (0) , "SCARAB_ATTRIBUTE_OPTION" , 85 "OPTION_ID"); 86 tMap.addForeignKey( 87 "SCARAB_ACTIVITY.NEW_OPTION_ID", new Integer (0) , "SCARAB_ATTRIBUTE_OPTION" , 88 "OPTION_ID"); 89 tMap.addColumn("SCARAB_ACTIVITY.OLD_VALUE", ""); 90 tMap.addColumn("SCARAB_ACTIVITY.NEW_VALUE", ""); 91 tMap.addForeignKey( 92 "SCARAB_ACTIVITY.DEPEND_ID", new Integer (0) , "SCARAB_DEPEND" , 93 "DEPEND_ID"); 94 tMap.addColumn("SCARAB_ACTIVITY.DESCRIPTION", ""); 95 tMap.addColumn("SCARAB_ACTIVITY.END_DATE", new Date ()); 96 tMap.addForeignKey( 97 "SCARAB_ACTIVITY.ATTACHMENT_ID", new Long (0) , "SCARAB_ATTACHMENT" , 98 "ATTACHMENT_ID"); 99 } 100 } 101 | Popular Tags |