update of database schema

2004-03-03 Thread Chris Joelly
Hello!

i have a database (sapdb) which i have build from db-schema.xml.

now i have extended the schema (added a few tables, added some columns
and so on...). is it possible with torque to migrate the schema? or do i
have to export all data and reimport after a new build of the database
using torque?

thx, Chris

-- 
mit freundlichen Grüßen / with kind regards
 
Ing. Christian Jölly @ Solutions
unycom  Information Technology Services GmbH
A-8042 Graz | Schmiedlstraße 1 / III

Tel: ++43 (0)316 / 818 828 - 30
Fax: ++43 (0)316 / 818 828 - 38
[EMAIL PROTECTED]
http://www.unycom.com

Wenn zwei Menschen immer die gleichen Ansichten haben,
ist einer von ihnen überflüssig.


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



FW: java.sql.SQLException: Unable to connect to any hosts due to exception: Connection rejected

2004-03-03 Thread Frank Nguyen

Hi,

I kept getting the JDBC connection problem with mysql when running 'ant -f
build-torque.xml create-db'. I tried both localhost and remote. I was able
to connect using 'mysql -h 'localhost|remotename' -u root'. There must be
something wrong, either with the jdbc driver, or the config files
(attached). I have mysql-connector-java-3.0.9-stable-bin.jar installed under
/torque/lib and j2sdkx.x.x/jre/lib/ext. Did I miss something else ?

Thanks,

Frank Nguyen


BUILD FAILED
file:D:/torque-gen-3.1/build-torque.xml:292: java.sql.SQLException: Unable
to
nnect to any hosts due to exception: java.net.ConnectException: Connection
re
ed: connect
at
org.apache.tools.ant.taskdefs.JDBCTask.getConnection(JDBCTask.java
2)
at org.apache.tools.ant.taskdefs.SQLExec.execute(SQLExec.java:358)
at org.apache.tools.ant.Task.perform(Task.java:317)
at org.apache.tools.ant.Target.execute(Target.java:309)
at org.apache.tools.ant.Target.performTasks(Target.java:334)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
at org.apache.tools.ant.Main.runBuild(Main.java:610)
at org.apache.tools.ant.Main.start(Main.java:196)
at org.apache.tools.ant.Main.main(Main.java:235)

  

  
  
  
  
  
  
  

  
  

  
  
  
  
  
  
  
  
  

  

  
  

  

  

  
  
  
  
  
  
  
  
  
  

  
  
  
  
  
  
  
  

  



  

  
  
  
  
  
  

  

  

  

  
  
  
  
  
  

  

  

  

  
  
  
  
  
  
  

  

  

  

  









  

  


  

  

  


  

  

  
  
  
  
  
  


  








  

  

  
  
  
  
  
  

  

  

  

  


  



  Executing the create-db.sql script ...



  

  

  
  
  

  


  

  

  
  
  

  








  

  
  
  

  








  

  
  
  

  









  

  

  
  
  

  








  

  
  
  
  
  

  








  

  
  
  
  
  
  

  

  

  

  











  

  

  

  

  

  

  


  
  
  
  
  

  

  


  


  


  


  

  

  













  
  
  
  


  
  
  
  



  
  
  
  


  
  
  
  

  

  



  
  



  



  

  




  

  



  
  



  



  

  


  

  
  
  

  




  

  

  
  
  
  
  
  
  
  
  

  


  

  
  
  

  




  

  

  
  
  

  


  

  








  

  

  








  

  



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

RE: java.sql.SQLException: Unable to connect to any hosts due to exception: Connection rejected

2004-03-03 Thread Luca Zappa
Hi Frank,
tell us more about build.properties, there is probably some mistakes in the
torque.database.createUrl property. 
It must be something like this:
torque.database.createUrl = jdbc:mysql://127.0.0.2/mysql

You must specify an existent database in createUrl (mysql).


Bye
  Luca

