User: juha
Date: 00/08/27 13:05:29
Added: xdocs/skin/resources IdTable.java IdTableMapBuilder.java
IdTablePeer.java Jobentry.java
JobentryMapBuilder.java JobentryPeer.java
Log:
- add some sample generated sources for torque documentation.
Revision Changes Path
1.1 turbine/xdocs/skin/resources/IdTable.java
Index: IdTable.java
===================================================================
package test;
// Turbine
import org.apache.turbine.om.BaseObject;
import java.util.*;
/** This class was autogenerated by XMLSchemaToObjectModel on: Sun Aug 27 15:53:54
EDT 2000 */
public class IdTable extends BaseObject
{
/** the value for the idtableid field */
private int idtableid;
/** the value for the quantity field */
private int quantity;
/** the value for the nextid field */
private int nextid;
/** the value for the tablename field */
private String tablename;
/**
* Get the idtableid
* @return int
*/
public int getIdTableId()
{
return idtableid;
}
/**
* Set the value of idtableid
* @param int
*/
public void setIdTableId(int v )
{
this.idtableid = v;
}
/**
* Get the quantity
* @return int
*/
public int getQuantity()
{
return quantity;
}
/**
* Set the value of quantity
* @param int
*/
public void setQuantity(int v )
{
this.quantity = v;
}
/**
* Get the nextid
* @return int
*/
public int getNextId()
{
return nextid;
}
/**
* Set the value of nextid
* @param int
*/
public void setNextId(int v )
{
this.nextid = v;
}
/**
* Get the tablename
* @return String
*/
public String getTableName()
{
return tablename;
}
/**
* Set the value of tablename
* @param String
*/
public void setTableName(String v )
{
this.tablename = v;
}
}
1.1 turbine/xdocs/skin/resources/IdTableMapBuilder.java
Index: IdTableMapBuilder.java
===================================================================
package test.map;
// JDK classes
import java.util.Date;
// Turbine classes
import org.apache.turbine.util.db.map.MapBuilder;
import org.apache.turbine.util.db.map.DatabaseMap;
import org.apache.turbine.util.db.map.TableMap;
import org.apache.turbine.util.db.pool.DBBroker;
/** This class was autogenerated by XMLSchemaToObjectModel on: Sun Aug 27 15:53:54
EDT 2000 */
public class IdTableMapBuilder extends TurbineMapBuilder
{
/** the name of this class */
public static final String CLASS_NAME = "test.map.IdTableMapBuilder";
/** ID_TABLE */
public static String getTable( )
{
return "ID_TABLE";
}
/** ID_TABLE.ID_TABLE_ID */
public static String getIdTable_IdTableId()
{
return getTable() + ".ID_TABLE_ID";
}
/** ID_TABLE.QUANTITY */
public static String getIdTable_Quantity()
{
return getTable() + ".QUANTITY";
}
/** ID_TABLE.NEXT_ID */
public static String getIdTable_NextId()
{
return getTable() + ".NEXT_ID";
}
/** ID_TABLE.TABLE_NAME */
public static String getIdTable_TableName()
{
return getTable() + ".TABLE_NAME";
}
/** the doBuild() method builds the DatabaseMap */
public void doBuild ( ) throws Exception
{
String string = new String("");
Integer integer = new Integer(0);
java.util.Date date = new Date();
dbMap = DBBroker.getInstance().getDatabaseMap(DBBroker.DEFAULT);
dbMap.addTable(getTable());
TableMap tMap = dbMap.getTable(getTable());
tMap.addPrimaryKey ( getIdTable_IdTableId(), integer);
tMap.addColumn ( getIdTable_Quantity(), integer);
tMap.addColumn ( getIdTable_NextId(), integer);
tMap.addColumn ( getIdTable_TableName(), string);
}
}
1.1 turbine/xdocs/skin/resources/IdTablePeer.java
Index: IdTablePeer.java
===================================================================
package test.peer;
import com.workingdogs.village.*;
import org.apache.turbine.om.peer.*;
import org.apache.turbine.util.*;
import org.apache.turbine.util.db.*;
import org.apache.turbine.util.db.map.*;
import java.util.*;
import test.map.*;
import test.*;
/** This class was autogenerated by XMLSchemaToObjectModel on: Sun Aug 27 15:53:54
EDT 2000 */
public class IdTablePeer extends BasePeer
{
/** the mapbuilder for this class */
private static final IdTableMapBuilder mapBuilder =
(IdTableMapBuilder)getMapBuilder(IdTableMapBuilder.CLASS_NAME);
/** the table name for this class */
public static final String TABLE_NAME = mapBuilder.getTable();
/** the column name for the ID_TABLE_ID id field */
public static final String ID_TABLE_ID = mapBuilder.getIdTable_IdTableId();
/** the column name for the QUANTITY id field */
public static final String QUANTITY = mapBuilder.getIdTable_Quantity();
/** the column name for the NEXT_ID id field */
public static final String NEXT_ID = mapBuilder.getIdTable_NextId();
/** the column name for the TABLE_NAME id field */
public static final String TABLE_NAME = mapBuilder.getIdTable_TableName();
/** Method to do inserts */
public static Object doInsert( Criteria criteria ) throws Exception
{
return BasePeer.doInsert( criteria );
}
/** Method to do selects */
public static Vector doSelect( Criteria criteria ) throws Exception
{
criteria.addSelectColumn( ID_TABLE_ID );
criteria.addSelectColumn( QUANTITY );
criteria.addSelectColumn( NEXT_ID );
criteria.addSelectColumn( TABLE_NAME );
// BasePeer returns a Vector of Value (Village) arrays. The array
// order follows the order columns were placed in the Select clause.
Vector rows = BasePeer.doSelect(criteria);
Vector results = new Vector();
// populate the object(s)
for ( int i=0; i<rows.size(); i++ )
{
IdTable obj = new IdTable();
Record row = (Record)rows.elementAt(i);
obj.setIdTableId( row.getValue(1).asInt() );
obj.setQuantity( row.getValue(2).asInt() );
obj.setNextId( row.getValue(3).asInt() );
obj.setTableName( row.getValue(4).asString() );
results.addElement( obj );
}
return results;
}
/**
* @param Criteria object containing data that is used to create the UPDATE
statement.
*/
public static void doUpdate(Criteria criteria) throws Exception
{
Criteria selectCriteria = new Criteria(2);
selectCriteria.put( ID_TABLE_ID, criteria.remove(ID_TABLE_ID) );
BasePeer.doUpdate( selectCriteria, criteria );
}
/**
* @param Criteria object containing data that is used DELETE from database.
*/
public static void doDelete(Criteria criteria) throws Exception
{
BasePeer.doDelete ( criteria );
}
/** Method to do inserts */
public static Object doInsert( IdTable obj ) throws Exception
{
return IdTablePeer.doInsert(buildCriteria(obj));
}
/** Build a Criteria object from the data object for this peer */
public static Criteria buildCriteria( IdTable obj )
{
Criteria criteria = new Criteria();
if( obj.getIdTableId() > 0 )
criteria.add( IdTablePeer.ID_TABLE_ID, obj.getIdTableId() );
criteria.add( IdTablePeer.QUANTITY, obj.getQuantity() );
criteria.add( IdTablePeer.NEXT_ID, obj.getNextId() );
criteria.add( IdTablePeer.TABLE_NAME, obj.getTableName() );
return criteria;
}
/**
* @param obj the data object to update in the database.
*/
public static void doUpdate(IdTable obj) throws Exception
{
IdTablePeer.doUpdate(buildCriteria(obj));
}
/**
* @param obj the data object to delete in the database.
*/
public static void doDelete(IdTable obj) throws Exception
{
IdTablePeer.doDelete(buildCriteria(obj));
}
}
1.1 turbine/xdocs/skin/resources/Jobentry.java
Index: Jobentry.java
===================================================================
package test;
// Turbine
import org.apache.turbine.om.BaseObject;
import java.util.*;
/** This class was autogenerated by XMLSchemaToObjectModel on: Sun Aug 27 15:53:55
EDT 2000 */
public class Jobentry extends BaseObject
{
/** the value for the task field */
private String task;
/** the value for the hour field */
private int hour;
/** the value for the minute field */
private int minute;
/** the value for the dayofmonth field */
private int dayofmonth;
/** the value for the weekday field */
private int weekday;
/** the value for the email field */
private String email;
/** the value for the jobid field */
private int jobid;
/**
* Get the task
* @return String
*/
public String getTask()
{
return task;
}
/**
* Set the value of task
* @param String
*/
public void setTask(String v )
{
this.task = v;
}
/**
* Get the hour
* @return int
*/
public int getHour()
{
return hour;
}
/**
* Set the value of hour
* @param int
*/
public void setHour(int v )
{
this.hour = v;
}
/**
* Get the minute
* @return int
*/
public int getMinute()
{
return minute;
}
/**
* Set the value of minute
* @param int
*/
public void setMinute(int v )
{
this.minute = v;
}
/**
* Get the dayofmonth
* @return int
*/
public int getDayOfMonth()
{
return dayofmonth;
}
/**
* Set the value of dayofmonth
* @param int
*/
public void setDayOfMonth(int v )
{
this.dayofmonth = v;
}
/**
* Get the weekday
* @return int
*/
public int getWeekday()
{
return weekday;
}
/**
* Set the value of weekday
* @param int
*/
public void setWeekday(int v )
{
this.weekday = v;
}
/**
* Get the email
* @return String
*/
public String getEmail()
{
return email;
}
/**
* Set the value of email
* @param String
*/
public void setEmail(String v )
{
this.email = v;
}
/**
* Get the jobid
* @return int
*/
public int getJobid()
{
return jobid;
}
/**
* Set the value of jobid
* @param int
*/
public void setJobid(int v )
{
this.jobid = v;
}
}
Modified: webstore/src/org/jboss/zol/webstore/ejbs/product/META-INF
ejb-jar.xml
Added: webstore/src/org/jboss/zol/webstore/ejbs/product/META-INF
jboss.xml
Log:
webstore for jBoss 2
Revision Changes Path
1.2 +3 -2
zola/webstore/src/org/jboss/zol/webstore/ejbs/product/META-INF/ejb-jar.xml
Index: ejb-jar.xml
===================================================================
RCS file:
/products/cvs/ejboss/zola/webstore/src/org/jboss/zol/webstore/ejbs/product/META-INF/ejb-jar.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ejb-jar.xml 2000/05/10 14:35:33 1.1
+++ ejb-jar.xml 2000/08/27 20:05:28 1.2
@@ -16,13 +16,13 @@
<resource-ref>
<description>A jdbc connection for the BMP bean</description>
- <res-ref-name>jdbc/myDatabase</res-ref-name>
+ <res-ref-name>WebstorePool</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</entity>
</enterprise-beans>
-
+
<assembly-descriptor>
<container-transaction>
<method>
@@ -32,4 +32,5 @@
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
+
</ejb-jar>
1.1
zola/webstore/src/org/jboss/zol/webstore/ejbs/product/META-INF/jboss.xml
Index: jboss.xml
===================================================================
<?xml version="1.0" encoding="Cp1252"?>
<jboss>
<resource-managers>
<resource-manager res-class="org.jboss.ejb.deployment.JDBCResource">
<res-name>WebstorePool</res-name>
<res-jndi-name>xa.WebstorePool</res-jndi-name>
</resource-manager>
</resource-managers>
<enterprise-beans>
<entity>
<ejb-name>product.ProductEntityHome</ejb-name>
<jndi-name>product.ProductEntityHome</jndi-name>
<configuration-name>Standard BMP EntityBean</configuration-name>
<resource-ref>
<res-ref-name>WebstorePool</res-ref-name>
<resource-name>WebstorePool</resource-name>
</resource-ref>
</entity>
</enterprise-beans>
</jboss>