1 package org.apache.jetspeed.om.dbregistry.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 PortletDbEntryMapBuilder implements MapBuilder 19 { 20 23 public static final String CLASS_NAME = 24 "org.apache.jetspeed.om.dbregistry.map.PortletDbEntryMapBuilder"; 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("PORTLET"); 63 TableMap tMap = dbMap.getTable("PORTLET"); 64 65 tMap.setPrimaryKeyMethod(TableMap.NATIVE); 66 67 tMap.setPrimaryKeyMethodInfo("PORTLET"); 68 69 tMap.addPrimaryKey("PORTLET.ID", new Long (0)); 70 tMap.addColumn("PORTLET.NAME", new String ()); 71 tMap.addColumn("PORTLET.HIDDEN", new Integer (0)); 72 tMap.addColumn("PORTLET.CLASSNAME", new String ()); 73 tMap.addColumn("PORTLET.TYPE", new String ()); 74 tMap.addColumn("PORTLET.APPLICATION", new Integer (0)); 75 tMap.addColumn("PORTLET.PARENT", new Long (0)); 76 tMap.addColumn("PORTLET.URL", new String ()); 77 tMap.addColumn("PORTLET.CACHEDONURL", new Integer (0)); 78 tMap.addColumn("PORTLET.ROLE", new String ()); 79 tMap.addColumn("PORTLET.TITLE", new String ()); 80 tMap.addColumn("PORTLET.DESCRIPTION", new String ()); 81 tMap.addColumn("PORTLET.IMAGE", new String ()); 82 tMap.addColumn("PORTLET.SECURITY", new String ()); 83 } 84 } 85 | Popular Tags |