svn commit: r345880 - in /db/torque/templates/trunk/src/templates/om: Object.vm ObjectWithManager.vm

2005-11-22 Thread tv
Author: tv
Date: Mon Nov 21 01:20:34 2005
New Revision: 345880

URL: http://svn.apache.org/viewcvs?rev=345880view=rev
Log:
removed the superfluous tmpKey variable

Modified:
db/torque/templates/trunk/src/templates/om/Object.vm
db/torque/templates/trunk/src/templates/om/ObjectWithManager.vm

Modified: db/torque/templates/trunk/src/templates/om/Object.vm
URL: 
http://svn.apache.org/viewcvs/db/torque/templates/trunk/src/templates/om/Object.vm?rev=345880r1=345879r2=345880view=diff
==
--- db/torque/templates/trunk/src/templates/om/Object.vm (original)
+++ db/torque/templates/trunk/src/templates/om/Object.vm Mon Nov 21 01:20:34 
2005
@@ -1448,7 +1448,6 @@
 public void setPrimaryKey(ObjectKey key) throws TorqueException
 {
 SimpleKey[] keys = (SimpleKey[]) key.getValue();
-SimpleKey tmpKey = null;
 #set ($i = 0)
 #foreach ($pk in $table.PrimaryKey)
   #set ($pktype = $pk.JavaNative)

Modified: db/torque/templates/trunk/src/templates/om/ObjectWithManager.vm
URL: 
http://svn.apache.org/viewcvs/db/torque/templates/trunk/src/templates/om/ObjectWithManager.vm?rev=345880r1=345879r2=345880view=diff
==
--- db/torque/templates/trunk/src/templates/om/ObjectWithManager.vm (original)
+++ db/torque/templates/trunk/src/templates/om/ObjectWithManager.vm Mon Nov 21 
01:20:34 2005
@@ -1466,7 +1466,6 @@
 public void setPrimaryKey(ObjectKey key) throws TorqueException
 {
 SimpleKey[] keys = (SimpleKey[]) key.getValue();
-SimpleKey tmpKey = null;
 #set ($i = 0)
 #foreach ($pk in $table.PrimaryKey)
   #set ($pktype = $pk.JavaNative)



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r348240 - in /db/torque: runtime/trunk/xdocs/ templates/trunk/src/templates/sql/base/mysql/ test/trunk/test-project/src/schema/

2005-11-22 Thread tfischer
Author: tfischer
Date: Tue Nov 22 12:28:39 2005
New Revision: 348240

URL: http://svn.apache.org/viewcvs?rev=348240view=rev
Log:
Fixed foreign key support in mysql to allow the referenced table to be declared 
before the referencing table.
This is done by defining the foreign keys in an extra CREATE TABLE statement 
instead of defining them in the CREATE TABLE statement. 
Note that foreign keys are ignored by mysql except in InnoDB tables. 

Thanks to Thoralf Rickert for suggesting the patch.
Fixes also TRQS278
(Added an index in the test-schema to check that)

Modified:
db/torque/runtime/trunk/xdocs/changes.xml
db/torque/templates/trunk/src/templates/sql/base/mysql/foreignkey.vm
db/torque/templates/trunk/src/templates/sql/base/mysql/table.vm
db/torque/templates/trunk/src/templates/sql/base/mysql/tablefk.vm
db/torque/test/trunk/test-project/src/schema/test-schema.xml

Modified: db/torque/runtime/trunk/xdocs/changes.xml
URL: 
http://svn.apache.org/viewcvs/db/torque/runtime/trunk/xdocs/changes.xml?rev=348240r1=348239r2=348240view=diff
==
--- db/torque/runtime/trunk/xdocs/changes.xml (original)
+++ db/torque/runtime/trunk/xdocs/changes.xml Tue Nov 22 12:28:39 2005
@@ -25,6 +25,20 @@
 
   body
 
+  release version=3.2-rc4-dev date=in SVN
+action type=fix dev=tfischer
+  Fixed foreign key support in mysql to allow the referenced table to
+  be declared before the referencing table.
+  This is done by defining the foreign keys in an extra 
+  quot;CREATE TABLEquot; statement instead of defining them in the 
+  quot;CREATE TABLEquot; statement. 
+  Note that foreign keys are ignored by mysql except in InnoDB tables. 
+  br /
+  Thanks to Thoralf Rickert for suggesting the patch.
+  Fixes also TRQS278.
+/action
+  /release
+
   release version=3.2-rc3 date=2005-11-13
 action type=fix dev=tfischer
   Fixed support for limit and offset for Derby in the runtime.

Modified: db/torque/templates/trunk/src/templates/sql/base/mysql/foreignkey.vm
URL: 
http://svn.apache.org/viewcvs/db/torque/templates/trunk/src/templates/sql/base/mysql/foreignkey.vm?rev=348240r1=348239r2=348240view=diff
==
--- db/torque/templates/trunk/src/templates/sql/base/mysql/foreignkey.vm 
(original)
+++ db/torque/templates/trunk/src/templates/sql/base/mysql/foreignkey.vm Tue 
Nov 22 12:28:39 2005
@@ -12,12 +12,16 @@
 ## See the License for the specific language governing permissions and
 ## limitations under the License.
 #foreach ($fk in $table.ForeignKeys)
-FOREIGN KEY ($fk.LocalColumnNames) REFERENCES $fk.ForeignTableName 
($fk.ForeignColumnNames)
+ALTER TABLE $table.Name
+ADD CONSTRAINT $fk.Name
+FOREIGN KEY ($fk.LocalColumnNames)
+REFERENCES $fk.ForeignTableName ($fk.ForeignColumnNames)
   #if ($fk.hasOnUpdate())
 ON UPDATE $fk.OnUpdate
   #end
   #if ($fk.hasOnDelete())
 ON DELETE $fk.OnDelete
   #end
-,
-#end
+;
+
+#end
\ No newline at end of file

Modified: db/torque/templates/trunk/src/templates/sql/base/mysql/table.vm
URL: 
http://svn.apache.org/viewcvs/db/torque/templates/trunk/src/templates/sql/base/mysql/table.vm?rev=348240r1=348239r2=348240view=diff
==
--- db/torque/templates/trunk/src/templates/sql/base/mysql/table.vm (original)
+++ db/torque/templates/trunk/src/templates/sql/base/mysql/table.vm Tue Nov 22 
12:28:39 2005
@@ -20,12 +20,11 @@
 (
 #set ( $cols = $generator.parse($basepath/columns.vm, '', table, $tbl) )
 #set ( $pk = $generator.parse($basepath/primarykey.vm, '', table, $tbl) )
-#set ( $fk = $generator.parse($basepath/foreignkey.vm, '', table, $tbl) )
 #set ( $unique = $generator.parse($basepath/unique.vm, '', table, $tbl) )
 #set ( $index = $generator.parse($basepath/index.vm, '', table, $tbl) )
 
#if($strings.allEmpty([$pk,$fk,$unique,$index]))$strings.chop($cols,2)#else$cols#end
 #if($strings.allEmpty([$fk,$unique,$index])  
$pk.length()0)$strings.chop($pk,2)#else$pk#end
-#if($strings.allEmpty([$unique,$index])  $fk.length() 
0)$strings.chop($fk,2)#else$fk#end
 #if($strings.allEmpty([$index])  
$unique.length()0)$strings.chop($unique,2)#else$unique#end
 #if($index.length()  0)$strings.chop($index,2)#end
 );
