1 package org.apache.jetspeed.om.security.turbine.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 18 public class TurbineUserGroupRoleMapBuilder implements MapBuilder 19 { 20 23 public static final String CLASS_NAME = 24 "org.apache.jetspeed.om.security.turbine.map.TurbineUserGroupRoleMapBuilder"; 25 26 27 30 private DatabaseMap dbMap = null; 31 32 38 public boolean isBuilt() 39 { 40 return (dbMap != null); 41 } 42 43 48 public DatabaseMap getDatabaseMap() 49 { 50 return this.dbMap; 51 } 52 53 58 public void doBuild() throws TorqueException 59 { 60 dbMap = Torque.getDatabaseMap("default"); 61 62 dbMap.addTable("TURBINE_USER_GROUP_ROLE"); 63 TableMap tMap = dbMap.getTable("TURBINE_USER_GROUP_ROLE"); 64 65 tMap.setPrimaryKeyMethod("none"); 66 67 68 tMap.addForeignPrimaryKey( 69 "TURBINE_USER_GROUP_ROLE.USER_ID", new Integer (0) , "TURBINE_USER" , 70 "USER_ID"); 71 tMap.addForeignPrimaryKey( 72 "TURBINE_USER_GROUP_ROLE.GROUP_ID", new Integer (0) , "TURBINE_GROUP" , 73 "GROUP_ID"); 74 tMap.addForeignPrimaryKey( 75 "TURBINE_USER_GROUP_ROLE.ROLE_ID", new Integer (0) , "TURBINE_ROLE" , 76 "ROLE_ID"); 77 } 78 } 79 | Popular Tags |