001    package org.apache.turbine.services.schedule.map;
002    
003    import java.util.Date;
004    import java.math.BigDecimal;
005    
006    import org.apache.torque.Torque;
007    import org.apache.torque.TorqueException;
008    import org.apache.torque.map.MapBuilder;
009    import org.apache.torque.map.DatabaseMap;
010    import org.apache.torque.map.TableMap;
011    import org.apache.torque.map.ColumnMap;
012    import org.apache.torque.map.InheritanceMap;
013    
014    /**
015      *  This class was autogenerated by Torque on:
016      *
017      * [Thu Jun 23 17:25:46 CEST 2011]
018      *
019      */
020    public class JobEntryMapBuilder implements MapBuilder
021    {
022        /**
023         * The name of this class
024         */
025        public static final String CLASS_NAME =
026            "org.apache.turbine.services.schedule.map.JobEntryMapBuilder";
027    
028        /**
029         * The database map.
030         */
031        private DatabaseMap dbMap = null;
032    
033        /**
034         * Tells us if this DatabaseMapBuilder is built so that we
035         * don't have to re-build it every time.
036         *
037         * @return true if this DatabaseMapBuilder is built
038         */
039        public boolean isBuilt()
040        {
041            return (dbMap != null);
042        }
043    
044        /**
045         * Gets the databasemap this map builder built.
046         *
047         * @return the databasemap
048         */
049        public DatabaseMap getDatabaseMap()
050        {
051            return this.dbMap;
052        }
053    
054        /**
055         * The doBuild() method builds the DatabaseMap
056         *
057         * @throws TorqueException
058         */
059        public synchronized void doBuild() throws TorqueException
060        {
061            if ( isBuilt() ) {
062                return;
063            }
064            dbMap = Torque.getDatabaseMap("default");
065    
066            dbMap.addTable("TURBINE_SCHEDULED_JOB");
067            TableMap tMap = dbMap.getTable("TURBINE_SCHEDULED_JOB");
068            tMap.setJavaName("JobEntry");
069            tMap.setOMClass( org.apache.turbine.services.schedule.JobEntry.class );
070            tMap.setPeerClass( org.apache.turbine.services.schedule.JobEntryPeer.class );
071            tMap.setPrimaryKeyMethod(TableMap.ID_BROKER);
072            tMap.setPrimaryKeyMethodInfo(tMap.getName());
073    
074            ColumnMap cMap = null;
075    
076    
077      // ------------- Column: JOB_ID --------------------
078            cMap = new ColumnMap( "JOB_ID", tMap);
079            cMap.setType( new Integer(0) );
080            cMap.setTorqueType( "INTEGER" );
081            cMap.setUsePrimitive(true);
082            cMap.setPrimaryKey(true);
083            cMap.setNotNull(true);
084            cMap.setJavaName( "JobId" );
085            cMap.setAutoIncrement(false);
086            cMap.setProtected(false);
087            cMap.setInheritance("false");
088            cMap.setPosition(1);
089            tMap.addColumn(cMap);
090      // ------------- Column: SECOND --------------------
091            cMap = new ColumnMap( "SECOND", tMap);
092            cMap.setType( new Integer(0) );
093            cMap.setTorqueType( "INTEGER" );
094            cMap.setUsePrimitive(true);
095            cMap.setPrimaryKey(false);
096            cMap.setNotNull(true);
097            cMap.setJavaName( "Second" );
098            cMap.setAutoIncrement(false);
099            cMap.setProtected(false);
100            cMap.setDefault("-1");
101            cMap.setInheritance("false");
102            cMap.setPosition(2);
103            tMap.addColumn(cMap);
104      // ------------- Column: MINUTE --------------------
105            cMap = new ColumnMap( "MINUTE", tMap);
106            cMap.setType( new Integer(0) );
107            cMap.setTorqueType( "INTEGER" );
108            cMap.setUsePrimitive(true);
109            cMap.setPrimaryKey(false);
110            cMap.setNotNull(true);
111            cMap.setJavaName( "Minute" );
112            cMap.setAutoIncrement(false);
113            cMap.setProtected(false);
114            cMap.setDefault("-1");
115            cMap.setInheritance("false");
116            cMap.setPosition(3);
117            tMap.addColumn(cMap);
118      // ------------- Column: HOUR --------------------
119            cMap = new ColumnMap( "HOUR", tMap);
120            cMap.setType( new Integer(0) );
121            cMap.setTorqueType( "INTEGER" );
122            cMap.setUsePrimitive(true);
123            cMap.setPrimaryKey(false);
124            cMap.setNotNull(true);
125            cMap.setJavaName( "Hour" );
126            cMap.setAutoIncrement(false);
127            cMap.setProtected(false);
128            cMap.setDefault("-1");
129            cMap.setInheritance("false");
130            cMap.setPosition(4);
131            tMap.addColumn(cMap);
132      // ------------- Column: WEEK_DAY --------------------
133            cMap = new ColumnMap( "WEEK_DAY", tMap);
134            cMap.setType( new Integer(0) );
135            cMap.setTorqueType( "INTEGER" );
136            cMap.setUsePrimitive(true);
137            cMap.setPrimaryKey(false);
138            cMap.setNotNull(true);
139            cMap.setJavaName( "WeekDay" );
140            cMap.setAutoIncrement(false);
141            cMap.setProtected(false);
142            cMap.setDefault("-1");
143            cMap.setInheritance("false");
144            cMap.setPosition(5);
145            tMap.addColumn(cMap);
146      // ------------- Column: DAY_OF_MONTH --------------------
147            cMap = new ColumnMap( "DAY_OF_MONTH", tMap);
148            cMap.setType( new Integer(0) );
149            cMap.setTorqueType( "INTEGER" );
150            cMap.setUsePrimitive(true);
151            cMap.setPrimaryKey(false);
152            cMap.setNotNull(true);
153            cMap.setJavaName( "DayOfMonth" );
154            cMap.setAutoIncrement(false);
155            cMap.setProtected(false);
156            cMap.setDefault("-1");
157            cMap.setInheritance("false");
158            cMap.setPosition(6);
159            tMap.addColumn(cMap);
160      // ------------- Column: TASK --------------------
161            cMap = new ColumnMap( "TASK", tMap);
162            cMap.setType( "" );
163            cMap.setTorqueType( "VARCHAR" );
164            cMap.setUsePrimitive(true);
165            cMap.setPrimaryKey(false);
166            cMap.setNotNull(true);
167            cMap.setJavaName( "Task" );
168            cMap.setAutoIncrement(false);
169            cMap.setProtected(false);
170            cMap.setInheritance("false");
171            cMap.setSize( 99 );
172            cMap.setPosition(7);
173            tMap.addColumn(cMap);
174      // ------------- Column: EMAIL --------------------
175            cMap = new ColumnMap( "EMAIL", tMap);
176            cMap.setType( "" );
177            cMap.setTorqueType( "VARCHAR" );
178            cMap.setUsePrimitive(true);
179            cMap.setPrimaryKey(false);
180            cMap.setNotNull(false);
181            cMap.setJavaName( "Email" );
182            cMap.setAutoIncrement(false);
183            cMap.setProtected(false);
184            cMap.setInheritance("false");
185            cMap.setSize( 99 );
186            cMap.setPosition(8);
187            tMap.addColumn(cMap);
188      // ------------- Column: PROPERTY --------------------
189            cMap = new ColumnMap( "PROPERTY", tMap);
190            cMap.setType( new Object() );
191            cMap.setTorqueType( "VARBINARY" );
192            cMap.setUsePrimitive(true);
193            cMap.setPrimaryKey(false);
194            cMap.setNotNull(false);
195            cMap.setJavaName( "Property" );
196            cMap.setAutoIncrement(false);
197            cMap.setProtected(false);
198            cMap.setInheritance("false");
199            cMap.setPosition(9);
200            tMap.addColumn(cMap);
201            tMap.setUseInheritance(false);
202        }
203    }