From kimberly77@example.net Wed Jan 1 19:23:06 2003 Return-Path: <kimberly77@example.net> Mailing-List: contact kimberly77@example.net; run by ezmlm Delivered-To: mailing list kimberly77@example.net Received: (qmail 9221 invoked by uid 97); 1 Jan 2003 19:23:06 -0000 Received: (qmail 9216 invoked by uid 98); 1 Jan 2003 19:23:06 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Received: (qmail 9197 invoked from network); 1 Jan 2003 19:23:04 -0000 Received: from daedalus.apache.org (HELO apache.org) (83.161.120.155) by nagoya.betaversion.org with SMTP; 1 Jan 2003 19:23:04 -0000 Received: (qmail 14981 invoked by uid 500); 1 Jan 2003 19:21:45 -0000 Received: (qmail 14974 invoked from network); 1 Jan 2003 19:21:45 -0000 Received: from icarus.apache.org (83.161.120.155) by daedalus.apache.org with SMTP; 1 Jan 2003 19:21:45 -0000 Received: (qmail 67268 invoked by uid 1520); 1 Jan 2003 19:21:44 -0000 Date: 1 Jan 2003 19:21:44 -0000 Message-ID: <kimberly77@example.net> From: kimberly77@example.net To: kimberly77@example.net Subject: cvs commit: jakarta-ojb/src/java/org/apache/ojb/broker Identity.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N olegnitz 2003/01/01 11:21:44 Modified: src/java/org/apache/ojb/broker Identity.java Log: Minor performance improvements Revision Changes Path 1.11 +5 -13 jakarta-ojb/src/java/org/apache/ojb/broker/Identity.java Index: Identity.java =================================================================== RCS file: /home/cvs/jakarta-ojb/src/java/org/apache/ojb/broker/Identity.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- Identity.java 28 Dec 2002 11:46:41 -0000 1.10 +++ Identity.java 1 Jan 2003 19:21:44 -0000 1.11 @@ -291,13 +291,14 @@ if (stringRepresentation == null) { StringBuffer buf = new StringBuffer(); + buf.append(objectsClass.getName()); for (int i = 0; i < pkValues.length; i++) { - buf.append((buf.length() == 0) ? "{" : ","); + buf.append((i == 0) ? "{" : ","); buf.append(pkValues[i]); } buf.append("}"); - stringRepresentation = objectsClass.getName() + buf.toString(); + stringRepresentation = buf.toString(); } return stringRepresentation; } @@ -369,15 +370,6 @@ */ public int hashCode() { - int hash = getObjectsClass().hashCode(); - for (int i = 0; i < pkValues.length; i++) - { - if (pkValues[i] != null - && (this.pkValues[i] instanceof String || this.pkValues[i] instanceof Number)) - { - hash = 31 * hash + this.pkValues[i].hashCode(); - } - } - return hash; + return toString().hashCode(); } } From kimberly77@example.net Thu Jan 2 09:37:50 2003 Return-Path: <kimberly77@example.net> Mailing-List: contact kimberly77@example.net; run by ezmlm Delivered-To: mailing list kimberly77@example.net Received: (qmail 21668 invoked by uid 97); 2 Jan 2003 09:37:50 -0000 Received: (qmail 21664 invoked by uid 98); 2 Jan 2003 09:37:50 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Received: (qmail 21626 invoked from network); 2 Jan 2003 09:37:48 -0000 Received: from daedalus.apache.org (HELO apache.org) (83.161.120.155) by nagoya.betaversion.org with SMTP; 2 Jan 2003 09:37:48 -0000 Received: (qmail 84523 invoked by uid 500); 2 Jan 2003 09:36:20 -0000 Received: (qmail 84516 invoked from network); 2 Jan 2003 09:36:20 -0000 Received: from icarus.apache.org (83.161.120.155) by daedalus.apache.org with SMTP; 2 Jan 2003 09:36:20 -0000 Received: (qmail 7150 invoked by uid 1513); 2 Jan 2003 09:36:19 -0000 Date: 2 Jan 2003 09:36:19 -0000 Message-ID: <kimberly77@example.net> From: kimberly77@example.net To: kimberly77@example.net Subject: cvs commit: jakarta-ojb/src/java/org/apache/ojb/broker/singlevm PersistenceBrokerImpl.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N brj 2003/01/02 01:36:19 Modified: src/java/org/apache/ojb/broker/singlevm PersistenceBrokerImpl.java Log: support "distinct" in getCount() Revision Changes Path 1.102 +18 -3 jakarta-ojb/src/java/org/apache/ojb/broker/singlevm/PersistenceBrokerImpl.java Index: PersistenceBrokerImpl.java =================================================================== RCS file: /home/cvs/jakarta-ojb/src/java/org/apache/ojb/broker/singlevm/PersistenceBrokerImpl.java,v retrieving revision 1.101 retrieving revision 1.102 diff -u -r1.101 -r1.102 --- PersistenceBrokerImpl.java 31 Dec 2002 11:42:41 -0000 1.101 +++ PersistenceBrokerImpl.java 2 Jan 2003 09:36:18 -0000 1.102 @@ -2275,8 +2275,9 @@ { ReportQueryByCriteria reportQuery; Criteria reportCrit = null; - String[] columns = new String[]{"count(*)"}; Iterator iter; + FieldDescriptor[] pkFields = getClassDescriptor(query.getSearchClass()).getPkFields(); + String[] columns = new String[pkFields.length]; int result = 0; // build a ReportQuery based on query @@ -2285,7 +2286,21 @@ { reportCrit = query.getCriteria().copy(false, false, false); } - + + // BRJ: add a column for each pkField, make it distinct if query is distinct + // tbd check if it really works for multiple keys ? + for (int i = 0; i < pkFields.length; i++) + { + if (query.isDistinct()) + { + columns[i] = "count(distinct " + pkFields[i].getAttributeName() + ")"; + } + else + { + columns[i] = "count(" + pkFields[i].getAttributeName() + ")"; + } + } + // BRJ: we have to preserve indirection table ! if (query instanceof MtoNQuery) { From kimberly77@example.net Thu Jan 2 09:39:30 2003 Return-Path: <kimberly77@example.net> Mailing-List: contact kimberly77@example.net; run by ezmlm Delivered-To: mailing list kimberly77@example.net Received: (qmail 23394 invoked by uid 97); 2 Jan 2003 09:39:30 -0000 Received: (qmail 23390 invoked by uid 98); 2 Jan 2003 09:39:30 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Received: (qmail 23371 invoked from network); 2 Jan 2003 09:39:28 -0000 Received: from daedalus.apache.org (HELO apache.org) (83.161.120.155) by nagoya.betaversion.org with SMTP; 2 Jan 2003 09:39:28 -0000 Received: (qmail 86214 invoked by uid 500); 2 Jan 2003 09:38:00 -0000 Received: (qmail 86206 invoked from network); 2 Jan 2003 09:38:00 -0000 Received: from icarus.apache.org (83.161.120.155) by daedalus.apache.org with SMTP; 2 Jan 2003 09:38:00 -0000 Received: (qmail 7340 invoked by uid 1513); 2 Jan 2003 09:37:58 -0000 Date: 2 Jan 2003 09:37:58 -0000 Message-ID: <kimberly77@example.net> From: kimberly77@example.net To: kimberly77@example.net Subject: cvs commit: jakarta-ojb/src/java/org/apache/ojb/broker/accesslayer/sql SqlQueryStatement.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N brj 2003/01/02 01:37:58 Modified: src/java/org/apache/ojb/broker/accesslayer/sql SqlQueryStatement.java Log: support columns like "count(distinct x)" Revision Changes Path 1.16 +13 -4 jakarta-ojb/src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java Index: SqlQueryStatement.java =================================================================== RCS file: /home/cvs/jakarta-ojb/src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- SqlQueryStatement.java 24 Dec 2002 12:57:51 -0000 1.15 +++ SqlQueryStatement.java 2 Jan 2003 09:37:58 -0000 1.16 @@ -147,17 +147,27 @@ FieldDescriptor fld = null; int braceBegin; int braceEnd; + int colBegin; String functionName; String colName; int sp; TableAlias alias = null; + // BRJ : look for functions ie: count(x) or count(distinct x) braceBegin = attr.indexOf("("); braceEnd = attr.indexOf(")"); if (braceBegin >= 0 && braceEnd >= 0) { - functionName = attr.substring(0, braceBegin); - colName = attr.substring(braceBegin + 1, braceEnd).trim(); + // BRJ : look for count(distinct x) + colBegin = attr.indexOf(" ", braceBegin); + if (colBegin < 0) + { + colBegin = braceBegin; + } + + // BRJ : functionName includes starting brace + functionName = attr.substring(0, colBegin + 1); + colName = attr.substring(colBegin + 1, braceEnd).trim(); } else { @@ -227,7 +237,6 @@ if (functionName != null) // rebuild function { buf.append(functionName); - buf.append("("); } if (fld != null) From kimberly77@example.net Thu Jan 2 09:41:17 2003 Return-Path: <kimberly77@example.net> Mailing-List: contact kimberly77@example.net; run by ezmlm Delivered-To: mailing list kimberly77@example.net Received: (qmail 24483 invoked by uid 97); 2 Jan 2003 09:41:17 -0000 Received: (qmail 24479 invoked by uid 98); 2 Jan 2003 09:41:17 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Received: (qmail 24460 invoked from network); 2 Jan 2003 09:41:15 -0000 Received: from daedalus.apache.org (HELO apache.org) (83.161.120.155) by nagoya.betaversion.org with SMTP; 2 Jan 2003 09:41:15 -0000 Received: (qmail 86721 invoked by uid 500); 2 Jan 2003 09:39:48 -0000 Received: (qmail 86713 invoked from network); 2 Jan 2003 09:39:48 -0000 Received: from icarus.apache.org (83.161.120.155) by daedalus.apache.org with SMTP; 2 Jan 2003 09:39:48 -0000 Received: (qmail 7788 invoked by uid 1513); 2 Jan 2003 09:39:46 -0000 Date: 2 Jan 2003 09:39:46 -0000 Message-ID: <kimberly77@example.net> From: kimberly77@example.net To: kimberly77@example.net Subject: cvs commit: jakarta-ojb/src/test/org/apache/ojb/broker PersistenceBrokerTest.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N brj 2003/01/02 01:39:46 Modified: src/test/org/apache/ojb/broker PersistenceBrokerTest.java Log: compare counted and retrieved sizes Revision Changes Path 1.21 +6 -0 jakarta-ojb/src/test/org/apache/ojb/broker/PersistenceBrokerTest.java Index: PersistenceBrokerTest.java =================================================================== RCS file: /home/cvs/jakarta-ojb/src/test/org/apache/ojb/broker/PersistenceBrokerTest.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- PersistenceBrokerTest.java 24 Dec 2002 14:06:45 -0000 1.20 +++ PersistenceBrokerTest.java 2 Jan 2003 09:39:46 -0000 1.21 @@ -611,14 +611,20 @@ Article a3 = createArticle(id3); a3.setArticleName(name); broker.store(a3); + // 3. check if all items are found col = broker.getCollectionByQuery(query); assertEquals("size of collection should be three", 3, col.size()); + + assertEquals("size of count should be three", 3, broker.getCount(query)); + iter = col.iterator(); while (iter.hasNext()) { assertEquals("should be same value", name, ((InterfaceArticle) iter.next()).getArticleName()); } + + } public void testGetCollectionByQueryWithStartAndEnd() throws Exception From kimberly77@example.net Thu Jan 2 13:41:58 2003 Return-Path: <kimberly77@example.net> Mailing-List: contact kimberly77@example.net; run by ezmlm Delivered-To: mailing list kimberly77@example.net Received: (qmail 9849 invoked by uid 98); 2 Jan 2003 13:41:58 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Received: (qmail 9634 invoked from network); 2 Jan 2003 13:41:54 -0000 Received: from daedalus.apache.org (HELO apache.org) (83.161.120.155) by nagoya.betaversion.org with SMTP; 2 Jan 2003 13:41:54 -0000 Received: (qmail 30196 invoked by uid 500); 2 Jan 2003 13:40:38 -0000 Received: (qmail 30168 invoked from network); 2 Jan 2003 13:40:38 -0000 Received: from icarus.apache.org (83.161.120.155) by daedalus.apache.org with SMTP; 2 Jan 2003 13:40:38 -0000 Received: (qmail 68931 invoked by uid 1064); 2 Jan 2003 13:40:37 -0000 Date: 2 Jan 2003 13:40:37 -0000 Message-ID: <kimberly77@example.net> From: Stefan Bodewig <kimberly77@example.net> To: kimberly77@example.net Subject: [GUMP] Test Failure - OJB X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ---------------------------------------------------- This email is autogenerated from the output from: <http://cvs.apache.org/builds/gump/2003-01-02/test-ojb.html> ---------------------------------------------------- Buildfile: build.xml set-archive-name: set-archive-name-date: detect-jdk: use-jdk12: use-jdk13: use-jdk14: [echo] detected JDK 1.4 init: prepare: preprocess: [echo] using switches: +JDK13, +JDBC30 [java] ................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... [java] .............................................................................................................................................................................................................. main: useP6Spy: dontUseP6Spy: [echo] NOT using P6Spy prepare-repository: [copy] Copying 14 files to /home/rubys/jakarta/jakarta-ojb/target/test/ojb [copy] Copying 1 file to /home/rubys/jakarta/jakarta-ojb/target/test [copy] Copying 1 file to /home/rubys/jakarta/jakarta-ojb/target/test prepare-testdb: Duplicated project name in import. Project ObJectRelationalBridge defined first in /home/rubys/jakarta/jakarta-ojb/build.xml and again in /home/rubys/jakarta/jakarta-ojb/build.xml initJNETSQLServer: getJSQLDriver: project-sql-classpath: [echo] +------------------------------------------+ [echo] | | [echo] | Generating SQL for OJB Testsuite! | [echo] | enJoy! | [echo] | | [echo] +------------------------------------------+ [torque-sql] Using contextProperties file: /home/rubys/jakarta/jakarta-ojb/build.properties [torque-sql] Using classpath [torque-sql] Generating to file /home/rubys/jakarta/jakarta-ojb/target/src/sql/report.ojbtest.sql.generation [torque-sql] Parsing file: 'ojbcore-schema.xml' [torque-sql] Resolver: used http://jakarta.apache.org/turbine/dtd/database.dtd [torque-sql] Parsing file: 'ojbtest-schema.xml' [torque-sql] Resolver: used http://jakarta.apache.org/turbine/dtd/database.dtd [torque-sql] java.lang.NullPointerException [torque-sql] at java.io.Reader.<init>(Reader.java:61) [torque-sql] at java.io.InputStreamReader.<init>(InputStreamReader.java:80) [torque-sql] at java.util.Properties.load(Properties.java:189) [torque-sql] at org.apache.torque.engine.database.model.AppData.getIdiosyncrasies(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Database.getProperty(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.ConstraintNameGenerator.generateName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.NameFactory.generateName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.acquireConstraintName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.doNaming(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Database.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.AppData.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.AppData.getDatabase(Unknown Source) [torque-sql] at org.apache.torque.task.TorqueDataModelTask.initControlContext(Unknown Source) [torque-sql] at org.apache.torque.task.TorqueSQLTask.initControlContext(Unknown Source) [torque-sql] at org.apache.velocity.texen.ant.TexenTask.execute(TexenTask.java:485) [torque-sql] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:185) [torque-sql] at org.apache.tools.ant.Task.perform(Task.java:348) [torque-sql] at org.apache.tools.ant.Target.execute(Target.java:309) [torque-sql] at org.apache.tools.ant.Target.performTasks(Target.java:336) [torque-sql] at org.apache.tools.ant.Project.executeTarget(Project.java:1244) [torque-sql] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:373) [torque-sql] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:185) [torque-sql] at org.apache.tools.ant.Task.perform(Task.java:348) [torque-sql] at org.apache.tools.ant.Target.execute(Target.java:309) [torque-sql] at org.apache.tools.ant.Target.performTasks(Target.java:336) [torque-sql] at org.apache.tools.ant.Project.executeTarget(Project.java:1244) [torque-sql] at org.apache.tools.ant.Project.executeTargets(Project.java:1188) [torque-sql] at org.apache.tools.ant.Main.runBuild(Main.java:614) [torque-sql] at org.apache.tools.ant.Main.start(Main.java:197) [torque-sql] at org.apache.tools.ant.Main.main(Main.java:235) [torque-sql] Database-specific properties file does not exist: /home/rubys/jakarta/jakarta-ojb/sql/base/hypersonic/db.props [torque-sql] java.lang.NullPointerException [torque-sql] at java.io.Reader.<init>(Reader.java:61) [torque-sql] at java.io.InputStreamReader.<init>(InputStreamReader.java:80) [torque-sql] at java.util.Properties.load(Properties.java:189) [torque-sql] at org.apache.torque.engine.database.model.AppData.getIdiosyncrasies(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Database.getProperty(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.ConstraintNameGenerator.generateName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.NameFactory.generateName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.acquireConstraintName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.doNaming(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Database.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.AppData.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.AppData.getDatabase(Unknown Source) [torque-sql] at org.apache.torque.task.TorqueDataModelTask.initControlContext(Unknown Source) [torque-sql] at org.apache.torque.task.TorqueSQLTask.initControlContext(Unknown Source) [torque-sql] at org.apache.velocity.texen.ant.TexenTask.execute(TexenTask.java:485) [torque-sql] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:185) [torque-sql] at org.apache.tools.ant.Task.perform(Task.java:348) [torque-sql] at org.apache.tools.ant.Target.execute(Target.java:309) [torque-sql] at org.apache.tools.ant.Target.performTasks(Target.java:336) [torque-sql] at org.apache.tools.ant.Project.executeTarget(Project.java:1244) [torque-sql] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:373) [torque-sql] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:185) [torque-sql] at org.apache.tools.ant.Task.perform(Task.java:348) [torque-sql] at org.apache.tools.ant.Target.execute(Target.java:309) [torque-sql] at org.apache.tools.ant.Target.performTasks(Target.java:336) [torque-sql] at org.apache.tools.ant.Project.executeTarget(Project.java:1244) [torque-sql] at org.apache.tools.ant.Project.executeTargets(Project.java:1188) [torque-sql] at org.apache.tools.ant.Main.runBuild(Main.java:614) [torque-sql] at org.apache.tools.ant.Main.start(Main.java:197) [torque-sql] at org.apache.tools.ant.Main.main(Main.java:235) [torque-sql] Database-specific properties file does not exist: /home/rubys/jakarta/jakarta-ojb/sql/base/hypersonic/db.props [torque-sql] java.lang.NullPointerException [torque-sql] at java.io.Reader.<init>(Reader.java:61) [torque-sql] at java.io.InputStreamReader.<init>(InputStreamReader.java:80) [torque-sql] at java.util.Properties.load(Properties.java:189) [torque-sql] at org.apache.torque.engine.database.model.AppData.getIdiosyncrasies(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Database.getProperty(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.ConstraintNameGenerator.generateName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.NameFactory.generateName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.acquireConstraintName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.doNaming(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Database.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.AppData.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.AppData.getDatabase(Unknown Source) [torque-sql] at org.apache.torque.task.TorqueDataModelTask.initControlContext(Unknown Source) [torque-sql] at org.apache.torque.task.TorqueSQLTask.initControlContext(Unknown Source) [torque-sql] at org.apache.velocity.texen.ant.TexenTask.execute(TexenTask.java:485) [torque-sql] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:185) [torque-sql] at org.apache.tools.ant.Task.perform(Task.java:348) [torque-sql] at org.apache.tools.ant.Target.execute(Target.java:309) [torque-sql] at org.apache.tools.ant.Target.performTasks(Target.java:336) [torque-sql] at org.apache.tools.ant.Project.executeTarget(Project.java:1244) [torque-sql] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:373) [torque-sql] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:185) [torque-sql] at org.apache.tools.ant.Task.perform(Task.java:348) [torque-sql] at org.apache.tools.ant.Target.execute(Target.java:309) [torque-sql] at org.apache.tools.ant.Target.performTasks(Target.java:336) [torque-sql] at org.apache.tools.ant.Project.executeTarget(Project.java:1244) [torque-sql] at org.apache.tools.ant.Project.executeTargets(Project.java:1188) [torque-sql] at org.apache.tools.ant.Main.runBuild(Main.java:614) [torque-sql] at org.apache.tools.ant.Main.start(Main.java:197) [torque-sql] at org.apache.tools.ant.Main.main(Main.java:235) [torque-sql] Database-specific properties file does not exist: /home/rubys/jakarta/jakarta-ojb/sql/base/hypersonic/db.props [torque-sql] java.lang.NullPointerException [torque-sql] at java.io.Reader.<init>(Reader.java:61) [torque-sql] at java.io.InputStreamReader.<init>(InputStreamReader.java:80) [torque-sql] at java.util.Properties.load(Properties.java:189) [torque-sql] at org.apache.torque.engine.database.model.AppData.getIdiosyncrasies(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Database.getProperty(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.ConstraintNameGenerator.generateName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.NameFactory.generateName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.acquireConstraintName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.doNaming(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Database.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.AppData.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.AppData.getDatabase(Unknown Source) [torque-sql] at org.apache.torque.task.TorqueDataModelTask.initControlContext(Unknown Source) [torque-sql] at org.apache.torque.task.TorqueSQLTask.initControlContext(Unknown Source) [torque-sql] at org.apache.velocity.texen.ant.TexenTask.execute(TexenTask.java:485) [torque-sql] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:185) [torque-sql] at org.apache.tools.ant.Task.perform(Task.java:348) [torque-sql] at org.apache.tools.ant.Target.execute(Target.java:309) [torque-sql] at org.apache.tools.ant.Target.performTasks(Target.java:336) [torque-sql] at org.apache.tools.ant.Project.executeTarget(Project.java:1244) [torque-sql] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:373) [torque-sql] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:185) [torque-sql] at org.apache.tools.ant.Task.perform(Task.java:348) [torque-sql] at org.apache.tools.ant.Target.execute(Target.java:309) [torque-sql] at org.apache.tools.ant.Target.performTasks(Target.java:336) [torque-sql] at org.apache.tools.ant.Project.executeTarget(Project.java:1244) [torque-sql] at org.apache.tools.ant.Project.executeTargets(Project.java:1188) [torque-sql] at org.apache.tools.ant.Main.runBuild(Main.java:614) [torque-sql] at org.apache.tools.ant.Main.start(Main.java:197) [torque-sql] at org.apache.tools.ant.Main.main(Main.java:235) [torque-sql] Database-specific properties file does not exist: /home/rubys/jakarta/jakarta-ojb/sql/base/hypersonic/db.props [torque-sql] java.lang.NullPointerException [torque-sql] at java.io.Reader.<init>(Reader.java:61) [torque-sql] at java.io.InputStreamReader.<init>(InputStreamReader.java:80) [torque-sql] at java.util.Properties.load(Properties.java:189) [torque-sql] at org.apache.torque.engine.database.model.AppData.getIdiosyncrasies(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Database.getProperty(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.ConstraintNameGenerator.generateName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.NameFactory.generateName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.acquireConstraintName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.doNaming(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Database.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.AppData.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.AppData.getDatabase(Unknown Source) [torque-sql] at org.apache.torque.task.TorqueDataModelTask.initControlContext(Unknown Source) [torque-sql] at org.apache.torque.task.TorqueSQLTask.initControlContext(Unknown Source) [torque-sql] at org.apache.velocity.texen.ant.TexenTask.execute(TexenTask.java:485) [torque-sql] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:185) [torque-sql] at org.apache.tools.ant.Task.perform(Task.java:348) [torque-sql] at org.apache.tools.ant.Target.execute(Target.java:309) [torque-sql] at org.apache.tools.ant.Target.performTasks(Target.java:336) [torque-sql] at org.apache.tools.ant.Project.executeTarget(Project.java:1244) [torque-sql] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:373) [torque-sql] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:185) [torque-sql] at org.apache.tools.ant.Task.perform(Task.java:348) [torque-sql] at org.apache.tools.ant.Target.execute(Target.java:309) [torque-sql] at org.apache.tools.ant.Target.performTasks(Target.java:336) [torque-sql] at org.apache.tools.ant.Project.executeTarget(Project.java:1244) [torque-sql] at org.apache.tools.ant.Project.executeTargets(Project.java:1188) [torque-sql] at org.apache.tools.ant.Main.runBuild(Main.java:614) [torque-sql] at org.apache.tools.ant.Main.start(Main.java:197) [torque-sql] at org.apache.tools.ant.Main.main(Main.java:235) [torque-sql] Database-specific properties file does not exist: /home/rubys/jakarta/jakarta-ojb/sql/base/hypersonic/db.props [torque-sql] java.lang.NullPointerException [torque-sql] at java.io.Reader.<init>(Reader.java:61) [torque-sql] at java.io.InputStreamReader.<init>(InputStreamReader.java:80) [torque-sql] at java.util.Properties.load(Properties.java:189) [torque-sql] at org.apache.torque.engine.database.model.AppData.getIdiosyncrasies(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Database.getProperty(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.ConstraintNameGenerator.generateName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.NameFactory.generateName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.acquireConstraintName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.doNaming(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Database.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.AppData.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.AppData.getDatabase(Unknown Source) [torque-sql] at org.apache.torque.task.TorqueDataModelTask.initControlContext(Unknown Source) [torque-sql] at org.apache.torque.task.TorqueSQLTask.initControlContext(Unknown Source) [torque-sql] at org.apache.velocity.texen.ant.TexenTask.execute(TexenTask.java:485) [torque-sql] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:185) [torque-sql] at org.apache.tools.ant.Task.perform(Task.java:348) [torque-sql] at org.apache.tools.ant.Target.execute(Target.java:309) [torque-sql] at org.apache.tools.ant.Target.performTasks(Target.java:336) [torque-sql] at org.apache.tools.ant.Project.executeTarget(Project.java:1244) [torque-sql] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:373) [torque-sql] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:185) [torque-sql] at org.apache.tools.ant.Task.perform(Task.java:348) [torque-sql] at org.apache.tools.ant.Target.execute(Target.java:309) [torque-sql] at org.apache.tools.ant.Target.performTasks(Target.java:336) [torque-sql] at org.apache.tools.ant.Project.executeTarget(Project.java:1244) [torque-sql] at org.apache.tools.ant.Project.executeTargets(Project.java:1188) [torque-sql] at org.apache.tools.ant.Main.runBuild(Main.java:614) [torque-sql] at org.apache.tools.ant.Main.start(Main.java:197) [torque-sql] at org.apache.tools.ant.Main.main(Main.java:235) [torque-sql] Database-specific properties file does not exist: /home/rubys/jakarta/jakarta-ojb/sql/base/hypersonic/db.props [torque-sql] java.lang.NullPointerException [torque-sql] at java.io.Reader.<init>(Reader.java:61) [torque-sql] at java.io.InputStreamReader.<init>(InputStreamReader.java:80) [torque-sql] at java.util.Properties.load(Properties.java:189) [torque-sql] at org.apache.torque.engine.database.model.AppData.getIdiosyncrasies(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Database.getProperty(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.ConstraintNameGenerator.generateName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.NameFactory.generateName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.acquireConstraintName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.doNaming(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Database.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.AppData.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.AppData.getDatabase(Unknown Source) [torque-sql] at org.apache.torque.task.TorqueDataModelTask.initControlContext(Unknown Source) [torque-sql] at org.apache.torque.task.TorqueSQLTask.initControlContext(Unknown Source) [torque-sql] at org.apache.velocity.texen.ant.TexenTask.execute(TexenTask.java:485) [torque-sql] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:185) [torque-sql] at org.apache.tools.ant.Task.perform(Task.java:348) [torque-sql] at org.apache.tools.ant.Target.execute(Target.java:309) [torque-sql] at org.apache.tools.ant.Target.performTasks(Target.java:336) [torque-sql] at org.apache.tools.ant.Project.executeTarget(Project.java:1244) [torque-sql] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:373) [torque-sql] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:185) [torque-sql] at org.apache.tools.ant.Task.perform(Task.java:348) [torque-sql] at org.apache.tools.ant.Target.execute(Target.java:309) [torque-sql] at org.apache.tools.ant.Target.performTasks(Target.java:336) [torque-sql] at org.apache.tools.ant.Project.executeTarget(Project.java:1244) [torque-sql] at org.apache.tools.ant.Project.executeTargets(Project.java:1188) [torque-sql] at org.apache.tools.ant.Main.runBuild(Main.java:614) [torque-sql] at org.apache.tools.ant.Main.start(Main.java:197) [torque-sql] at org.apache.tools.ant.Main.main(Main.java:235) [torque-sql] Database-specific properties file does not exist: /home/rubys/jakarta/jakarta-ojb/sql/base/hypersonic/db.props [torque-sql] java.lang.NullPointerException [torque-sql] at java.io.Reader.<init>(Reader.java:61) [torque-sql] at java.io.InputStreamReader.<init>(InputStreamReader.java:80) [torque-sql] at java.util.Properties.load(Properties.java:189) [torque-sql] at org.apache.torque.engine.database.model.AppData.getIdiosyncrasies(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Database.getProperty(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.ConstraintNameGenerator.generateName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.NameFactory.generateName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.acquireConstraintName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.doNaming(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Database.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.AppData.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.AppData.getDatabase(Unknown Source) [torque-sql] at org.apache.torque.task.TorqueDataModelTask.initControlContext(Unknown Source) [torque-sql] at org.apache.torque.task.TorqueSQLTask.initControlContext(Unknown Source) [torque-sql] at org.apache.velocity.texen.ant.TexenTask.execute(TexenTask.java:485) [torque-sql] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:185) [torque-sql] at org.apache.tools.ant.Task.perform(Task.java:348) [torque-sql] at org.apache.tools.ant.Target.execute(Target.java:309) [torque-sql] at org.apache.tools.ant.Target.performTasks(Target.java:336) [torque-sql] at org.apache.tools.ant.Project.executeTarget(Project.java:1244) [torque-sql] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:373) [torque-sql] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:185) [torque-sql] at org.apache.tools.ant.Task.perform(Task.java:348) [torque-sql] at org.apache.tools.ant.Target.execute(Target.java:309) [torque-sql] at org.apache.tools.ant.Target.performTasks(Target.java:336) [torque-sql] at org.apache.tools.ant.Project.executeTarget(Project.java:1244) [torque-sql] at org.apache.tools.ant.Project.executeTargets(Project.java:1188) [torque-sql] at org.apache.tools.ant.Main.runBuild(Main.java:614) [torque-sql] at org.apache.tools.ant.Main.start(Main.java:197) [torque-sql] at org.apache.tools.ant.Main.main(Main.java:235) [torque-sql] Database-specific properties file does not exist: /home/rubys/jakarta/jakarta-ojb/sql/base/hypersonic/db.props [torque-sql] java.lang.NullPointerException [torque-sql] at java.io.Reader.<init>(Reader.java:61) [torque-sql] at java.io.InputStreamReader.<init>(InputStreamReader.java:80) [torque-sql] at java.util.Properties.load(Properties.java:189) [torque-sql] at org.apache.torque.engine.database.model.AppData.getIdiosyncrasies(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Database.getProperty(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.ConstraintNameGenerator.generateName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.NameFactory.generateName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.acquireConstraintName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.doNaming(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Database.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.AppData.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.AppData.getDatabase(Unknown Source) [torque-sql] at org.apache.torque.task.TorqueDataModelTask.initControlContext(Unknown Source) [torque-sql] at org.apache.torque.task.TorqueSQLTask.initControlContext(Unknown Source) [torque-sql] at org.apache.velocity.texen.ant.TexenTask.execute(TexenTask.java:485) [torque-sql] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:185) [torque-sql] at org.apache.tools.ant.Task.perform(Task.java:348) [torque-sql] at org.apache.tools.ant.Target.execute(Target.java:309) [torque-sql] at org.apache.tools.ant.Target.performTasks(Target.java:336) [torque-sql] at org.apache.tools.ant.Project.executeTarget(Project.java:1244) [torque-sql] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:373) [torque-sql] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:185) [torque-sql] at org.apache.tools.ant.Task.perform(Task.java:348) [torque-sql] at org.apache.tools.ant.Target.execute(Target.java:309) [torque-sql] at org.apache.tools.ant.Target.performTasks(Target.java:336) [torque-sql] at org.apache.tools.ant.Project.executeTarget(Project.java:1244) [torque-sql] at org.apache.tools.ant.Project.executeTargets(Project.java:1188) [torque-sql] at org.apache.tools.ant.Main.runBuild(Main.java:614) [torque-sql] at org.apache.tools.ant.Main.start(Main.java:197) [torque-sql] at org.apache.tools.ant.Main.main(Main.java:235) [torque-sql] Database-specific properties file does not exist: /home/rubys/jakarta/jakarta-ojb/sql/base/hypersonic/db.props [torque-sql] java.lang.NullPointerException [torque-sql] at java.io.Reader.<init>(Reader.java:61) [torque-sql] at java.io.InputStreamReader.<init>(InputStreamReader.java:80) [torque-sql] at java.util.Properties.load(Properties.java:189) [torque-sql] at org.apache.torque.engine.database.model.AppData.getIdiosyncrasies(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Database.getProperty(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.ConstraintNameGenerator.generateName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.NameFactory.generateName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.acquireConstraintName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.doNaming(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Database.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.AppData.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.AppData.getDatabase(Unknown Source) [torque-sql] at org.apache.torque.task.TorqueDataModelTask.initControlContext(Unknown Source) [torque-sql] at org.apache.torque.task.TorqueSQLTask.initControlContext(Unknown Source) [torque-sql] at org.apache.velocity.texen.ant.TexenTask.execute(TexenTask.java:485) [torque-sql] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:185) [torque-sql] at org.apache.tools.ant.Task.perform(Task.java:348) [torque-sql] at org.apache.tools.ant.Target.execute(Target.java:309) [torque-sql] at org.apache.tools.ant.Target.performTasks(Target.java:336) [torque-sql] at org.apache.tools.ant.Project.executeTarget(Project.java:1244) [torque-sql] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:373) [torque-sql] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:185) [torque-sql] at org.apache.tools.ant.Task.perform(Task.java:348) [torque-sql] at org.apache.tools.ant.Target.execute(Target.java:309) [torque-sql] at org.apache.tools.ant.Target.performTasks(Target.java:336) [torque-sql] at org.apache.tools.ant.Project.executeTarget(Project.java:1244) [torque-sql] at org.apache.tools.ant.Project.executeTargets(Project.java:1188) [torque-sql] at org.apache.tools.ant.Main.runBuild(Main.java:614) [torque-sql] at org.apache.tools.ant.Main.start(Main.java:197) [torque-sql] at org.apache.tools.ant.Main.main(Main.java:235) [torque-sql] Database-specific properties file does not exist: /home/rubys/jakarta/jakarta-ojb/sql/base/hypersonic/db.props [torque-sql] java.lang.NullPointerException [torque-sql] at java.io.Reader.<init>(Reader.java:61) [torque-sql] at java.io.InputStreamReader.<init>(InputStreamReader.java:80) [torque-sql] at java.util.Properties.load(Properties.java:189) [torque-sql] at org.apache.torque.engine.database.model.AppData.getIdiosyncrasies(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Database.getProperty(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.ConstraintNameGenerator.generateName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.NameFactory.generateName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.acquireConstraintName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.doNaming(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Database.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.AppData.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.AppData.getDatabase(Unknown Source) [torque-sql] at org.apache.torque.task.TorqueDataModelTask.initControlContext(Unknown Source) [torque-sql] at org.apache.torque.task.TorqueSQLTask.initControlContext(Unknown Source) [torque-sql] at org.apache.velocity.texen.ant.TexenTask.execute(TexenTask.java:485) [torque-sql] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:185) [torque-sql] at org.apache.tools.ant.Task.perform(Task.java:348) [torque-sql] at org.apache.tools.ant.Target.execute(Target.java:309) [torque-sql] at org.apache.tools.ant.Target.performTasks(Target.java:336) [torque-sql] at org.apache.tools.ant.Project.executeTarget(Project.java:1244) [torque-sql] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:373) [torque-sql] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:185) [torque-sql] at org.apache.tools.ant.Task.perform(Task.java:348) [torque-sql] at org.apache.tools.ant.Target.execute(Target.java:309) [torque-sql] at org.apache.tools.ant.Target.performTasks(Target.java:336) [torque-sql] at org.apache.tools.ant.Project.executeTarget(Project.java:1244) [torque-sql] at org.apache.tools.ant.Project.executeTargets(Project.java:1188) [torque-sql] at org.apache.tools.ant.Main.runBuild(Main.java:614) [torque-sql] at org.apache.tools.ant.Main.start(Main.java:197) [torque-sql] at org.apache.tools.ant.Main.main(Main.java:235) [torque-sql] Database-specific properties file does not exist: /home/rubys/jakarta/jakarta-ojb/sql/base/hypersonic/db.props [torque-sql] java.lang.NullPointerException [torque-sql] at java.io.Reader.<init>(Reader.java:61) [torque-sql] at java.io.InputStreamReader.<init>(InputStreamReader.java:80) [torque-sql] at java.util.Properties.load(Properties.java:189) [torque-sql] at org.apache.torque.engine.database.model.AppData.getIdiosyncrasies(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Database.getProperty(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.ConstraintNameGenerator.generateName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.NameFactory.generateName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.acquireConstraintName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.doNaming(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Database.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.AppData.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.AppData.getDatabase(Unknown Source) [torque-sql] at org.apache.torque.task.TorqueDataModelTask.initControlContext(Unknown Source) [torque-sql] at org.apache.torque.task.TorqueSQLTask.initControlContext(Unknown Source) [torque-sql] at org.apache.velocity.texen.ant.TexenTask.execute(TexenTask.java:485) [torque-sql] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:185) [torque-sql] at org.apache.tools.ant.Task.perform(Task.java:348) [torque-sql] at org.apache.tools.ant.Target.execute(Target.java:309) [torque-sql] at org.apache.tools.ant.Target.performTasks(Target.java:336) [torque-sql] at org.apache.tools.ant.Project.executeTarget(Project.java:1244) [torque-sql] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:373) [torque-sql] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:185) [torque-sql] at org.apache.tools.ant.Task.perform(Task.java:348) [torque-sql] at org.apache.tools.ant.Target.execute(Target.java:309) [torque-sql] at org.apache.tools.ant.Target.performTasks(Target.java:336) [torque-sql] at org.apache.tools.ant.Project.executeTarget(Project.java:1244) [torque-sql] at org.apache.tools.ant.Project.executeTargets(Project.java:1188) [torque-sql] at org.apache.tools.ant.Main.runBuild(Main.java:614) [torque-sql] at org.apache.tools.ant.Main.start(Main.java:197) [torque-sql] at org.apache.tools.ant.Main.main(Main.java:235) [torque-sql] Database-specific properties file does not exist: /home/rubys/jakarta/jakarta-ojb/sql/base/hypersonic/db.props [torque-sql] java.lang.NullPointerException [torque-sql] at java.io.Reader.<init>(Reader.java:61) [torque-sql] at java.io.InputStreamReader.<init>(InputStreamReader.java:80) [torque-sql] at java.util.Properties.load(Properties.java:189) [torque-sql] at org.apache.torque.engine.database.model.AppData.getIdiosyncrasies(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Database.getProperty(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.ConstraintNameGenerator.generateName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.NameFactory.generateName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.acquireConstraintName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.doNaming(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Database.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.AppData.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.AppData.getDatabase(Unknown Source) [torque-sql] at org.apache.torque.task.TorqueDataModelTask.initControlContext(Unknown Source) [torque-sql] at org.apache.torque.task.TorqueSQLTask.initControlContext(Unknown Source) [torque-sql] at org.apache.velocity.texen.ant.TexenTask.execute(TexenTask.java:485) [torque-sql] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:185) [torque-sql] at org.apache.tools.ant.Task.perform(Task.java:348) [torque-sql] at org.apache.tools.ant.Target.execute(Target.java:309) [torque-sql] at org.apache.tools.ant.Target.performTasks(Target.java:336) [torque-sql] at org.apache.tools.ant.Project.executeTarget(Project.java:1244) [torque-sql] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:373) [torque-sql] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:185) [torque-sql] at org.apache.tools.ant.Task.perform(Task.java:348) [torque-sql] at org.apache.tools.ant.Target.execute(Target.java:309) [torque-sql] at org.apache.tools.ant.Target.performTasks(Target.java:336) [torque-sql] at org.apache.tools.ant.Project.executeTarget(Project.java:1244) [torque-sql] at org.apache.tools.ant.Project.executeTargets(Project.java:1188) [torque-sql] at org.apache.tools.ant.Main.runBuild(Main.java:614) [torque-sql] at org.apache.tools.ant.Main.start(Main.java:197) [torque-sql] at org.apache.tools.ant.Main.main(Main.java:235) [torque-sql] Database-specific properties file does not exist: /home/rubys/jakarta/jakarta-ojb/sql/base/hypersonic/db.props [torque-sql] java.lang.NullPointerException [torque-sql] at java.io.Reader.<init>(Reader.java:61) [torque-sql] at java.io.InputStreamReader.<init>(InputStreamReader.java:80) [torque-sql] at java.util.Properties.load(Properties.java:189) [torque-sql] at org.apache.torque.engine.database.model.AppData.getIdiosyncrasies(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Database.getProperty(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.ConstraintNameGenerator.generateName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.NameFactory.generateName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.acquireConstraintName(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.doNaming(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Table.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.Database.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.AppData.doFinalInitialization(Unknown Source) [torque-sql] at org.apache.torque.engine.database.model.AppData.getDatabase(Unknown Source) [torque-sql] at org.apache.torque.task.TorqueDataModelTask.initControlContext(Unknown Source) [torque-sql] at org.apache.torque.task.TorqueSQLTask.initControlContext(Unknown Source) [torque-sql] at org.apache.velocity.texen.ant.TexenTask.execute(TexenTask.java:485) [torque-sql] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:185) [torque-sql] at org.apache.tools.ant.Task.perform(Task.java:348) [torque-sql] at org.apache.tools.ant.Target.execute(Target.java:309) [torque-sql] at org.apache.tools.ant.Target.performTasks(Target.java:336) [torque-sql] at org.apache.tools.ant.Project.executeTarget(Project.java:1244) [torque-sql] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:373) [torque-sql] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:185) [torque-sql] at org.apache.tools.ant.Task.perform(Task.java:348) [torque-sql] at org.apache.tools.ant.Target.execute(Target.java:309) [torque-sql] at org.apache.tools.ant.Target.performTasks(Target.java:336) [torque-sql] at org.apache.tools.ant.Project.executeTarget(Project.java:1244) [torque-sql] at org.apache.tools.ant.Project.executeTargets(Project.java:1188) [torque-sql] at org.apache.tools.ant.Main.runBuild(Main.java:614) [torque-sql] at org.apache.tools.ant.Main.start(Main.java:197) [torque-sql] at org.apache.tools.ant.Main.main(Main.java:235) [torque-sql] Database-specific properties file does not exist: /home/rubys/jakarta/jakarta-ojb/sql/base/hypersonic/db.props BUILD FAILED file:///home/rubys/jakarta/jakarta-ojb/build-torque.xml:448: Resource not found. For more information consult the velocity log, or invoke ant with the -debug flag. Total time: 17 seconds From kimberly77@example.net Thu Jan 2 14:58:20 2003 Return-Path: <kimberly77@example.net> Mailing-List: contact kimberly77@example.net; run by ezmlm Delivered-To: mailing list kimberly77@example.net Received: (qmail 22962 invoked by uid 97); 2 Jan 2003 14:58:20 -0000 Received: (qmail 22958 invoked by uid 98); 2 Jan 2003 14:58:20 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Received: (qmail 22932 invoked from network); 2 Jan 2003 14:58:18 -0000 Received: from daedalus.apache.org (HELO apache.org) (83.161.120.155) by nagoya.betaversion.org with SMTP; 2 Jan 2003 14:58:18 -0000 Received: (qmail 81451 invoked by uid 500); 2 Jan 2003 14:57:02 -0000 Received: (qmail 81443 invoked from network); 2 Jan 2003 14:57:02 -0000 Received: from icarus.apache.org (83.161.120.155) by daedalus.apache.org with SMTP; 2 Jan 2003 14:57:02 -0000 Received: (qmail 91762 invoked by uid 1524); 2 Jan 2003 14:57:01 -0000 Date: 2 Jan 2003 14:57:01 -0000 Message-ID: <kimberly77@example.net> From: kimberly77@example.net To: kimberly77@example.net Subject: cvs commit: jakarta-ojb/src/java/org/apache/ojb/broker/singlevm PersistenceBrokerImpl.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N thma 2003/01/02 06:57:01 Modified: src/java/org/apache/ojb/broker/singlevm PersistenceBrokerImpl.java Log: bugfix: objects did not get inserted if they had PK fields declared as locking! Revision Changes Path 1.103 +61 -62 jakarta-ojb/src/java/org/apache/ojb/broker/singlevm/PersistenceBrokerImpl.java Index: PersistenceBrokerImpl.java =================================================================== RCS file: /home/cvs/jakarta-ojb/src/java/org/apache/ojb/broker/singlevm/PersistenceBrokerImpl.java,v retrieving revision 1.102 retrieving revision 1.103 diff -u -r1.102 -r1.103 --- PersistenceBrokerImpl.java 2 Jan 2003 09:36:18 -0000 1.102 +++ PersistenceBrokerImpl.java 2 Jan 2003 14:57:01 -0000 1.103 @@ -1935,10 +1935,10 @@ private void storeToDb(Object obj, ClassDescriptor cld, Identity oid, Map markedForStore, boolean insert) { /** - * only do the update/insert if the primary key is autoincrement, or is already a valid - * value. + * only do the update/insert if all PK values are either defined as + * autoincrement or locking, or do hold valid values. */ - if (isPKautoIncrement(cld.getPkFields()) || isPKvalid(oid.getPrimaryKeyValues())) + if (assertValidPkFields(cld.getPkFields(), oid.getPrimaryKeyValues())) { // 1. assign foreign key values so that they can be stored in step 2 // todo: this should be done through sequenceManager so that it can be handled (ignored?) @@ -2007,6 +2007,63 @@ } /** + * returns true if the primary key fields are valid, else false. + * PK fields are valid if each of them is either an OJB managed + * attribute (autoincrement or locking) or if it contains + * a valid non-null value + * @param fieldDescriptors the array of PK fielddescriptors + * @param pkValues the array of PK values + * @return boolean + */ + private boolean assertValidPkFields(FieldDescriptor[] fieldDescriptors, Object[] pkValues) + { + int fieldDescriptorSize = fieldDescriptors.length; + for (int i = 0; i < fieldDescriptorSize; i++) + { + /** + * a pk field is valid if it is either managed by OJB + * (autoincrement or locking) or if it does contain a + * valid non-null value. + */ + if (! (fieldDescriptors[i].isAutoIncrement() + || fieldDescriptors[i].isLocking() + || assertValidPkValue(pkValues[i]) )) + { + return false; + } + } + return true; + } + + /** + * returns true if a value is non-null, STring instances are also checked, + * if they are non-empty. + * @param pkValue the value to check + * @return boolean + */ + private boolean assertValidPkValue(Object pkValue) + { + // null as value of a primary key is not acceptable + if (pkValue == null) + { + return false; + } + if (pkValue instanceof String) + { + // the toString() method on a String-object is maybe faster + // than the downcast to String. Also use length() to test + // if a String empty or not, this is faster than the comparing + // a String-object with an empty string using the equals()-method. + if (pkValue.toString().trim().length() == 0) + { + return false; + } + } + return true; + } + + + /** * this method will go up the inheritance heirarchy to store all the super classes * * <p> @@ -2464,64 +2521,6 @@ public boolean isRunningInServerMode() { return runningInServerMode; - } - - /** - * return true if all of the FieldDescriptors is autoIncrement. - * also return true if NO FieldDescriptors available - * @param fdesc the primary key FieldDescriptor[] - */ - private boolean isPKautoIncrement(FieldDescriptor[] fdesc) - { - int fieldDescriptorSize = fdesc.length; - for (int i = 0; i < fieldDescriptorSize; i++) - { - /** - * if one of the keys in the primary key FieldDescriptor array - * is not autoincrement we return that this isn't an autoincrement PK. - * We check all fields, in the case of a composite key. - */ - if (!fdesc[i].isAutoIncrement()) - { - return false; - } - } - return true; - } - - /** - * only checks string type keys for validity, since the default of other types of keys is - * unknown (ie int) - * @param pkValues - * @return true if valid - */ - private boolean isPKvalid(Object[] pkValues) - { - int size = pkValues.length; - - for (int i = 0; i < size; i++) - { - Object pkValue = pkValues[i]; - // null as value of a primary key is not acceptable - if (pkValue == null) - { - return false; - } - - if (pkValue instanceof String) - { - // the toString() method on a String-object is maybe faster - // than the downcast to String. Also use length() to test - // if a String empty or not, this is faster than the comparing - // a String-object with an empty string using the equals()-method. - if (pkValue.toString().trim().length() == 0) - { - return false; - } - } - } - - return true; } /* From kimberly77@example.net Thu Jan 2 14:59:01 2003 Return-Path: <kimberly77@example.net> Mailing-List: contact kimberly77@example.net; run by ezmlm Delivered-To: mailing list kimberly77@example.net Received: (qmail 23688 invoked by uid 97); 2 Jan 2003 14:59:01 -0000 Received: (qmail 23684 invoked by uid 98); 2 Jan 2003 14:59:01 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Received: (qmail 23663 invoked from network); 2 Jan 2003 14:58:59 -0000 Received: from daedalus.apache.org (HELO apache.org) (83.161.120.155) by nagoya.betaversion.org with SMTP; 2 Jan 2003 14:58:59 -0000 Received: (qmail 81746 invoked by uid 500); 2 Jan 2003 14:57:43 -0000 Received: (qmail 81739 invoked from network); 2 Jan 2003 14:57:43 -0000 Received: from icarus.apache.org (83.161.120.155) by daedalus.apache.org with SMTP; 2 Jan 2003 14:57:43 -0000 Received: (qmail 91986 invoked by uid 1524); 2 Jan 2003 14:57:43 -0000 Date: 2 Jan 2003 14:57:43 -0000 Message-ID: <kimberly77@example.net> From: kimberly77@example.net To: kimberly77@example.net Subject: cvs commit: jakarta-ojb/src/test/org/apache/ojb/quick-db OJB.properties OJB.script X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N thma 2003/01/02 06:57:43 Modified: src/test/org/apache/ojb/quick-db OJB.properties OJB.script Log: include latest changes to testdata Revision Changes Path 1.9 +1 -1 jakarta-ojb/src/test/org/apache/ojb/quick-db/OJB.properties Index: OJB.properties =================================================================== RCS file: /home/cvs/jakarta-ojb/src/test/org/apache/ojb/quick-db/OJB.properties,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- OJB.properties 12 Dec 2002 20:12:46 -0000 1.8 +++ OJB.properties 2 Jan 2003 14:57:42 -0000 1.9 @@ -1,5 +1,5 @@ #HSQL database -#Tue Dec 10 21:42:51 CET 2002 +#Thu Jan 02 15:18:12 CET 2003 sql.strict_fk=true readonly=false sql.strong_fk=true 1.10 +2 -2 jakarta-ojb/src/test/org/apache/ojb/quick-db/OJB.script Index: OJB.script =================================================================== RCS file: /home/cvs/jakarta-ojb/src/test/org/apache/ojb/quick-db/OJB.script,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- OJB.script 12 Dec 2002 20:12:46 -0000 1.9 +++ OJB.script 2 Jan 2003 14:57:42 -0000 1.10 @@ -1,11 +1,11 @@ -CREATE TABLE KATEGORIEN(KATEGORIE_NR INTEGER NOT NULL PRIMARY KEY,KATEGORIENAME VARCHAR(20),BESCHREIBUNG VARCHAR(60)) +CREATE TABLE KATEGORIEN(KATEGORIE_NR INTEGER NOT NULL PRIMARY KEY,KATEGORIENAME VARCHAR(60),BESCHREIBUNG VARCHAR(60)) CREATE TABLE ARTIKEL(ARTIKEL_NR INTEGER NOT NULL PRIMARY KEY,ARTIKELNAME VARCHAR(60),LIEFERANTEN_NR INTEGER,KATEGORIE_NR INTEGER,LIEFEREINHEIT VARCHAR(30),EINZELPREIS FLOAT,LAGERBESTAND INTEGER,BESTELLTEEINHEITEN INTEGER,MINDESTBESTAND INTEGER,AUSLAUFARTIKEL INTEGER,CONSTRAINT ARTIKEL_FK_1 FOREIGN KEY(KATEGORIE_NR) REFERENCES KATEGORIEN(KATEGORIE_NR)) CREATE TABLE BOOKS(ARTIKEL_NR INTEGER NOT NULL PRIMARY KEY,ARTIKELNAME VARCHAR(60),LIEFERANTEN_NR INTEGER,KATEGORIE_NR INTEGER,LIEFEREINHEIT VARCHAR(30),EINZELPREIS FLOAT,LAGERBESTAND INTEGER,BESTELLTEEINHEITEN INTEGER,MINDESTBESTAND INTEGER,AUSLAUFARTIKEL INTEGER,ISBN VARCHAR(10),AUTHOR VARCHAR(50),CONSTRAINT BOOKS_FK_1 FOREIGN KEY(KATEGORIE_NR) REFERENCES KATEGORIEN(KATEGORIE_NR)) CREATE TABLE CDS(ARTIKEL_NR INTEGER NOT NULL PRIMARY KEY,ARTIKELNAME VARCHAR(60),LIEFERANTEN_NR INTEGER,KATEGORIE_NR INTEGER,LIEFEREINHEIT VARCHAR(30),EINZELPREIS FLOAT,LAGERBESTAND INTEGER,BESTELLTEEINHEITEN INTEGER,MINDESTBESTAND INTEGER,AUSLAUFARTIKEL INTEGER,LABEL VARCHAR(50),MUSICIANS VARCHAR(250),CONSTRAINT CDS_FK_1 FOREIGN KEY(KATEGORIE_NR) REFERENCES KATEGORIEN(KATEGORIE_NR)) CREATE TABLE ORDER_POSITION(ID INTEGER NOT NULL PRIMARY KEY,ORDER_ID INTEGER,ARTICLE_ID INTEGER) CREATE TABLE TREE(ID INTEGER NOT NULL PRIMARY KEY,DATA VARCHAR(50),PARENT_ID INTEGER) CREATE TABLE TREEGROUP(ID INTEGER NOT NULL PRIMARY KEY,DATA VARCHAR(50),PARENT_ID INTEGER,GROUP_ID INTEGER) -CREATE TABLE AB_TABLE(ID INTEGER NOT NULL PRIMARY KEY,CLASS_NAME VARCHAR(60),VALUE_ INTEGER) +CREATE TABLE AB_TABLE(ID INTEGER NOT NULL PRIMARY KEY,CLASS_NAME VARCHAR(60),VALUE_ INTEGER,A_FIELD VARCHAR(60),B_FIELD VARCHAR(60)) CREATE TABLE PRODUCT(ID INTEGER NOT NULL PRIMARY KEY,NAME VARCHAR(100),PRICE FLOAT,STOCK INTEGER) CREATE TABLE PERSON(ID INTEGER NOT NULL PRIMARY KEY,FIRSTNAME VARCHAR(50),LASTNAME VARCHAR(50)) CREATE TABLE PROJECT(ID INTEGER NOT NULL PRIMARY KEY,TITLE VARCHAR(50),DESCRIPTION VARCHAR(250)) From kimberly77@example.net Thu Jan 2 15:51:44 2003 Return-Path: <kimberly77@example.net> Mailing-List: contact kimberly77@example.net; run by ezmlm Delivered-To: mailing list kimberly77@example.net Received: (qmail 27385 invoked by uid 98); 2 Jan 2003 15:51:44 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Received: (qmail 27353 invoked from network); 2 Jan 2003 15:51:42 -0000 Received: from daedalus.apache.org (HELO apache.org) (83.161.120.155) by nagoya.betaversion.org with SMTP; 2 Jan 2003 15:51:42 -0000 Received: (qmail 15132 invoked by uid 500); 2 Jan 2003 15:50:25 -0000 Received: (qmail 15125 invoked from network); 2 Jan 2003 15:50:25 -0000 Received: from web11601.mail.yahoo.com (83.161.120.155) by daedalus.apache.org with SMTP; 2 Jan 2003 15:50:25 -0000 Message-ID: <kimberly77@example.net> Received: from [83.161.120.155] by web11601.mail.yahoo.com via HTTP; Thu, 02 Jan 2003 07:50:27 PST Date: Thu, 2 Jan 2003 07:50:27 -0800 (PST) From: Davide Mora <kimberly77@example.net> Subject: AutoBuildDb proposals To: kimberly77@example.net MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi developers, happy new year! i talked with Armin Waibel about the AutoBuildDb tool, and he suggested to post here my proposals. I have some "spare time" and i would like to help make a better tool if possible. For what i know, we use two different libraries for access the db, CrossDB and Torque. The first (and biggest) problem with CrossDB is it support more or less half of the platforms listed in the repository.dtd. To fix this problem i think we have two options: replace CrossDB with Torque *or* add support for the other databases (DB2,Postgres,etc). I'm not so expert of Torque, but my opinion is use it it's the best thing. The other proposal is about add more options to the AutoBuildDb tool, like generate sql script and/or create the database, create an ANT task for it, and a "refresh schema" option for handle the class changes. Regards, Davide __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com From kimberly77@example.net Thu Jan 2 15:54:08 2003 Return-Path: <kimberly77@example.net> Mailing-List: contact kimberly77@example.net; run by ezmlm Delivered-To: mailing list kimberly77@example.net Received: (qmail 28724 invoked by uid 97); 2 Jan 2003 15:54:08 -0000 Received: (qmail 28720 invoked by uid 98); 2 Jan 2003 15:54:07 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Received: (qmail 28701 invoked from network); 2 Jan 2003 15:54:05 -0000 Received: from daedalus.apache.org (HELO apache.org) (83.161.120.155) by nagoya.betaversion.org with SMTP; 2 Jan 2003 15:54:05 -0000 Received: (qmail 17793 invoked by uid 500); 2 Jan 2003 15:52:49 -0000 Received: (qmail 17786 invoked from network); 2 Jan 2003 15:52:48 -0000 Received: from icarus.apache.org (83.161.120.155) by daedalus.apache.org with SMTP; 2 Jan 2003 15:52:48 -0000 Received: (qmail 5714 invoked by uid 1510); 2 Jan 2003 15:52:48 -0000 Date: 2 Jan 2003 15:52:48 -0000 Message-ID: <kimberly77@example.net> From: kimberly77@example.net To: kimberly77@example.net Subject: cvs commit: jakarta-ojb/src/java/org/apache/ojb/broker/metadata/auto AutoCreatorDb.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N arminw 2003/01/02 07:52:48 Modified: src/java/org/apache/ojb/broker/metadata/auto AutoCreatorDb.java Log: a fix from Davide Mora, make it work with SQL Server Revision Changes Path 1.10 +33 -34 jakarta-ojb/src/java/org/apache/ojb/broker/metadata/auto/AutoCreatorDb.java Index: AutoCreatorDb.java =================================================================== RCS file: /home/cvs/jakarta-ojb/src/java/org/apache/ojb/broker/metadata/auto/AutoCreatorDb.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- AutoCreatorDb.java 24 Dec 2002 13:07:03 -0000 1.9 +++ AutoCreatorDb.java 2 Jan 2003 15:52:48 -0000 1.10 @@ -28,47 +28,46 @@ import java.util.ArrayList; import java.util.Enumeration; import java.util.List; +import java.util.Hashtable; public class AutoCreatorDb { private static Logger logger = LoggerFactory.getLogger(AutoCreatorDb.class); + private static Hashtable platform2driver = null; + private static String defaultPlatform = "hsqldb"; + + static { + platform2driver = new Hashtable(); + + // supported by crossdb + platform2driver.put("hsqldb", "com.spaceprogram.sql.hsqldb.HsqldbFactory" ); + platform2driver.put("mssqlserver", "com.thinkvirtual.sql.sqlserver.SQLServerFactory"); + platform2driver.put("mysql", "com.spaceprogram.sql.mysql.MySQLFactory"); + platform2driver.put("oracle", "com.thinkvirtual.sql.oracle.OracleSQLFactory"); + platform2driver.put("sybase", "com.thinkvirtual.sql.sybase.SybaseFactory"); + + // not (yet?) supported + /* + platform2driver.put("db2", null); + platform2driver.put("informix", null); + platform2driver.put("msaccess", null); + platform2driver.put("postgresql", null); + platform2driver.put("sapdb", null); + */ + } /** - * com.spaceprogram.sql.hsqldb.HsqldbFactory - com.spaceprogram.sql.mysql.MySQLFactory - com.thinkvirtual.sql.oracle.OracleSQLFactory - com.thinkvirtual.sql.sqlserver.SQLServerFactory - com.thinkvirtual.sql.sybase.SybaseFactory + * */ public static String getCrossdbDriverFromPlatform(String platform) { - String ret = null; - if (platform.equalsIgnoreCase("hsqldb")) - { - ret = "com.spaceprogram.sql.hsqldb.HsqldbFactory"; - - } - - else if (platform.equalsIgnoreCase("mssql")) - { - ret = "com.thinkvirtual.sql.sqlserver.SQLServerFactory"; + String lcPlatform = platform.toLowerCase(); + String driverCls = (String) platform2driver.get(lcPlatform); + if ( driverCls == null ) { + logger.error("Platform '" + platform + "' not supported by crossdb. The default platform '" + defaultPlatform + "' will be used."); + driverCls = (String) platform2driver.get(defaultPlatform); } - else if (platform.equalsIgnoreCase("oracle")) - { - ret = "com.thinkvirtual.sql.oracle.OracleSQLFactory"; - } - else if (platform.equalsIgnoreCase("sybase")) - { - ret = "com.thinkvirtual.sql.sybase.SybaseFactory"; - } - else - { // default to mysql for now - // if (platform.equalsIgnoreCase("mysql")) { - ret = "com.spaceprogram.sql.mysql.MySQLFactory"; - - } - return ret; - + return driverCls; } public static void autoCreate( @@ -151,7 +150,7 @@ else { // table does not exist, so make it - logger.info("Creating table [" + tname + "]"); + logger.info("Creating table [" + tname + "] using " + factory.getClass().getName() ); CreateTableQuery ctq = factory.getCreateTableQuery(); ctq.setName(tname); FieldDescriptor fld[] = cld.getFieldDescriptions(); @@ -166,7 +165,7 @@ if (fieldDescriptor.isAutoIncrement()) { col.setAutoIncrement(true); - + col.setNullable(0); } ctq.addColumn(col); } From kimberly77@example.net Thu Jan 2 19:21:10 2003 Return-Path: <kimberly77@example.net> Mailing-List: contact kimberly77@example.net; run by ezmlm Delivered-To: mailing list kimberly77@example.net Received: (qmail 23855 invoked by uid 98); 2 Jan 2003 19:21:10 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Received: (qmail 23836 invoked from network); 2 Jan 2003 19:21:08 -0000 Received: from daedalus.apache.org (HELO apache.org) (83.161.120.155) by nagoya.betaversion.org with SMTP; 2 Jan 2003 19:21:08 -0000 Received: (qmail 59604 invoked by uid 500); 2 Jan 2003 19:19:47 -0000 Received: (qmail 59595 invoked from network); 2 Jan 2003 19:19:47 -0000 Received: from mailout04.sul.t-online.com (83.161.120.155) by daedalus.apache.org with SMTP; 2 Jan 2003 19:19:47 -0000 Received: from fwd05.sul.t-online.de by mailout04.sul.t-online.com with smtp id 18UAsg-0001WJ-02; Thu, 02 Jan 2003 20:19:50 +0100 Received: from win (510007636964-0001@[83.161.120.155]) by fmrl05.sul.t-online.com with smtp id 18UAsX-0jdqIyC; Thu, 2 Jan 2003 20:19:41 +0100 Message-ID: <007d01c2b293$e4c975e0$6479fea9@win> Reply-To: "Armin Waibel" <kimberly77@example.net> From: "Armin Waibel" <kimberly77@example.net> To: "OJB Developers List" <kimberly77@example.net> References: <kimberly77@example.net> Subject: Re: AutoBuildDb proposals Date: Thu, 2 Jan 2003 20:19:38 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-Sender: kimberly77@example.net X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi again, ----- Original Message ----- From: "Davide Mora" <kimberly77@example.net> To: <kimberly77@example.net> Sent: Thursday, January 02, 2003 4:50 PM Subject: AutoBuildDb proposals > > Hi developers, happy new year! > > i talked with Armin Waibel about the AutoBuildDb tool, > and he suggested to post here my proposals. > I have some "spare time" and i would like to help make > a better tool if possible. > > For what i know, we use two different libraries for > access the db, CrossDB and Torque. > The first (and biggest) problem with CrossDB is it > support more or less half of the platforms listed in > the repository.dtd. > To fix this problem i think we have two options: > replace CrossDB with Torque *or* add support for the > other databases (DB2,Postgres,etc). > I'm not so expert of Torque, but my opinion is use it > it's the best thing. +1 if you think torque is the better way, do it. > > The other proposal is about add more options to the > AutoBuildDb tool, like generate sql script and/or > create the database, create an ANT task for it, and a > "refresh schema" option for handle the class changes. +1 regards, Armin > > Regards, > Davide > > > __________________________________________________ > Do you Yahoo!? > Yahoo! Mail Plus - Powerful. Affordable. Sign up now. > http://mailplus.yahoo.com > > -- > To unsubscribe, e-mail: <mailto:kimberly77@example.net> > For additional commands, e-mail: <mailto:kimberly77@example.net> > > > From kimberly77@example.net Thu Jan 2 19:47:28 2003 Return-Path: <kimberly77@example.net> Mailing-List: contact kimberly77@example.net; run by ezmlm Delivered-To: mailing list kimberly77@example.net Received: (qmail 18769 invoked by uid 98); 2 Jan 2003 19:47:28 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Received: (qmail 18747 invoked from network); 2 Jan 2003 19:47:26 -0000 Received: from daedalus.apache.org (HELO apache.org) (83.161.120.155) by nagoya.betaversion.org with SMTP; 2 Jan 2003 19:47:26 -0000 Received: (qmail 84766 invoked by uid 500); 2 Jan 2003 19:46:05 -0000 Received: (qmail 84747 invoked from network); 2 Jan 2003 19:46:04 -0000 Received: from unknown (HELO YVIMAIN2.YOURVITAMINS.COM) (83.161.120.155) by daedalus.apache.org with SMTP; 2 Jan 2003 19:46:04 -0000 Content-Class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: AutoBuildDb proposals X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 Date: Thu, 2 Jan 2003 11:45:58 -0800 Message-ID: <kimberly77@example.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: AutoBuildDb proposals Thread-Index: AcKyk++JQok/lh4gQcidQ/Rzbi0wdQAAhxCw From: "Jason Rosen" <kimberly77@example.net> To: "OJB Developers List" <kimberly77@example.net> X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi,=20 I just recently joined the OJB dev list after experimenting a bit with = OJB for my own project. What is the goal of the AutoBuildDB tool? I have created some XSL templates that can build an OJB repository.xml = file from Torque database schema XML files and then another one to = create OJB persistence classes from the repository.xml file. I also = have ANT tasks defined to build my DB using Torque, generate the = repository.xml file, generate the persistence classes, compile the = classes, and jar them up ready to use. Right now my XSL transforms are quite rough, but they are successful in = parsing foreign-key relations defined in the Torque XML schema to create = 1:1, 1:n, and m:n non-decomposed object relationships within the = repository.xml and the generated persistence classes. I have started a = new project using these tools as a foundation for managing my DB and = persistence classes, and it seems to be working for most cases I have = run into using postgreSQL. So I am wondering how this fits into the goals of the AutoBuildDB tool = to see if I can contribute.=20 Thanks, Jason -----Original Message----- From: Armin Waibel [mailto:kimberly77@example.net] Sent: Thursday, January 02, 2003 11:20 AM To: OJB Developers List Subject: Re: AutoBuildDb proposals Hi again, ----- Original Message ----- From: "Davide Mora" <kimberly77@example.net> To: <kimberly77@example.net> Sent: Thursday, January 02, 2003 4:50 PM Subject: AutoBuildDb proposals > > Hi developers, happy new year! > > i talked with Armin Waibel about the AutoBuildDb tool, > and he suggested to post here my proposals. > I have some "spare time" and i would like to help make > a better tool if possible. > > For what i know, we use two different libraries for > access the db, CrossDB and Torque. > The first (and biggest) problem with CrossDB is it > support more or less half of the platforms listed in > the repository.dtd. > To fix this problem i think we have two options: > replace CrossDB with Torque *or* add support for the > other databases (DB2,Postgres,etc). > I'm not so expert of Torque, but my opinion is use it > it's the best thing. +1 if you think torque is the better way, do it. > > The other proposal is about add more options to the > AutoBuildDb tool, like generate sql script and/or > create the database, create an ANT task for it, and a > "refresh schema" option for handle the class changes. +1 regards, Armin > > Regards, > Davide > > > __________________________________________________ > Do you Yahoo!? > Yahoo! Mail Plus - Powerful. Affordable. Sign up now. > http://mailplus.yahoo.com > > -- > To unsubscribe, e-mail: <mailto:kimberly77@example.net> > For additional commands, e-mail: <mailto:kimberly77@example.net> > > > -- To unsubscribe, e-mail: = <mailto:kimberly77@example.net> For additional commands, e-mail: = <mailto:kimberly77@example.net> From kimberly77@example.net Thu Jan 2 21:28:47 2003 Return-Path: <kimberly77@example.net> Mailing-List: contact kimberly77@example.net; run by ezmlm Delivered-To: mailing list kimberly77@example.net Received: (qmail 3448 invoked by uid 97); 2 Jan 2003 21:28:47 -0000 Received: (qmail 3443 invoked by uid 98); 2 Jan 2003 21:28:46 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Received: (qmail 3417 invoked from network); 2 Jan 2003 21:28:43 -0000 Received: from daedalus.apache.org (HELO apache.org) (83.161.120.155) by nagoya.betaversion.org with SMTP; 2 Jan 2003 21:28:43 -0000 Received: (qmail 59423 invoked by uid 500); 2 Jan 2003 21:27:21 -0000 Received: (qmail 59409 invoked from network); 2 Jan 2003 21:27:21 -0000 Received: from icarus.apache.org (83.161.120.155) by daedalus.apache.org with SMTP; 2 Jan 2003 21:27:21 -0000 Received: (qmail 97160 invoked by uid 1520); 2 Jan 2003 21:27:20 -0000 Date: 2 Jan 2003 21:27:20 -0000 Message-ID: <kimberly77@example.net> From: kimberly77@example.net To: kimberly77@example.net Subject: cvs commit: jakarta-ojb/src/test/org/apache/ojb repository.dtd repository_farAwayUser.xml repository_internal.xml repository_junit.xml repository_user.xml X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N olegnitz 2003/01/02 13:27:20 Modified: src/java/org/apache/ojb/broker/accesslayer/sql SqlDeleteByQuery.java SqlQueryStatement.java src/java/org/apache/ojb/broker/ant RepositoryVerifierHandler.java src/java/org/apache/ojb/broker/metadata CollectionDescriptor.java ObjectReferenceDescriptor.java RepositoryElements.java RepositoryTags.java RepositoryXmlHandler.java src/java/org/apache/ojb/broker/metadata/torque TorqueForeignKeyGenerator.java src/test/org/apache/ojb repository.dtd repository_farAwayUser.xml repository_internal.xml repository_junit.xml repository_user.xml Log: Field ID is not any longer a required attribute in repository.xml Now 'field-ref' may be used to reference foreign key field by name instead of referencing in by ID via 'field-id-ref' attribute Revision Changes Path 1.6 +4 -3 jakarta-ojb/src/java/org/apache/ojb/broker/accesslayer/sql/SqlDeleteByQuery.java Index: SqlDeleteByQuery.java =================================================================== RCS file: /home/cvs/jakarta-ojb/src/java/org/apache/ojb/broker/accesslayer/sql/SqlDeleteByQuery.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- SqlDeleteByQuery.java 24 Dec 2002 12:57:51 -0000 1.5 +++ SqlDeleteByQuery.java 2 Jan 2003 21:27:18 -0000 1.6 @@ -144,9 +144,10 @@ ObjectReferenceDescriptor ord = getRoot().cld.getObjectReferenceDescriptorByName(colName); if (ord != null) { - if (ord.getForeignKeyFields().size() > 0) + FieldDescriptor[] fk = ord.getForeignKeyFieldDescriptors(getRoot().cld); + if (fk.length > 0) { - fld = getRoot().cld.getFieldDescriptorByIndex(((Integer) ord.getForeignKeyFields().get(0)).intValue()); + fld = fk[0]; } } } 1.17 +4 -5 jakarta-ojb/src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java Index: SqlQueryStatement.java =================================================================== RCS file: /home/cvs/jakarta-ojb/src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- SqlQueryStatement.java 2 Jan 2003 09:37:58 -0000 1.16 +++ SqlQueryStatement.java 2 Jan 2003 21:27:18 -0000 1.17 @@ -191,11 +191,10 @@ ObjectReferenceDescriptor ord = getRoot().cld.getObjectReferenceDescriptorByName(colName); if (ord != null) { - if (ord.getForeignKeyFields().size() > 0) + FieldDescriptor[] fk = ord.getForeignKeyFieldDescriptors(getRoot().cld); + if (fk.length > 0) { - fld = - getRoot().cld.getFieldDescriptorByIndex( - ((Integer) ord.getForeignKeyFields().get(0)).intValue()); + fld = fk[0]; } } } 1.11 +9 -3 jakarta-ojb/src/java/org/apache/ojb/broker/ant/RepositoryVerifierHandler.java Index: RepositoryVerifierHandler.java =================================================================== RCS file: /home/cvs/jakarta-ojb/src/java/org/apache/ojb/broker/ant/RepositoryVerifierHandler.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- RepositoryVerifierHandler.java 24 Dec 2002 13:38:04 -0000 1.10 +++ RepositoryVerifierHandler.java 2 Jan 2003 21:27:19 -0000 1.11 @@ -112,6 +112,11 @@ private Collection m_VerifyExceptions = new ArrayList(69); private Collection m_VerifyWarnings = new ArrayList(69); + + /** + * Allows not to specify field id. + */ + private int m_lastId = 0; /** @@ -290,8 +295,9 @@ case FIELD_DESCRIPTOR : { - int id = Integer.parseInt(atts.getValue("id")); - m_CurrentFLD = new FieldDescriptor(null, id); + String strId = atts.getValue("id"); + m_lastId = (strId == null ? m_lastId + 1 : Integer.parseInt(strId)); + m_CurrentFLD = new FieldDescriptor(null, m_lastId); String fieldName = atts.getValue(tags.getTagById(FIELD_NAME)); 1.15 +14 -4 jakarta-ojb/src/java/org/apache/ojb/broker/metadata/CollectionDescriptor.java Index: CollectionDescriptor.java =================================================================== RCS file: /home/cvs/jakarta-ojb/src/java/org/apache/ojb/broker/metadata/CollectionDescriptor.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- CollectionDescriptor.java 24 Dec 2002 13:14:33 -0000 1.14 +++ CollectionDescriptor.java 2 Jan 2003 21:27:19 -0000 1.15 @@ -319,9 +319,19 @@ // inverse fk elements for (int i=0;i<getForeignKeyFields().size();i++) { - String fkId = getForeignKeyFields().get(i).toString(); - result += " " + tags.getOpeningTagNonClosingById(INVERSE_FK) + " "; - result += tags.getAttribute(FIELD_ID_REF, fkId) + "/>" + eol; + Object obj = getForeignKeyFields().get(i); + if (obj instanceof Integer) + { + String fkId = obj.toString(); + result += " " + tags.getOpeningTagNonClosingById(INVERSE_FK) + " "; + result += tags.getAttribute(FIELD_ID_REF, fkId) + "/>" + eol; + } + else + { + String fk = (String) obj; + result += " " + tags.getOpeningTagNonClosingById(INVERSE_FK) + " "; + result += tags.getAttribute(FIELD_REF, fk) + "/>" + eol; + } } // write optional M:N elements 1.20 +42 -5 jakarta-ojb/src/java/org/apache/ojb/broker/metadata/ObjectReferenceDescriptor.java Index: ObjectReferenceDescriptor.java =================================================================== RCS file: /home/cvs/jakarta-ojb/src/java/org/apache/ojb/broker/metadata/ObjectReferenceDescriptor.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- ObjectReferenceDescriptor.java 24 Dec 2002 13:14:33 -0000 1.19 +++ ObjectReferenceDescriptor.java 2 Jan 2003 21:27:19 -0000 1.20 @@ -58,6 +58,7 @@ import org.apache.ojb.broker.PersistenceBroker; import org.apache.ojb.broker.PersistenceBrokerException; import org.apache.ojb.broker.PersistenceBrokerFactory; +import org.apache.ojb.broker.OJBRuntimeException; import org.apache.ojb.broker.accesslayer.conversions.FieldConversion; import org.apache.ojb.broker.metadata.fieldaccess.PersistentField; import org.apache.commons.lang.builder.ToStringBuilder; @@ -145,8 +146,22 @@ Iterator iter = v.iterator(); while (iter.hasNext()) { - Integer index = (Integer) iter.next(); - ret.add(mif.getFieldDescriptorByIndex(index.intValue())); + Object fk = iter.next(); + FieldDescriptor fkfd; + if (fk instanceof Integer) + { + Integer index = (Integer) fk; + fkfd = mif.getFieldDescriptorByIndex(index.intValue()); + } + else + { + fkfd = mif.getFieldDescriptorByName((String) fk); + } + if (fkfd == null) + { + throw new OJBRuntimeException("Incorrect field reference \"" + fk + "\" in " + this); + } + ret.add(fkfd); } foreignKeyFieldDescriptors = (FieldDescriptor[]) ret.toArray(new FieldDescriptor[ret.size()]); @@ -229,6 +244,18 @@ } /** + * add a foreign key field + */ + public void addForeignKeyField(String newField) + { + if (m_ForeignKeyFields == null) + { + m_ForeignKeyFields = new Vector(); + } + m_ForeignKeyFields.add(newField); + } + + /** * Gets the refresh. * @return Returns a boolean */ @@ -378,9 +405,19 @@ // write foreignkey elements for (int i = 0; i < getForeignKeyFields().size(); i++) { - String fkId = getForeignKeyFields().get(i).toString(); - result += " " + tags.getOpeningTagNonClosingById(FOREIGN_KEY) + " "; - result += tags.getAttribute(FIELD_ID_REF, fkId) + "/>" + eol; + Object obj = getForeignKeyFields().get(i); + if (obj instanceof Integer) + { + String fkId = obj.toString(); + result += " " + tags.getOpeningTagNonClosingById(FOREIGN_KEY) + " "; + result += tags.getAttribute(FIELD_ID_REF, fkId) + "/>" + eol; + } + else + { + String fk = (String) obj; + result += " " + tags.getOpeningTagNonClosingById(FOREIGN_KEY) + " "; + result += tags.getAttribute(FIELD_REF, fk) + "/>" + eol; + } } // closing tag 1.18 +2 -1 jakarta-ojb/src/java/org/apache/ojb/broker/metadata/RepositoryElements.java Index: RepositoryElements.java =================================================================== RCS file: /home/cvs/jakarta-ojb/src/java/org/apache/ojb/broker/metadata/RepositoryElements.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- RepositoryElements.java 24 Dec 2002 13:14:33 -0000 1.17 +++ RepositoryElements.java 2 Jan 2003 21:27:19 -0000 1.18 @@ -136,6 +136,7 @@ public static final int CLASS_REF = 68; public static final int ID = 69; public static final int FIELD_ID_REF = 70; + public static final int FIELD_REF = 84; public static final int ATTRIBUTE = 71; public static final int ATTRIBUTE_NAME = 72; public static final int ATTRIBUTE_VALUE = 73; @@ -143,5 +144,5 @@ public static final int ACCEPT_LOCKS = 78; // maintain a last id to keep track where we are - public static final int _LAST = 84; + public static final int _LAST = 85; } 1.20 +1 -0 jakarta-ojb/src/java/org/apache/ojb/broker/metadata/RepositoryTags.java Index: RepositoryTags.java =================================================================== RCS file: /home/cvs/jakarta-ojb/src/java/org/apache/ojb/broker/metadata/RepositoryTags.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- RepositoryTags.java 24 Dec 2002 13:14:33 -0000 1.19 +++ RepositoryTags.java 2 Jan 2003 21:27:19 -0000 1.20 @@ -170,6 +170,7 @@ table.put("class-ref", new Integer(CLASS_REF)); table.put("id", new Integer(ID)); table.put("field-id-ref", new Integer(FIELD_ID_REF)); + table.put("field-ref", new Integer(FIELD_REF)); table.put("attribute", new Integer(ATTRIBUTE)); table.put("attribute-name", new Integer(ATTRIBUTE_NAME)); table.put("attribute-value", new Integer(ATTRIBUTE_VALUE)); 1.26 +52 -25 jakarta-ojb/src/java/org/apache/ojb/broker/metadata/RepositoryXmlHandler.java Index: RepositoryXmlHandler.java =================================================================== RCS file: /home/cvs/jakarta-ojb/src/java/org/apache/ojb/broker/metadata/RepositoryXmlHandler.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- RepositoryXmlHandler.java 24 Dec 2002 13:14:33 -0000 1.25 +++ RepositoryXmlHandler.java 2 Jan 2003 21:27:19 -0000 1.26 @@ -90,6 +90,12 @@ /** the default isolation level*/ private int defIsoLevel = IL_DEFAULT; + + /** + * Allows not to specify field id + */ + private int m_lastId; + /** * All known xml tags are kept in this table. * The tags table allows lookup from literal to id @@ -319,8 +325,9 @@ { if (isDebug) logger.debug(" > " + tags.getTagById(FIELD_DESCRIPTOR)); - int id = Integer.parseInt(atts.getValue("id")); - m_CurrentFLD = new FieldDescriptor(m_CurrentCLD, id); + String strId = atts.getValue("id"); + m_lastId = (strId == null ? m_lastId + 1 : Integer.parseInt(strId)); + m_CurrentFLD = new FieldDescriptor(m_CurrentCLD, m_lastId); m_CurrentCLD.addFieldDescriptor(m_CurrentFLD); // prepare for custom attributes @@ -467,19 +474,29 @@ { if (isDebug) logger.debug(" > " + tags.getTagById(FOREIGN_KEY)); String fieldIdRef = atts.getValue(tags.getTagById(FIELD_ID_REF)); - if (isDebug) logger.debug(" " + tags.getTagById(FIELD_ID_REF) + ": " + fieldIdRef); - try + if (fieldIdRef != null) { - int fieldId; - fieldId = Integer.parseInt(fieldIdRef); - m_CurrentORD.addForeignKeyField(fieldId); - } - catch (NumberFormatException rex) - { - throw new MetadataException(tags.getTagById(FIELD_ID_REF) - + " attribute must be an int. Found: " - + fieldIdRef + ". Please check your repository file.", rex); + if (isDebug) logger.debug(" " + tags.getTagById(FIELD_ID_REF) + ": " + fieldIdRef); + + try + { + int fieldId; + fieldId = Integer.parseInt(fieldIdRef); + m_CurrentORD.addForeignKeyField(fieldId); + } + catch (NumberFormatException rex) + { + throw new MetadataException(tags.getTagById(FIELD_ID_REF) + + " attribute must be an int. Found: " + + fieldIdRef + ". Please check your repository file.", rex); + } + } + else + { + String fieldRef = atts.getValue(tags.getTagById(FIELD_REF)); + if (isDebug) logger.debug(" " + tags.getTagById(FIELD_REF) + ": " + fieldRef); + m_CurrentORD.addForeignKeyField(fieldRef); } break; } @@ -576,19 +593,29 @@ { if (isDebug) logger.debug(" > " + tags.getTagById(INVERSE_FK)); String fieldIdRef = atts.getValue(tags.getTagById(FIELD_ID_REF)); - if (isDebug) logger.debug(" " + tags.getTagById(FIELD_ID_REF) + ": " + fieldIdRef); - try + if (fieldIdRef != null) + { + if (isDebug) logger.debug(" " + tags.getTagById(FIELD_ID_REF) + ": " + fieldIdRef); + + try + { + int fieldId; + fieldId = Integer.parseInt(fieldIdRef); + m_CurrentCOD.addForeignKeyField(fieldId); + } + catch (NumberFormatException rex) + { + throw new MetadataException(tags.getTagById(FIELD_ID_REF) + + " attribute must be an int. Found: " + + fieldIdRef + " Please check your repository file.", rex); + } + } + else { - int fieldId; - fieldId = Integer.parseInt(fieldIdRef); - m_CurrentCOD.addForeignKeyField(fieldId); - } - catch (NumberFormatException rex) - { - throw new MetadataException(tags.getTagById(FIELD_ID_REF) - + " attribute must be an int. Found: " - + fieldIdRef + " Please check your repository file.", rex); + String fieldRef = atts.getValue(tags.getTagById(FIELD_REF)); + if (isDebug) logger.debug(" " + tags.getTagById(FIELD_REF) + ": " + fieldRef); + m_CurrentCOD.addForeignKeyField(fieldRef); } break; } 1.4 +13 -3 jakarta-ojb/src/java/org/apache/ojb/broker/metadata/torque/TorqueForeignKeyGenerator.java Index: TorqueForeignKeyGenerator.java =================================================================== RCS file: /home/cvs/jakarta-ojb/src/java/org/apache/ojb/broker/metadata/torque/TorqueForeignKeyGenerator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- TorqueForeignKeyGenerator.java 21 Sep 2002 15:54:15 -0000 1.3 +++ TorqueForeignKeyGenerator.java 2 Jan 2003 21:27:19 -0000 1.4 @@ -167,9 +167,19 @@ buildForeignKeyHeader(foreignClassDescriptor.getFullTableName(), buffer); for (int i = 0; i < foreignKeyIndices.size(); i++) { - int foreignKeyIndex = ((Integer) foreignKeyIndices.get(i)).intValue(); - String columnName = classDescriptor.getFieldDescriptorByIndex(foreignKeyIndex).getColumnName(); - + String columnName; + Object obj = foreignKeyIndices.get(i); + + if (obj instanceof Integer) + { + int foreignKeyIndex = ((Integer) obj).intValue(); + columnName = classDescriptor.getFieldDescriptorByIndex(foreignKeyIndex).getColumnName(); + } + else + { + columnName = classDescriptor.getFieldDescriptorByName((String) obj).getColumnName(); + } + FieldDescriptor foreignColumn = foreignClassDescriptor.getPkFields()[i]; String foreignColumnName = foreignColumn.getColumnName(); buildReferenceForColumn(buffer, columnName, foreignColumnName); 1.26 +5 -3 jakarta-ojb/src/test/org/apache/ojb/repository.dtd Index: repository.dtd =================================================================== RCS file: /home/cvs/jakarta-ojb/src/test/org/apache/ojb/repository.dtd,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- repository.dtd 26 Dec 2002 19:29:12 -0000 1.25 +++ repository.dtd 2 Jan 2003 21:27:19 -0000 1.26 @@ -311,7 +311,7 @@ --> <!ATTLIST field-descriptor - id CDATA #REQUIRED + id CDATA #IMPLIED name CDATA #REQUIRED table CDATA #IMPLIED column CDATA #REQUIRED @@ -411,7 +411,8 @@ used as a foreign key. --> <!ATTLIST foreignkey - field-id-ref CDATA #REQUIRED + field-id-ref CDATA
{'source': 'Apache Software Foundation Public Mail Archives'}