mpoeschl 2003/07/02 09:01:55
Modified: src/generator/src/templates/ojb/repository Repository.vm
MainRepository.vm
Log:
MainRepository.vm: add sequence-manager definition
Repository.vm: remove usage of ${space} + formatting
Revision Changes Path
1.3 +16 -22
db-torque/src/generator/src/templates/ojb/repository/Repository.vm
Index: Repository.vm
===================================================================
RCS file:
/home/cvs/db-torque/src/generator/src/templates/ojb/repository/Repository.vm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Repository.vm 26 Jun 2003 17:41:00 -0000 1.2
+++ Repository.vm 2 Jul 2003 16:01:54 -0000 1.3
@@ -2,17 +2,14 @@
#set ( $unknownTorqueTypes = [ 'NULL', 'OTHER', 'JAVA_OBJECT', 'DISTINCT',
'STRUCT', 'ARRAY', 'REF', 'BOOLEANINT', 'BOOLEANCHAR' ] )
#set ( $mappedJdbcTypes = ['INTEGER', 'BLOB', 'BLOB', 'BLOB', 'BLOB', 'BLOB',
'BLOB', 'INTEGER', 'CHAR' ] )
#set ( $fieldsWithNoSize = ['INTEGER', 'BLOB', 'CLOB', 'DATE', 'TIME', 'TIMESTAMP',
'BINARY', 'BIGINT', 'SMALLINT', 'TINYINT' ] )
-#set ( $space = " " )
#if ($database.Package)
#set ($package = $database.Package)
#else
#set ($package = $targetPackage)
#end
-
#foreach ($table in $database.tables)
-
<!--
==============================================================
TABLE $table.Name
@@ -36,7 +33,6 @@
#end
#foreach ($col in $table.Columns)
-
<!--
COLUMN $col.Name
..............................................
@@ -48,7 +44,7 @@
#set ( $colType = $col.getType() )
#set ( $colTypeClass = $colType.getClass() )
#set ( $colTypeClassName = $colTypeClass.getName() )
- ## === determin the type of the field. OJB recognizes less types than Torque,
thus unkown types must be mapped
+ ## === determin the type of the field. OJB recognizes less types than Torque,
thus unkown types must be mapped
#if ($mappingPos != -1)
#set ( $jdbcFieldType = $mappedJdbcTypes.get($mappingPos) )
#if ( $mappedJdbcTypes.get($mappingPos) == "CHAR" )
@@ -58,7 +54,7 @@
#end
#else ## == no mapping is required
#set ( $jdbcFieldType = $col.TorqueType )
- ## === split the size field into length and precision
+ ## === split the size field into length and precision
#if ($col.size != "")
#set ( $sizeList = $size.split(",") )
#set ( $foundPart = 0 )
@@ -79,34 +75,32 @@
name="$col.UncapitalisedJavaName"
column="$col.Name"
jdbc-type="$jdbcFieldType"
-#if ($col.isNotNull()) ${space}nullable="false"
+#if ($col.isNotNull())
+ nullable="false"
#end
-#if ($indices.indexOf($col.Name) != -1) ${space}indexed="true"
+#if ($indices.indexOf($col.Name) != -1)
+ indexed="true"
#end
-#if ($col.isPrimaryKey()) ${space}primarykey="true"
+#if ($col.isPrimaryKey())
+ primarykey="true"
#end
-#if ($col.isAutoIncrement()) ${space}autoincrement="true"
+#if ($col.isAutoIncrement())
+ autoincrement="true"
#end
-#if ($size != "" && $size != "0")
- ${space}length="${size}"
+#if ($size != "" && $size != "0")
+ length="${size}"
#end
-#if ($precision != "") ${space}precision="${precision}"
+#if ($precision != "")
+ precision="${precision}"
#end
#if ($col.TorqueType == "BOOLEANINT")
-
${space}conversion="org.apache.ojb.broker.accesslayer.conversions.Boolean2IntFieldConversion"
+
conversion="org.apache.ojb.broker.accesslayer.conversions.Boolean2IntFieldConversion"
#end
#if ($col.TorqueType == "BOOLEANCHAR")
- ${space}conversion="insert-conversion-class-here"
+ conversion="insert-conversion-class-here"
#end
-
/>
-
#end
-
</class-descriptor>
-
-
#end
-
-
1.5 +9 -2
db-torque/src/generator/src/templates/ojb/repository/MainRepository.vm
Index: MainRepository.vm
===================================================================
RCS file:
/home/cvs/db-torque/src/generator/src/templates/ojb/repository/MainRepository.vm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- MainRepository.vm 26 Jun 2003 22:08:48 -0000 1.4
+++ MainRepository.vm 2 Jul 2003 16:01:55 -0000 1.5
@@ -35,8 +35,15 @@
#end
username="$databaseUser"
password="$!databasePassword"
- />
-
+ >
+ <sequence-manager
className="org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl">
+ <attribute attribute-name="grabSize" attribute-value="5"/>
+ <attribute attribute-name="globalSequenceId" attribute-value="false"/>
+ <attribute attribute-name="globalSequenceStart" attribute-value="10000"/>
+ </sequence-manager>
+ </jdbc-connection-descriptor>
+
+
<!-- include internal mappings here -->
&internal;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]