-Original Message-
From: Frank Nguyen [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 03, 2004 8:04 PM
To: Apache Torque Users List
Subject: FW: java.sql.SQLException: Unable to connect to any hosts due to
exception: Connection rejected


Hi,

I kept getting the JDBC connection problem with mysql when running 'ant -f
build-torque.xml create-db'. I tried both localhost and remote. I was able
to connect using 'mysql -h 'localhost|remotename' -u root'. There must be
something wrong, either with the jdbc driver, or the config files
(attached). I have mysql-connector-java-3.0.9-stable-bin.jar installed under
/torque/lib and j2sdkx.x.x/jre/lib/ext. Did I miss something else ?

Thanks,

Frank Nguyen


BUILD FAILED
file:D:/torque-gen-3.1/build-torque.xml:292: java.sql.SQLException: Unable
to nnect to any hosts due to exception: java.net.ConnectException:
Connection re
ed: connect
at
org.apache.tools.ant.taskdefs.JDBCTask.getConnection(JDBCTask.java
2)
at org.apache.tools.ant.taskdefs.SQLExec.execute(SQLExec.java:358)
at org.apache.tools.ant.Task.perform(Task.java:317)
at org.apache.tools.ant.Target.execute(Target.java:309)
at org.apache.tools.ant.Target.performTasks(Target.java:334)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
at org.apache.tools.ant.Main.runBuild(Main.java:610)
at org.apache.tools.ant.Main.start(Main.java:196)
at org.apache.tools.ant.Main.main(Main.java:235)


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



autoincrement of non primary key

2004-03-03 Thread Jeff Cox
Title: Message



Hi,
    I 
am running into a problem when trying to create a table with a field that is not 
a primary key but is to be unique and to be autoincremented. The XML is as 
follows:
 
 
=

        
        
        
    
    
unique>        
    foreign-key>    
    
    
foreign-key>    
    
    
foreign-key>table>
 

Now I have been through a number of archive messages and I 
haven't found a solution. I can't set idMethod="naitive" because that causes the 
three fields that are part of the primaryKey to be autoincremented. This I don't 
want... those fields are foreign keys. This table is basically used to create a 
many to many relationship with three other tables. I have the ID field so that I 
can uniquely identify each relationship. Othe tables will then use ID as a 
foreign key.(maybe this is bad DB design, if you have a suggestion to improve I 
would appreciate that as well)
=
The SQL that is generated from the above is as 
follows:
DROP TABLE T_SESSION_ACTIVITY 
CASCADE;
CREATE TABLE 
T_SESSION_ACTIVITY(    
ID,  
-- REFERENCES T_CAMP_SESSION (ID)    SESSION_ID integer NOT 
NULL,  
-- REFERENCES T_ACTIVITY_SECTION (ID)    SECTION_ID integer 
NOT 
NULL,  
-- REFERENCES T_ACTIVITY (ID)    ACTIVITY_ID integer NOT 
NULL,    
MAX_SEATS integer NOT NULL,    PRIMARY KEY 
(SESSION_ID,SECTION_ID,ACTIVITY_ID),    CONSTRAINT 
T_SESSION_ACTIVITY_U_1 UNIQUE (ID));
=
This unfortunatly is not even 
valid SQL, as the field type is missing for ID. What I would expect to see is as 
follows:
=
DROP TABLE T_SESSION_ACTIVITY CASCADE;DROP SEQUENCE 
T_SESSION_ACTIVITY_SEQ;
CREATE SEQUENCE 
T_SESSION_ACITIVTY_SEQ;
CREATE TABLE 
T_SESSION_ACTIVITY(    
ID integer DEFAULT nextval('T_SESSION_ACTIVITY_SEQ') NOT 
NULL,  
-- REFERENCES T_CAMP_SESSION (ID)    SESSION_ID integer NOT 
NULL,  
-- REFERENCES T_ACTIVITY_SECTION (ID)    SECTION_ID integer 
NOT 
NULL,  
-- REFERENCES T_ACTIVITY (ID)    ACTIVITY_ID integer NOT 
NULL,    
MAX_SEATS integer NOT NULL,    PRIMARY KEY 
(SESSION_ID,SECTION_ID,ACTIVITY_ID),    CONSTRAINT 
T_SESSION_ACTIVITY_U_1 UNIQUE (ID));
 
Anyone have any idea what I am doing 
wrong?
 
BTW I am using Torque 3.1 and postgres 
7.3
 
 
Thanks,
Jeff


smime.p7s
Description: S/MIME cryptographic signature



Re: autoincrement of non primary key

  
Jeff,

>From the way you've described this, it sounds like 'ID' should be the
primary key. It is unique, autoincremented, and used in other tables
to refer to this one--sounds like a primary key to me.
Seems like the other 3 columns are just foreign keys, not primary.
But maybe I'm missing something...

  Dale


On Wed, 3 Mar 2004 16:25:09 -0500, "Jeff Cox" <[EMAIL PROTECTED]>
said:
> Hi,
> I am running into a problem when trying to create a table with a
> field that is not a primary key but is to be unique and to be
> autoincremented. The XML is as follows:
>  
>  
> =
>  idMethod="none">
>  autoIncrement="true"/>
>  required="true" autoIncrement="false"/>
>  required="true" autoIncrement="false"/>
>  required="true" autoIncrement="false"/>
>  autoIncrement="false"/>
> 
> 
> 
>  onDelete="cascade">
> 
> 
>  onDelete="cascade">
> 
> 
>  onDelete="cascade">
> 
> 
> 
> 
>  
> 
> 
> 
> Now I have been through a number of archive messages and I haven't found
> a solution. I can't set idMethod="naitive" because that causes the three
> fields that are part of the primaryKey to be autoincremented. This I
> don't want... those fields are foreign keys. This table is basically
> used to create a many to many relationship with three other tables. I
> have the ID field so that I can uniquely identify each relationship.
> Othe tables will then use ID as a foreign key.(maybe this is bad DB
> design, if you have a suggestion to improve I would appreciate that as
> well)
> 
> =
> 
> The SQL that is generated from the above is as follows:
> 
> DROP TABLE T_SESSION_ACTIVITY CASCADE;
> 
> 
> CREATE TABLE T_SESSION_ACTIVITY
> (
> ID,
>   -- REFERENCES T_CAMP_SESSION (ID)
> SESSION_ID integer NOT NULL,
>   -- REFERENCES T_ACTIVITY_SECTION
> (ID)
> SECTION_ID integer NOT NULL,
>   -- REFERENCES T_ACTIVITY (ID)
> ACTIVITY_ID integer NOT NULL,
> MAX_SEATS integer NOT NULL,
> PRIMARY KEY (SESSION_ID,SECTION_ID,ACTIVITY_ID),
> CONSTRAINT T_SESSION_ACTIVITY_U_1 UNIQUE (ID)
> );
> 
> =
> 
> This unfortunatly is not even valid SQL, as the field type is missing
> for ID. What I would expect to see is as follows:
> 
> =
> 
> DROP TABLE T_SESSION_ACTIVITY CASCADE;
> DROP SEQUENCE T_SESSION_ACTIVITY_SEQ;
> 
> CREATE SEQUENCE T_SESSION_ACITIVTY_SEQ;
> 
> CREATE TABLE T_SESSION_ACTIVITY
> (
> ID integer DEFAULT
> nextval('T_SESSION_ACTIVITY_SEQ') NOT NULL,
>   -- REFERENCES T_CAMP_SESSION (ID)
> SESSION_ID integer NOT NULL,
>   -- REFERENCES T_ACTIVITY_SECTION
> (ID)
> SECTION_ID integer NOT NULL,
>   -- REFERENCES T_ACTIVITY (ID)
> ACTIVITY_ID integer NOT NULL,
> MAX_SEATS integer NOT NULL,
> PRIMARY KEY (SESSION_ID,SECTION_ID,ACTIVITY_ID),
> CONSTRAINT T_SESSION_ACTIVITY_U_1 UNIQUE (ID)
> );
> 
>  
> 
> Anyone have any idea what I am doing wrong?
> 
>  
> 
> BTW I am using Torque 3.1 and postgres 7.3
> 
>  
> 
>  
> 
> Thanks,
> 
> Jeff
> 


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



RE: autoincrement of non primary key

Dale,
First let me say I really appreciate you responding to my question.
Secondly, I would agree with you and in fact considered that possibility
early on in the design, but the truth is I need any given combination of
(SESSION_ID, SECTION_ID, ACTIVITY_ID) to be unique. I don't know of
another way to enforce this in the schema, except by making them the
primary key. If there is another way to do this my problem would
certainly be solved...

Though it doesn't seem to answer why what I currently have causes Torque
to generate incorrect SQL syntax. Other than the fact that what I am
trying to do is a poor design, something very possible

Jeff

-Original Message-
From: Dale Thoms [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 03, 2004 5:18 PM
To: Apache Torque Users List
Subject: Re: autoincrement of non primary key

  
Jeff,

>From the way you've described this, it sounds like 'ID' should be the
primary key. It is unique, autoincremented, and used in other tables
to refer to this one--sounds like a primary key to me.
Seems like the other 3 columns are just foreign keys, not primary.
But maybe I'm missing something...

  Dale


On Wed, 3 Mar 2004 16:25:09 -0500, "Jeff Cox" <[EMAIL PROTECTED]>
said:
> Hi,
> I am running into a problem when trying to create a table with a
> field that is not a primary key but is to be unique and to be
> autoincremented. The XML is as follows:
>  
>  
> =
>  idMethod="none">
>  autoIncrement="true"/>
>  required="true" autoIncrement="false"/>
>  required="true" autoIncrement="false"/>
>  required="true" autoIncrement="false"/>
>  autoIncrement="false"/>
> 
> 
> 
>  onDelete="cascade">
> 
> 
>  onDelete="cascade">
> 
> 
>  onDelete="cascade">
> 
> 
> 
> 
>  
> 
> 
> 
> Now I have been through a number of archive messages and I haven't
found
> a solution. I can't set idMethod="naitive" because that causes the
three
> fields that are part of the primaryKey to be autoincremented. This I
> don't want... those fields are foreign keys. This table is basically
> used to create a many to many relationship with three other tables. I
> have the ID field so that I can uniquely identify each relationship.
> Othe tables will then use ID as a foreign key.(maybe this is bad DB
> design, if you have a suggestion to improve I would appreciate that as
> well)
> 
> =
> 
> The SQL that is generated from the above is as follows:
> 
> DROP TABLE T_SESSION_ACTIVITY CASCADE;
> 
> 
> CREATE TABLE T_SESSION_ACTIVITY
> (
> ID,
>   -- REFERENCES T_CAMP_SESSION
(ID)
> SESSION_ID integer NOT NULL,
>   -- REFERENCES T_ACTIVITY_SECTION
> (ID)
> SECTION_ID integer NOT NULL,
>   -- REFERENCES T_ACTIVITY (ID)
> ACTIVITY_ID integer NOT NULL,
> MAX_SEATS integer NOT NULL,
> PRIMARY KEY (SESSION_ID,SECTION_ID,ACTIVITY_ID),
> CONSTRAINT T_SESSION_ACTIVITY_U_1 UNIQUE (ID)
> );
> 
> =
> 
> This unfortunatly is not even valid SQL, as the field type is missing
> for ID. What I would expect to see is as follows:
> 
> =
> 
> DROP TABLE T_SESSION_ACTIVITY CASCADE;
> DROP SEQUENCE T_SESSION_ACTIVITY_SEQ;
> 
> CREATE SEQUENCE T_SESSION_ACITIVTY_SEQ;
> 
> CREATE TABLE T_SESSION_ACTIVITY
> (
> ID integer DEFAULT
> nextval('T_SESSION_ACTIVITY_SEQ') NOT NULL,
>   -- REFERENCES T_CAMP_SESSION
(ID)
> SESSION_ID integer NOT NULL,
>   -- REFERENCES T_ACTIVITY_SECTION
> (ID)
> SECTION_ID integer NOT NULL,
>   -- REFERENCES T_ACTIVITY (ID)
> ACTIVITY_ID integer NOT NULL,
> MAX_SEATS integer NOT NULL,
> PRIMARY KEY (SESSION_ID,SECTION_ID,ACTIVITY_ID),
> CONSTRAINT T_SESSION_ACTIVITY_U_1 UNIQUE (ID)
> );
> 
>  
> 
> Anyone have any idea what I am doing wrong?
> 
>  
> 
> BTW I am using Torque 3.1 and postgres 7.3
> 
>  
> 
>  
> 
> Thanks,
> 
> Jeff
> 


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



smime.p7s
Description: S/MIME cryptographic signature


RE: autoincrement of non primary key

On Wed, 2004-03-03 at 20:52, Jeff Cox wrote:
> Dale,
> First let me say I really appreciate you responding to my question.
> Secondly, I would agree with you and in fact considered that possibility
> early on in the design, but the truth is I need any given combination of
> (SESSION_ID, SECTION_ID, ACTIVITY_ID) to be unique. I don't know of
> another way to enforce this in the schema, except by making them the
> primary key. If there is another way to do this my problem would
> certainly be solved...

The  stuff doesn't work?

Wait, you need _any_combination_ of those three values to be unique? I
don't get it. If any combination of those needs to be unique then you
only need one number.

Dave



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



RE: autoincrement of non primary key

Unless I am missing something,  only makes the individual field
unique. What I need is the combination to be unique. In other words... 

If 
SESSION_ID = 10
SECTION_ID = 15
ACTIVITY_ID = 25

then 10, 15, and 25 can't be again used together.. but

SESSION_ID = 10
SECTION_ID = 15
ACTIVITY_ID = 30

Would work because even though SESSION_ID and SECTION_ID have been 10
and 15 before, they have not been in combination with 30.

I could just make ID the key but then the following would be allowed

ID = 1
SESSION_ID = 10
SECTION_ID = 15
ACTIVITY_ID = 25

ID = 2
SESSION_ID = 10
SECTION_ID = 15
ACTIVITY_ID = 25

Etc. etc 

Jeff

-Original Message-
From: Dave Newton [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 03, 2004 9:10 PM
To: Apache Torque Users List
Subject: RE: autoincrement of non primary key

On Wed, 2004-03-03 at 20:52, Jeff Cox wrote:
> Dale,
> First let me say I really appreciate you responding to my
question.
> Secondly, I would agree with you and in fact considered that
possibility
> early on in the design, but the truth is I need any given combination
of
> (SESSION_ID, SECTION_ID, ACTIVITY_ID) to be unique. I don't know of
> another way to enforce this in the schema, except by making them the
> primary key. If there is another way to do this my problem would
> certainly be solved...

The  stuff doesn't work?

Wait, you need _any_combination_ of those three values to be unique? I
don't get it. If any combination of those needs to be unique then you
only need one number.

Dave



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



smime.p7s
Description: S/MIME cryptographic signature


RE: autoincrement of non primary key


Hi,

I am no expert but from my limited understanding of databases I understand
the following :

The fundamental principle of a primary key is to be unique.
The fundamental principle of a non primary key is to have duplicate.
What we are attempting to do here is to have a non-primary key behave like a
primary key.

If we require a non primary key to be unique then I think you may be better
of
Implementing a trigger to do a select to detect the presence of the key
combination
SESSION_ID = 10
SECTION_ID = 15
ACTIVITY_ID = 30

If the record exists then it could "raise an error" which would be treated
as an exception in your code.
You may have a composite index on (SESSION_ID, SECTION_ID, ACTIVITY_ID) if
you have a large amount of data and you are concerned about performance.

Hope this helps

Lakshman


-Original Message-
From: Jeff Cox [mailto:[EMAIL PROTECTED] 
Sent: 04 March 2004 15:55
To: [EMAIL PROTECTED]
Subject: RE: autoincrement of non primary key


Unless I am missing something,  only makes the individual field
unique. What I need is the combination to be unique. In other words... 

If 
SESSION_ID = 10
SECTION_ID = 15
ACTIVITY_ID = 25

then 10, 15, and 25 can't be again used together.. but

SESSION_ID = 10
SECTION_ID = 15
ACTIVITY_ID = 30

Would work because even though SESSION_ID and SECTION_ID have been 10 and 15
before, they have not been in combination with 30.

I could just make ID the key but then the following would be allowed

ID = 1
SESSION_ID = 10
SECTION_ID = 15
ACTIVITY_ID = 25

ID = 2
SESSION_ID = 10
SECTION_ID = 15
ACTIVITY_ID = 25

Etc. etc 

Jeff

-Original Message-
From: Dave Newton [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 03, 2004 9:10 PM
To: Apache Torque Users List
Subject: RE: autoincrement of non primary key

On Wed, 2004-03-03 at 20:52, Jeff Cox wrote:
> Dale,
> First let me say I really appreciate you responding to my
question.
> Secondly, I would agree with you and in fact considered that
possibility
> early on in the design, but the truth is I need any given combination
of
> (SESSION_ID, SECTION_ID, ACTIVITY_ID) to be unique. I don't know of 
> another way to enforce this in the schema, except by making them the 
> primary key. If there is another way to do this my problem would 
> certainly be solved...

The  stuff doesn't work?

Wait, you need _any_combination_ of those three values to be unique? I don't
get it. If any combination of those needs to be unique then you only need
one number.

Dave



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


Australia Post is committed to providing our customers with excellent service. If we 
can assist you in any way please telephone 13 13 18 or visit our website 
www.auspost.com.au.

CAUTION

This e-mail and any files transmitted with it are privileged and confidential 
information intended for the use of the addressee. The confidentiality and/or 
privilege in this e-mail is not waived, lost or destroyed if it has been transmitted 
to you in error. If you have received this e-mail in error you must (a) not 
disseminate, copy or take any action in reliance on it; (b) please notify Australia 
Post immediately by return e-mail to the sender; and (c) please delete the original 
e-mail.

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



RE: autoincrement of non primary key

On Wed, 2004-03-03 at 23:55, Jeff Cox wrote:
> Unless I am missing something,  only makes the individual field
> unique. What I need is the combination to be unique. In other words... 
> 
> If 
> SESSION_ID = 10
> SECTION_ID = 15
> ACTIVITY_ID = 25
> 
> then 10, 15, and 25 can't be again used together.. but
> 
> SESSION_ID = 10
> SECTION_ID = 15
> ACTIVITY_ID = 30
> 
> Would work because even though SESSION_ID and SECTION_ID have been 10
> and 15 before, they have not been in combination with 30.

Oh, I see what you mean now. Still don't understand why, though ;)

In any case, you'd need to write your own logic to handle this case, as
it isn't really that common.

It seems like perhaps you might want to break up the tables a bit, maybe
rethink the mapping a bit. IOW, it looks like you have a think called a
session, a section, and an activity. Rather than mapping them all in one
table, have an activity table that has an activity_id (unique, primary
key) and session and section ids that point into the session and section
tables.

Without knowing what you're actually trying to accomplish it's tough ;)

Dave



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



RE: autoincrement of non primary key

Hi,
On Kam, 2004-03-04 at 12:49, Dave Newton wrote:
> On Wed, 2004-03-03 at 23:55, Jeff Cox wrote:
> > Unless I am missing something,  only makes the individual field
> > unique. What I need is the combination to be unique. In other words... 
> > 
> > If 
> > SESSION_ID = 10
> > SECTION_ID = 15
> > ACTIVITY_ID = 25
> > 
> > then 10, 15, and 25 can't be again used together.. but
> > 
> > SESSION_ID = 10
> > SECTION_ID = 15
> > ACTIVITY_ID = 30
> > 
> > Would work because even though SESSION_ID and SECTION_ID have been 10
> > and 15 before, they have not been in combination with 30.
> 
> Oh, I see what you mean now. Still don't understand why, though ;)
> 
> In any case, you'd need to write your own logic to handle this case, as
> it isn't really that common.
How about:





> 
> It seems like perhaps you might want to break up the tables a bit, maybe
> rethink the mapping a bit. IOW, it looks like you have a think called a
> session, a section, and an activity. Rather than mapping them all in one
> table, have an activity table that has an activity_id (unique, primary
> key) and session and section ids that point into the session and section
> tables.
> 
> Without knowing what you're actually trying to accomplish it's tough ;)
> 
> Dave
Regards,
Thomas Edwin Santosa


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



SQLException Error code -- Any help will be appreicated. If I am in the wrong list could you please direct me to the correct one.


Hi,


I have looked at the archives, but I cannot find a way of getting the
SQLException ErrorCode.

I am using Torque 3.0 and during a save() a Foreign Key / Unique key
constraint is violated and an Exception is thrown.
I cannot determine the error because the actual Exception thrown is Torque
Exception, and this does not have the SQLException error code.
Is there any way round this.


Thanks
Lakshman


Australia Post is committed to providing our customers with excellent service. If we 
can assist you in any way please telephone 13 13 18 or visit our website 
www.auspost.com.au.

CAUTION

This e-mail and any files transmitted with it are privileged and confidential 
information intended for the use of the addressee. The confidentiality and/or 
privilege in this e-mail is not waived, lost or destroyed if it has been transmitted 
to you in error. If you have received this e-mail in error you must (a) not 
disseminate, copy or take any action in reliance on it; (b) please notify Australia 
Post immediately by return e-mail to the sender; and (c) please delete the original 
e-mail.

addGroupByColumn()

Hi, I'm ichikawa.

I have a problem while I am developing a portlet of Jetspeed 1.4
with Torque-3.0.2 and PostgreSQL 7.3.4, j2sdk 1.4.1
I would like to execute this SQL,

SELECT login_name FROM turbine_user GROUP BY login_name

( column login_name is defined as VARCHAR )

so, I typed Java source code like this.

Criteria crit = new Criteria();
crit.addSelectColumn( TurbineUserPeer.LOGIN_NAME );
crit.addGroupByColumn( TurbineUserPeer.LOGIN_NAME );
List result = TurbineUserPeer.doSelect( crit, conn );

But, method doSelect() always throws DataSetException
of Village, exception message is
"Bad conversion: java.lang.NumberFormatException: For input string: "admin""

I debuged source code of Criteria to confirm the SQL, it is

"SELECT TURBINE_USER.LOGIN_NAME FROM TURBINE_USER
GROUP BY TURBINE_USER.LOGIN_NAME".
There is no error of the SQL with pgsql of PostgreSQL,
so I wondered why the exception was thrown.
I thought Village had some bugs, and I replaced Village with
the latest one 'village-2.0-dev-20030825.jar' from Torque 3.1
source code archive, but the exception also was thrown in
this case.
Could you give me advice to execute the SQL for "GROUP BY"
with Criteria ?


---
Kenji Ichikawa
mailto:[EMAIL PROTECTED]
http://www.seta.co.jp/ 

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