RE: autoincrement of non primary key

2004-03-04 Thread Dave Newton
On Thu, 2004-03-04 at 01:15, Thomas Edwin Santosa wrote: unique name=foo unique-column name=SESSION_ID/ unique-column name=SECTION_ID/ unique-column name=ACTIVITY_ID/ /unique Will that make the group of them unique, or each one? Dave

Re: autoincrement of non primary key

2004-03-04 Thread Kostyantyn Shchekotykhin
Hi Dave, For unique indexes are created with the following lines: #foreach ($unique in $table.Unices) CONSTRAINT $unique.Name UNIQUE ($unique.ColumnList), #end as you can see you will receive one CONSTRAINT for each unique element, so your index will contain 3 columns. Regards, Kostya Dave

RE: autoincrement of non primary key

2004-03-04 Thread Luca Zappa
unique name=foo unique-column name=SESSION_ID/ unique-column name=SECTION_ID/ unique-column name=ACTIVITY_ID/ /unique Will that make the group of them unique, or each one? Hi Dave, the group of this 3 columns will be unique. Bye   Luca -Original Message- From: Dave Newton

RE: autoincrement of non primary key

2004-03-04 Thread Jeff Cox
Thanks so much all... The unique-column looks to be exactly what I am looking for. Guess I didn't realize I could form a unique constraint in this way. Again thanks for all the suggestions. Jeff -Original Message- From: Luca Zappa [mailto:[EMAIL PROTECTED] Sent: Thursday, March 04,

AW: [Newbie] Trouble executing create-db for MSSQL

2004-03-04 Thread Gerhard Otte
Hello Robert add this line to your build.properties torque.database.manualCreation = true and create the database by hand (enterprise manager). Bye Gerhard Otte __ mailto:[EMAIL PROTECTED] emediapark GmbH http://www.emediapark.de Tel:+49 (0)941 630804-2 Fax:-9 Hemauerstr.14,93047

RE: [Newbie] Trouble executing create-db for MSSQL

2004-03-04 Thread Robert Taylor
Got it! I just saw the Database HowTo Guide on MS SQL Server. Forest for the trees... :) Thanks. robert -Original Message- From: Gerhard Otte [mailto:[EMAIL PROTECTED] Sent: Thursday, March 04, 2004 10:26 AM To: Apache Torque Users List Subject: AW: [Newbie] Trouble executing

How do I use the feature onUpdate=cascade with Torque?

2004-03-04 Thread Tomasz Dreßler
Hi! I have the tables 'server' and 'file'. How can I update the 'server.serveradress' (PK) and 'file.serverAdress' (FK) with Torque? The attribute 'file.serverAdress' have the flag onUpdate=cascade. I try folowing: Criteria crit = new Criteria(); crit.add(ServerPeer.SERVERADRESS,

Re: How do I use the feature onUpdate=cascade with Torque?

2004-03-04 Thread Rob Broadhead
Most databases don't allow the PK to be changed. You should be getting a SQL exception along those lines. Also, in your example you iterate through the list of servers and don't do anything other than iterate so I may not be understanding what you are attempting to do. Rob At 10:02 AM

Re: How do I use the feature onUpdate=cascade with Torque?

2004-03-04 Thread Tomasz Dreßler
Hi Rob Broadhead. I use Mysql witch allow to change PK. I don't get a SQL exception. Torqe do a select from server where server.serveradress='newServerAdress' when I call server.setServeradress(newServerAdress). Of corse, such server is not in Database so Torque do nothing. In my code I don't do

Re: How do I use the feature onUpdate=cascade with Torque?

2004-03-04 Thread Rob Broadhead
I don't have your original code, but the way it works is you need to retrieve the Server object for the row you want to change either using criteria or retrieveByPK on the ServerPeer. Once you have the object call the setServerAddress method to update the value and then save the object. In

RE: How do I use the feature onUpdate=cascade with Torque?

2004-03-04 Thread Luca Zappa
If you need to update the serverAdress in the 'server' table I think it's a better solution if you don't use this field as a primary key. You can add a SERVER_ID for primary key, and then you'll be able to update serverAdress and no changes are needed in the 'file' table. [