+

Modified: db/torque/templates/trunk/src/templates/sql/base/mysql/tablefk.vm
URL: 
http://svn.apache.org/viewcvs/db/torque/templates/trunk/src/templates/sql/base/mysql/tablefk.vm?rev=348240r1=348239r2=348240view=diff
==
--- db/torque/templates/trunk/src/templates/sql/base/mysql/tablefk.vm (original)
+++ db/torque/templates/trunk/src/templates/sql/base/mysql/tablefk.vm Tue Nov 
22 12:28:39 2005
@@ -11,4 +11,5 @@
 ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 ## See the License for the 

[SOURCE] Issue #TRQS278 modified

2005-11-22 Thread thomas fischer
You can view the issue detail at the following URL:

http://issues.apache.org/scarab/issues/id/TRQS278

Type
 Defect

Issue ID
 TRQS278 (mysql  innodb tables and order of index creation from schema)

Modified by
 thomas fischer
 [EMAIL PROTECTED] ([EMAIL PROTECTED])

The following modifications were made to this issue:
-

Resolution set to Fixed
Status changed from New to Closed
Database set to MySQL

Reason:
Fixed by the patch which allows to define the tables which are referenced by 
foreign keys before the referencing tables

-
This message is automatically generated by the Scarab
issue tracking system.  For more information:
http://scarab.tigris.org/



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[SOURCE] Issue #TRQS278 modified

2005-11-22 Thread thomas fischer
You can view the issue detail at the following URL:

http://issues.apache.org/scarab/issues/id/TRQS278

Type
 Defect

Issue ID
 TRQS278 (mysql  innodb tables and order of index creation from schema)

Modified by
 thomas fischer
 [EMAIL PROTECTED] ([EMAIL PROTECTED])

The following modifications were made to this issue:
-

Operating system has been undefined.

Reason:
This bug was not OS-dependant

-
This message is automatically generated by the Scarab
issue tracking system.  For more information:
http://scarab.tigris.org/



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[SOURCE] Issue #TRQS330 modified

2005-11-22 Thread thomas fischer
You can view the issue detail at the following URL:

http://issues.apache.org/scarab/issues/id/TRQS330

Type
 Defect

Issue ID
 TRQS330 (derby table vm generates invalid SQL)

Modified by
 thomas fischer
 [EMAIL PROTECTED] ([EMAIL PROTECTED])

The following modifications were made to this issue:
-

Added comment to issue 'Could you please use diff -u next time ? This would 
make it easier to apply the patch.
Thanks in advance.'


-
This message is automatically generated by the Scarab
issue tracking system.  For more information:
http://scarab.tigris.org/



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]