1 package olr.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 * This class was autogenerated by Torque on: 13 * 14 * [Tue Jul 13 14:47:47 CEST 2004] 15 * 16 */ 17 public class RdfStatementMapBuilder implements MapBuilder 18 { 19 /*** 20 * The name of this class 21 */ 22 public static final String CLASS_NAME = 23 "olr.om.map.RdfStatementMapBuilder"; 24 25 26 /*** 27 * The database map. 28 */ 29 private DatabaseMap dbMap = null; 30 31 /*** 32 * Tells us if this DatabaseMapBuilder is built so that we 33 * don't have to re-build it every time. 34 * 35 * @return true if this DatabaseMapBuilder is built 36 */ 37 public boolean isBuilt() 38 { 39 return (dbMap != null); 40 } 41 42 /*** 43 * Gets the databasemap this map builder built. 44 * 45 * @return the databasemap 46 */ 47 public DatabaseMap getDatabaseMap() 48 { 49 return this.dbMap; 50 } 51 52 /*** 53 * The doBuild() method builds the DatabaseMap 54 * 55 * @throws TorqueException 56 */ 57 public void doBuild() throws TorqueException 58 { 59 dbMap = Torque.getDatabaseMap("default"); 60 61 dbMap.addTable("rdf_statement"); 62 TableMap tMap = dbMap.getTable("rdf_statement"); 63 64 tMap.setPrimaryKeyMethod(TableMap.ID_BROKER); 65 66 tMap.setPrimaryKeyMethodInfo(tMap.getName()); 67 68 tMap.addPrimaryKey("rdf_statement.ID", new Integer(0)); 69 tMap.addForeignKey( 70 "rdf_statement.SUBJECT", new Integer(0) , "rdf_resource" , 71 "id"); 72 tMap.addForeignKey( 73 "rdf_statement.PREDICATE", new Integer(0) , "rdf_resource" , 74 "id"); 75 tMap.addForeignKey( 76 "rdf_statement.OBJ_RESOURCE", new Integer(0) , "rdf_resource" , 77 "id"); 78 tMap.addForeignKey( 79 "rdf_statement.OBJ_LITERAL", new Integer(0) , "rdf_literal" , 80 "id"); 81 tMap.addColumn("rdf_statement.RES", new String()); 82 tMap.addForeignKey( 83 "rdf_statement.USR", new Integer(0) , "rdf_user" , 84 "id"); 85 tMap.addColumn("rdf_statement.ISPUBLIC", new String()); 86 tMap.addColumn("rdf_statement.MODIFIED", new Date()); 87 tMap.addColumn("rdf_statement.GARBAGE", new Long(0)); 88 } 89 }