objectbridge-users Mailing List for ObJectRelationalBridge (Page 4)
Brought to you by:
thma
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
(32) |
May
(86) |
Jun
(53) |
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <jo...@ga...> - 2002-05-30 20:15:49
|
Hi, I have a quite simple problem: My Sample has two Classes, eObject and attribute, with one eObject having several attributes and 1 attribute belong to one eObject. The Mapping... <ClassDescriptor id="1"> <class.name>com.eobjects.EObject</class.name> <table.name>eobject</table.name> <FieldDescriptor id="1"> <field.name>ID</field.name> <column.name>ID</column.name> <jdbc_type>INTEGER</jdbc_type> <PrimaryKey>true</PrimaryKey> </FieldDescriptor> ... <CollectionDescriptor id="1"> <cdfield.name>attributes</cdfield.name> <items.class>com.eobjects.Attribute</items.class> <inverse_fk_descriptor_ids>5</inverse_fk_descriptor_ids> <auto.update>true</auto.update> </CollectionDescriptor> </ClassDescriptor> <ClassDescriptor id="2"> <class.name>com.eobjects.Attribute</class.name> <table.name>attribute</table.name> <FieldDescriptor id="1"> <field.name>ID</field.name> <column.name>ID</column.name> <jdbc_type>INTEGER</jdbc_type> <PrimaryKey>true</PrimaryKey> </FieldDescriptor> ... <FieldDescriptor id="5"> <field.name>eObjectID</field.name> <column.name>objID</column.name> <jdbc_type>INTEGER</jdbc_type> </FieldDescriptor> <ReferenceDescriptor id="1"> <rdfield.name>eObject</rdfield.name> <referenced.class>com.eobjects.EObject</referenced.class> <fk_descriptor_ids>5</fk_descriptor_ids> </ReferenceDescriptor> </ClassDescriptor> When I create an eObject and set it's attributes Vector and store it (I just call broker.store(eObject), the ID is given by Database (OJB sends a select to get it)) ), both eObject and attributes are saved, BUT the Value ob objID in Table Attribute is 0 althought the eObject it belongs to has received the ID 2. So I can't find my attributes when I reload my eObject. But I can't set the foreign-key by myself, as I don't know it until a new eObject is saved for the first time. What's wrong? Joerg |
From: <tr...@th...> - 2002-05-30 02:22:13
|
If you are speaking of the JDO implementation (jdo uses JTA i believe?), then yes, help would be great. Just getting started on it so there is a ton to do. Travis ---- Original Message ---- From: "Ebersole, Steven" <ste...@vi...> Sent: 2002-05-29 To: obj...@li... Subject: [ojb-users] proxied collections and non-decomposed m:n relationships Is it possible to utilize a proxy collection on "non-decomposed m:n mappings" (where an indirection_table is explicitly defined in the mapping)? I keep getting "ORA-00904: invalid column name" errors when attempting this even though it works when the collection is non-proxied? As an aside, I would like to be able to use java.util.List for the collections in the mapped objects whether or not they are proxied. I just wondered whether anyone has started work on a proxy handling the List interface. If not, I will do it, and was just wondering if this would be something of general interest. Also, I know some work has been started on JTA integration. This is something in which I would be extremely interested. If any help is needed on this effort, I would be glad to volunteer any time I can. However, I am not sure who is leading this effort. Just let me know. ******************************************** Steve Ebersole IT Integration Engineer Vignette Corporation 512.741.4195 Visit http://www.vignette.com ******************************************** _______________________________________________________________ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm _______________________________________________ Objectbridge-users mailing list Obj...@li... https://lists.sourceforge.net/lists/listinfo/objectbridge-users |
From: <Mao...@in...> - 2002-05-30 00:21:15
|
Works fine. Thanks for the prompt reply. Qingwen Thomas Mahler <tho...@ho...> on 30/05/2002 03:10:18 To: Mao Qingwen/NSW/ING-MM/AU cc: obj...@li... Subject: Re: [ojb-users] sample application with MYSQL please read: http://objectbridge.sourceforge.net/rdbms-support.html hth, thomas Mao...@in... wrote: > > > I am a new user of OBJ. The sample examples run ok when I use the default > HSQLDB. But when I switch to MQSQL (I've only changed the switch in > build.properties file), I had the following exceptions, Does anyone know how do > i fix it? Your help is very much appreciated. > > Qingwen > > > C:\OpenSource\ojb-0.8.400>build run_broker_example > Buildfile: build.xml > > init: > > prepare: > > main: > > prepare-tests: > [copy] Copying 1 file to C:\OpenSource\ojb-0.8.400\target\src\test\setup > > tests: > [echo] using switches: -HSQLDB, -ORACLE, -MS_ACCESS, -INSTANTDB, -DB2, -POS > TGRESQL, +MYSQL, -INFORMIX, -MSSQLSERVER2000 > [java] . > [move] Moving 1 files to C:\OpenSource\ojb-0.8.400\target\src\test\setup > [copy] Copying 1 file to C:\OpenSource\ojb-0.8.400\target\test\setup > [delete] Deleting: C:\OpenSource\ojb-0.8.400\target\src\test\setup\database-s > etup.sql > [java] [BOOT] INFO: process db-setup.sql > [java] [BOOT] INFO: DB url: jdbc:mysql://localhost:3306/ojb > [java] [BOOT] INFO: Driver: Mark Matthews' MySQL Driver > [java] [BOOT] INFO: Version: 2.0.10 > > run_broker_example: > [junit] .[BOOT] INFO: OJB.properties: file:/C:/OpenSource/ojb-0.8.400/target > /test/ojb/OJB.properties > [junit] [BOOT] INFO: loading XML took 882 msecs > [junit] F.F.null > [junit] ojb.broker.PersistenceBrokerSQLException > [junit] at ojb.broker.accesslayer.JdbcAccess.materializeObject(JdbcAcces > s.java:352) > [junit] at ojb.broker.singlevm.PersistenceBrokerImpl.getDBObject(Persist > enceBrokerImpl.java:1062) > [junit] at ojb.broker.singlevm.PersistenceBrokerImpl.getObjectByIdentity > (PersistenceBrokerImpl.java:1169) > [junit] at ojb.broker.accesslayer.IndirectionHandler.materializeSubject( > IndirectionHandler.java:202) > [junit] at ojb.broker.accesslayer.IndirectionHandler.getRealSubject(Indi > rectionHandler.java:187) > [junit] at ojb.broker.VirtualProxy.getRealSubject(VirtualProxy.java:108) > > [junit] at test.ojb.broker.ProductGroupProxy.realSubject(ProductGroupPro > xy.java:65) > [junit] at test.ojb.broker.ProductGroupProxy.getName(ProductGroupProxy.j > ava:53) > [junit] at test.ojb.broker.Article.toString(Article.java:10) > [junit] at java.lang.String.valueOf(String.java:1947) > [junit] at java.lang.StringBuffer.append(StringBuffer.java:370) > [junit] at ojb.broker.singlevm.PersistenceBrokerImpl.store(PersistenceBr > okerImpl.java:278) > [junit] at test.ojb.broker.BrokerExamples.testObjectCache(BrokerExamples > .java:189) > [junit] at java.lang.reflect.Method.invoke(Native Method) > [junit] at junit.framework.TestCase.runTest(TestCase.java:166) > [junit] at junit.framework.TestCase.runBare(TestCase.java:140) > [junit] at junit.framework.TestResult$1.protect(TestResult.java:106) > [junit] at junit.framework.TestResult.runProtected(TestResult.java:124) > [junit] at junit.framework.TestResult.run(TestResult.java:109) > [junit] at junit.framework.TestCase.run(TestCase.java:131) > [junit] at junit.framework.TestSuite.runTest(TestSuite.java:173) > [junit] at junit.framework.TestSuite.run(TestSuite.java:168) > [junit] F.null > [junit] at junit.textui.TestRunner.doRun(TestRunner.java:74) > [junit] at junit.textui.TestRunner.start(TestRunner.java:234) > [junit] at junit.textui.TestRunner.main(TestRunner.java:112) > [junit] ojb.broker.PersistenceBrokerSQLException > [junit] at ojb.broker.accesslayer.JdbcAccess.materializeObject(JdbcAcces > s.java:352) > [junit] at ojb.broker.singlevm.PersistenceBrokerImpl.getDBObject(Persist > enceBrokerImpl.java:1062) > [junit] at ojb.broker.singlevm.PersistenceBrokerImpl.getObjectByIdentity > (PersistenceBrokerImpl.java:1169) > [junit] at ojb.broker.accesslayer.IndirectionHandler.materializeSubject( > IndirectionHandler.java:202) > [junit] at ojb.broker.accesslayer.IndirectionHandler.getRealSubject(Indi > rectionHandler.java:187) > [junit] at ojb.broker.VirtualProxy.getRealSubject(VirtualProxy.java:108) > > [junit] at test.ojb.broker.ProductGroupProxy.realSubject(ProductGroupPro > xy.java:65) > [junit] at test.ojb.broker.ProductGroupProxy.getName(ProductGroupProxy.j > ava:53) > [junit] at test.ojb.broker.Article.toString(Article.java:10) > [junit] at java.lang.String.valueOf(String.java:1947) > [junit] at java.lang.StringBuffer.append(StringBuffer.java:370) > [junit] at ojb.broker.singlevm.PersistenceBrokerImpl.store(PersistenceBr > okerImpl.java:278) > [junit] at test.ojb.broker.BrokerExamples.testShallowAndDeepRetrieval(Br > okerExamples.java:252) > [junit] at java.lang.reflect.Method.invoke(Native Method) > [junit] at junit.framework.TestCase.runTest(TestCase.java:166) > [junit] at junit.framework.TestCase.runBare(TestCase.java:140) > [junit] at junit.framework.TestResult$1.protect(TestResult.java:106) > [junit] at junit.framework.TestResult.runProtected(TestResult.java:124) > [junit] at junit.framework.TestResult.run(TestResult.java:109) > [junit] at junit.framework.TestCase.run(TestCase.java:131) > [junit] null > [junit] at junit.framework.TestSuite.runTest(TestSuite.java:173) > [junit] at junit.framework.TestSuite.run(TestSuite.java:168) > [junit] at junit.textui.TestRunner.doRun(TestRunner.java:74) > [junit] at junit.textui.TestRunner.start(TestRunner.java:234) > [junit] at junit.textui.TestRunner.main(TestRunner.java:112) > [junit] java.lang.NullPointerException > [junit] at test.ojb.broker.ProductGroupProxy.getName(ProductGroupProxy.j > ava:53) > [junit] at test.ojb.broker.Article.toString(Article.java:10) > [junit] at java.lang.String.valueOf(String.java:1947) > [junit] at java.lang.StringBuffer.append(StringBuffer.java:370) > [junit] at ojb.broker.singlevm.PersistenceBrokerImpl.store(PersistenceBr > okerImpl.java:278) > [junit] at test.ojb.broker.BrokerExamples.testShallowAndDeepRetrieval(Br > okerExamples.java:252) > [junit] at java.lang.reflect.Method.invoke(Native Method) > [junit] at junit.framework.TestCase.runTest(TestCase.java:166) > [junit] at junit.framework.TestCase.runBare(TestCase.java:140) > [junit] at junit.framework.TestResult$1.protect(TestResult.java:106) > [junit] at junit.framework.TestResult.runProtected(TestResult.java:124) > [junit] at junit.framework.TestResult.run(TestResult.java:109) > [junit] at junit.framework.TestCase.run(TestCase.java:131) > [junit] at junit.framework.TestSuite.runTest(TestSuite.java:173) > [junit] F > [junit] Time: 10.705 > [junit] There were 4 failures: > [junit] 1) testCollectionRetrieval(test.ojb.broker.BrokerExamples)junit.fram > ework.AssertionFailedError > [junit] at test.ojb.broker.BrokerExamples.testCollectionRetrieval(Broker > Examples.java:128) > [junit] at junit.framework.TestSuite.run(TestSuite.java:168) > [junit] at junit.textui.TestRunner.doRun(TestRunner.java:74) > [junit] at junit.textui.TestRunner.start(TestRunner.java:234) > [junit] 2) testModifications(test.ojb.broker.BrokerExamples)junit.framework > .AssertionFailedError > [junit] at junit.textui.TestRunner.main(TestRunner.java:112) > [junit] at test.ojb.broker.BrokerExamples.testModifications(BrokerExampl > es.java:159) > [junit] 3) testObjectCache(test.ojb.broker.BrokerExamples)junit.framework.As > sertionFailedError > [junit] at test.ojb.broker.BrokerExamples.testObjectCache(BrokerExamples > .java:200) > [junit] 4) testShallowAndDeepRetrieval(test.ojb.broker.BrokerExamples)junit. > framework.AssertionFailedError > [junit] at test.ojb.broker.BrokerExamples.testShallowAndDeepRetrieval(Br > okerExamples.java:278) > [junit] > [junit] FAILURES!!! > [junit] Tests run: 4, Failures: 4, Errors: 0 > [junit] > > BUILD FAILED > > NOTICE > The information contained in this electronic mail message is privileged and > confidential, and is intended only for use of the addressee. If you are not the > intended recipient, you are hereby notified that any disclosure, reproduction, > distribution or other use of this communication is strictly prohibited. If you > have received this communication in error, please notify the sender by reply > transmission and delete the message without copying or disclosing it. > > > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Objectbridge-users mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-users > > > > |
From: Ebersole, S. <ste...@vi...> - 2002-05-29 21:34:33
|
Is it possible to utilize a proxy collection on "non-decomposed m:n mappings" (where an indirection_table is explicitly defined in the mapping)? I keep getting "ORA-00904: invalid column name" errors when attempting this even though it works when the collection is non-proxied? As an aside, I would like to be able to use java.util.List for the collections in the mapped objects whether or not they are proxied. I just wondered whether anyone has started work on a proxy handling the List interface. If not, I will do it, and was just wondering if this would be something of general interest. Also, I know some work has been started on JTA integration. This is something in which I would be extremely interested. If any help is needed on this effort, I would be glad to volunteer any time I can. However, I am not sure who is leading this effort. Just let me know. ******************************************** Steve Ebersole IT Integration Engineer Vignette Corporation 512.741.4195 Visit http://www.vignette.com ******************************************** |
From: Thomas M. <tho...@ho...> - 2002-05-29 17:10:11
|
please read: http://objectbridge.sourceforge.net/rdbms-support.html hth, thomas Mao...@in... wrote: > > > I am a new user of OBJ. The sample examples run ok when I use the default > HSQLDB. But when I switch to MQSQL (I've only changed the switch in > build.properties file), I had the following exceptions, Does anyone know how do > i fix it? Your help is very much appreciated. > > Qingwen > > > C:\OpenSource\ojb-0.8.400>build run_broker_example > Buildfile: build.xml > > init: > > prepare: > > main: > > prepare-tests: > [copy] Copying 1 file to C:\OpenSource\ojb-0.8.400\target\src\test\setup > > tests: > [echo] using switches: -HSQLDB, -ORACLE, -MS_ACCESS, -INSTANTDB, -DB2, -POS > TGRESQL, +MYSQL, -INFORMIX, -MSSQLSERVER2000 > [java] . > [move] Moving 1 files to C:\OpenSource\ojb-0.8.400\target\src\test\setup > [copy] Copying 1 file to C:\OpenSource\ojb-0.8.400\target\test\setup > [delete] Deleting: C:\OpenSource\ojb-0.8.400\target\src\test\setup\database-s > etup.sql > [java] [BOOT] INFO: process db-setup.sql > [java] [BOOT] INFO: DB url: jdbc:mysql://localhost:3306/ojb > [java] [BOOT] INFO: Driver: Mark Matthews' MySQL Driver > [java] [BOOT] INFO: Version: 2.0.10 > > run_broker_example: > [junit] .[BOOT] INFO: OJB.properties: file:/C:/OpenSource/ojb-0.8.400/target > /test/ojb/OJB.properties > [junit] [BOOT] INFO: loading XML took 882 msecs > [junit] F.F.null > [junit] ojb.broker.PersistenceBrokerSQLException > [junit] at ojb.broker.accesslayer.JdbcAccess.materializeObject(JdbcAcces > s.java:352) > [junit] at ojb.broker.singlevm.PersistenceBrokerImpl.getDBObject(Persist > enceBrokerImpl.java:1062) > [junit] at ojb.broker.singlevm.PersistenceBrokerImpl.getObjectByIdentity > (PersistenceBrokerImpl.java:1169) > [junit] at ojb.broker.accesslayer.IndirectionHandler.materializeSubject( > IndirectionHandler.java:202) > [junit] at ojb.broker.accesslayer.IndirectionHandler.getRealSubject(Indi > rectionHandler.java:187) > [junit] at ojb.broker.VirtualProxy.getRealSubject(VirtualProxy.java:108) > > [junit] at test.ojb.broker.ProductGroupProxy.realSubject(ProductGroupPro > xy.java:65) > [junit] at test.ojb.broker.ProductGroupProxy.getName(ProductGroupProxy.j > ava:53) > [junit] at test.ojb.broker.Article.toString(Article.java:10) > [junit] at java.lang.String.valueOf(String.java:1947) > [junit] at java.lang.StringBuffer.append(StringBuffer.java:370) > [junit] at ojb.broker.singlevm.PersistenceBrokerImpl.store(PersistenceBr > okerImpl.java:278) > [junit] at test.ojb.broker.BrokerExamples.testObjectCache(BrokerExamples > .java:189) > [junit] at java.lang.reflect.Method.invoke(Native Method) > [junit] at junit.framework.TestCase.runTest(TestCase.java:166) > [junit] at junit.framework.TestCase.runBare(TestCase.java:140) > [junit] at junit.framework.TestResult$1.protect(TestResult.java:106) > [junit] at junit.framework.TestResult.runProtected(TestResult.java:124) > [junit] at junit.framework.TestResult.run(TestResult.java:109) > [junit] at junit.framework.TestCase.run(TestCase.java:131) > [junit] at junit.framework.TestSuite.runTest(TestSuite.java:173) > [junit] at junit.framework.TestSuite.run(TestSuite.java:168) > [junit] F.null > [junit] at junit.textui.TestRunner.doRun(TestRunner.java:74) > [junit] at junit.textui.TestRunner.start(TestRunner.java:234) > [junit] at junit.textui.TestRunner.main(TestRunner.java:112) > [junit] ojb.broker.PersistenceBrokerSQLException > [junit] at ojb.broker.accesslayer.JdbcAccess.materializeObject(JdbcAcces > s.java:352) > [junit] at ojb.broker.singlevm.PersistenceBrokerImpl.getDBObject(Persist > enceBrokerImpl.java:1062) > [junit] at ojb.broker.singlevm.PersistenceBrokerImpl.getObjectByIdentity > (PersistenceBrokerImpl.java:1169) > [junit] at ojb.broker.accesslayer.IndirectionHandler.materializeSubject( > IndirectionHandler.java:202) > [junit] at ojb.broker.accesslayer.IndirectionHandler.getRealSubject(Indi > rectionHandler.java:187) > [junit] at ojb.broker.VirtualProxy.getRealSubject(VirtualProxy.java:108) > > [junit] at test.ojb.broker.ProductGroupProxy.realSubject(ProductGroupPro > xy.java:65) > [junit] at test.ojb.broker.ProductGroupProxy.getName(ProductGroupProxy.j > ava:53) > [junit] at test.ojb.broker.Article.toString(Article.java:10) > [junit] at java.lang.String.valueOf(String.java:1947) > [junit] at java.lang.StringBuffer.append(StringBuffer.java:370) > [junit] at ojb.broker.singlevm.PersistenceBrokerImpl.store(PersistenceBr > okerImpl.java:278) > [junit] at test.ojb.broker.BrokerExamples.testShallowAndDeepRetrieval(Br > okerExamples.java:252) > [junit] at java.lang.reflect.Method.invoke(Native Method) > [junit] at junit.framework.TestCase.runTest(TestCase.java:166) > [junit] at junit.framework.TestCase.runBare(TestCase.java:140) > [junit] at junit.framework.TestResult$1.protect(TestResult.java:106) > [junit] at junit.framework.TestResult.runProtected(TestResult.java:124) > [junit] at junit.framework.TestResult.run(TestResult.java:109) > [junit] at junit.framework.TestCase.run(TestCase.java:131) > [junit] null > [junit] at junit.framework.TestSuite.runTest(TestSuite.java:173) > [junit] at junit.framework.TestSuite.run(TestSuite.java:168) > [junit] at junit.textui.TestRunner.doRun(TestRunner.java:74) > [junit] at junit.textui.TestRunner.start(TestRunner.java:234) > [junit] at junit.textui.TestRunner.main(TestRunner.java:112) > [junit] java.lang.NullPointerException > [junit] at test.ojb.broker.ProductGroupProxy.getName(ProductGroupProxy.j > ava:53) > [junit] at test.ojb.broker.Article.toString(Article.java:10) > [junit] at java.lang.String.valueOf(String.java:1947) > [junit] at java.lang.StringBuffer.append(StringBuffer.java:370) > [junit] at ojb.broker.singlevm.PersistenceBrokerImpl.store(PersistenceBr > okerImpl.java:278) > [junit] at test.ojb.broker.BrokerExamples.testShallowAndDeepRetrieval(Br > okerExamples.java:252) > [junit] at java.lang.reflect.Method.invoke(Native Method) > [junit] at junit.framework.TestCase.runTest(TestCase.java:166) > [junit] at junit.framework.TestCase.runBare(TestCase.java:140) > [junit] at junit.framework.TestResult$1.protect(TestResult.java:106) > [junit] at junit.framework.TestResult.runProtected(TestResult.java:124) > [junit] at junit.framework.TestResult.run(TestResult.java:109) > [junit] at junit.framework.TestCase.run(TestCase.java:131) > [junit] at junit.framework.TestSuite.runTest(TestSuite.java:173) > [junit] F > [junit] Time: 10.705 > [junit] There were 4 failures: > [junit] 1) testCollectionRetrieval(test.ojb.broker.BrokerExamples)junit.fram > ework.AssertionFailedError > [junit] at test.ojb.broker.BrokerExamples.testCollectionRetrieval(Broker > Examples.java:128) > [junit] at junit.framework.TestSuite.run(TestSuite.java:168) > [junit] at junit.textui.TestRunner.doRun(TestRunner.java:74) > [junit] at junit.textui.TestRunner.start(TestRunner.java:234) > [junit] 2) testModifications(test.ojb.broker.BrokerExamples)junit.framework > .AssertionFailedError > [junit] at junit.textui.TestRunner.main(TestRunner.java:112) > [junit] at test.ojb.broker.BrokerExamples.testModifications(BrokerExampl > es.java:159) > [junit] 3) testObjectCache(test.ojb.broker.BrokerExamples)junit.framework.As > sertionFailedError > [junit] at test.ojb.broker.BrokerExamples.testObjectCache(BrokerExamples > .java:200) > [junit] 4) testShallowAndDeepRetrieval(test.ojb.broker.BrokerExamples)junit. > framework.AssertionFailedError > [junit] at test.ojb.broker.BrokerExamples.testShallowAndDeepRetrieval(Br > okerExamples.java:278) > [junit] > [junit] FAILURES!!! > [junit] Tests run: 4, Failures: 4, Errors: 0 > [junit] > > BUILD FAILED > > NOTICE > The information contained in this electronic mail message is privileged and > confidential, and is intended only for use of the addressee. If you are not the > intended recipient, you are hereby notified that any disclosure, reproduction, > distribution or other use of this communication is strictly prohibited. If you > have received this communication in error, please notify the sender by reply > transmission and delete the message without copying or disclosing it. > > > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Objectbridge-users mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-users > > > > |
From: Govindarajan S (Gover) <gov...@az...> - 2002-05-29 13:22:49
|
Hi, I have a doubt regarding the storing of mapped objects. I tried to implement the 1:1 relationship between the ProductGroup and Article. Whenever i was setting the product instance in the article and when i persist the article the ProductGroup is not persisted. Look at the code below, Article article = new Article(); article.setArticleName ("TestArticle"); ProductGroup prodGrp = new ProductGroup(); prodGrp.setProdGroupName("Group1"); prodGrp.setDescription ("Testgroup"); article.setProductGroup (prodGrp); try { broker.beginTransaction(); broker.store(article); broker.commitTransaction(); } catch (PersistenceBrokerException pExp) { System.out.println ("----- Error persisting Article -----"); pExp.printStackTrace(); } // end of try-catch There are two tables namely the ProductGroup and Article. And the mapping is all done as per the tutorial:3. With the above code, i expected the ProductGroup to be saved as well. But i had to persist the ProductGroup object ('prodGrp') separately. Is this a bug or iam missing out a funda here? This was the case with the 1:n mapping as well. I retrieve the ProductGroup and add articles to it. But i persist the ProductGroup hoping that the objects in the collection are also persisted. But i dont find the articles persisted. Code is below, Criteria qryCriteria = new Criteria(); qryCriteria.addEqualTo ("prodGroupName","Grocery"); QueryByCriteria criterion = new QueryByCriteria (ProductGroup.class, qryCriteria); ProductGroup prodGroup = (ProductGroup)broker. getObjectByQuery(criterion); Article art1 = new Article(); art1.setArticleName ("Tea"); art1.setProductGroup (prodGroup); Article art2 = new Article(); art2.setArticleName ("Coffee"); art2.setProductGroup (prodGroup); prodGroup.addArticle (art1); prodGroup.addArticle (art2); try { broker.beginTransaction(); broker.store(prodGroup); broker.commitTransaction(); System.out.println("--- Added the articles ---"); } catch (PersistenceBrokerException pExp) { System.out.println("---- Error storing 1:n relation objs ---"); pExp.printStackTrace(); } // end of try-catch any help in this regard would be greatly appreciated regds gover |
From: Ted S. <emo...@ya...> - 2002-05-29 10:51:05
|
Hi Steven, I recently ported an application of mine from Castor to OJB and am glad I did. However, I also had problems getting things to work at first. I spent a lot of time stepping through OJB with a debugger just to find out that it was my fault, I didn't read the docs carefully enough. Anyway, one BIG THING you can do diagnose problems (and I don't know if this is in the docs or not) is to crank up the logging that OJB does. In your ojb.properties file look for this line... ojb.broker.metadata.RepositoryXmlHandler.LogLevel=WARN ...and change it to this... ojb.broker.metadata.RepositoryXmlHandler.LogLevel=DEBUG Doing that will make it easier to see if there are syntax problems in your mapping file. Also, you can change this line... ojb.broker.accesslayer.SqlGenerator.LogLevel=WARN ...to this... ojb.broker.accesslayer.SqlGenerator.LogLevel=DEBUG ...and this will make it easier to see if you've misspelled and DB table or column names or to see how well the mapping is working. ted stockwell --- "Ebersole, Steven" <ste...@vi...> wrote: > Trying not to sound pushy here, but as I mentioned in my first post I > am > considering moving from Castor over to OJB for the project on which I > am > currently working. However, I am unable to get even simple reference > relationships working. Obviously I can't move the project over to > this > library if this is going to be the case. But it seems others are > getting > this to work. > > So I guess my question is now, should I even continue evaluating OJB? > I > mean it has been almost a month since my original post, and I am > still no > closer to solving the issue and not a single person has been willing > (or > knowledgeable enough) to help. I know this is open source and as > such: 1) I > could simply debug the library myself; 2) people contribute and help > others > as their time allows. As for one, I am in the middle of a project > myself > and unfortunately cannot validate the time to spend troubleshooting a > proposed library which may not even be used. As for two, I > understand the > time constraints of others, but to wait one month for for a response > on such > a basic O/R-mapping requirement as relationships? > > Also, as I have previously mentioned, the set-up and the > implementation of > this library are extremely promising (especially in the environment > in which > I was hoping to use it). In short I want to use this product. > However, I > cannot swap out Castor to OJB at this time because I do not feel > confident > enough in OJB's capibilities mainly because every test I have tried > to run > (above and beyond strict table-to-object) fails. > > Please, please can anyone help with the below problem? Anyone > encountered > it before? > > Thanks in advance > > > > ******************************************** > Steve Ebersole > IT Integration Engineer > Vignette Corporation > 512.741.4195 > > Visit http://www.vignette.com > > ******************************************** > > > -----Original Message----- > From: Ebersole, Steven [mailto:ste...@vi...] > Sent: Monday, May 20, 2002 7:47 AM > To: 'Thomas Mahler'; obj...@li... > Subject: RE: [ojb-users] references > > > Any ideas? > > > ******************************************** > Steve Ebersole > IT Integration Engineer > Vignette Corporation > 512.741.4195 > > Visit http://www.vignette.com > > ******************************************** > > > -----Original Message----- > From: Ebersole, Steven [mailto:ste...@vi...] > Sent: Wednesday, May 08, 2002 7:09 AM > To: 'Thomas Mahler'; obj...@li... > Subject: RE: [ojb-users] references > > > Below is the exception I get. I appears that the exception occurs > when > trying to resolve the reference to parent company when that fk column > is > null. If I remove that reference descriptor, everything works. > > Query from class com.vignette.it.apps.dbapi.domain.CompanyDO where > comp_id= > ? > [DEFAULT] WARN: Please define a public constructor for class > com.vignette.it.apps.dbapi.domain.CompanyDO > with the following signature: (java.lang.Integer, java.lang.String, > java.lang.Integer). > It must initialize the classes persistent attributes. This is > recommended to > increase performance but it's not mandatory! > [ojb.broker.singlevm.PersistenceBrokerImpl] ERROR: expected type: > class > com.vignette.it.apps.dbapi.domain.CompanyDO > [ojb.broker.accesslayer.RsIterator] ERROR: null > java.lang.ArrayIndexOutOfBoundsException > at > ojb.broker.metadata.ClassDescriptor.getFieldDescriptorByIndex(ClassDescripto > r.java:263) > at > ojb.broker.metadata.ObjectReferenceDescriptor.getForeignKeyFieldDescriptors( > ObjectReferenceDescriptor.java:242) > at > ojb.broker.metadata.ObjectReferenceDescriptor.getForeignKeyValues(ObjectRefe > renceDescriptor.java:264) > at > ojb.broker.singlevm.PersistenceBrokerImpl.getReferencedObject(PersistenceBro > kerImpl.java:700) > at > ojb.broker.singlevm.PersistenceBrokerImpl.retrieveReferences(PersistenceBrok > erImpl.java:517) > at > ojb.broker.accesslayer.RsIterator.getObjectFromResultSet(RsIterator.java:263 > ) > at > ojb.broker.accesslayer.RsIterator.next(RsIterator.java:145) > at > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > okerImpl.java:900) > at > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > okerImpl.java:966) > at > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > okerImpl.java:1054) > at > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > okerImpl.java:1041) > at TestOJBInstall.execute(TestOJBInstall.java:66) > at TestOJBInstall.main(TestOJBInstall.java:53) > java.util.NoSuchElementException > at > ojb.broker.accesslayer.RsIterator.next(RsIterator.java:154) > at > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > okerImpl.java:900) > at > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > okerImpl.java:966) > at > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > okerImpl.java:1054) > at > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > okerImpl.java:1041) > at TestOJBInstall.execute(TestOJBInstall.java:66) > at TestOJBInstall.main(TestOJBIError occurred : > java.util.NoSuchElementException > nstall.java:53) > > > > > > ******************************************** > Steve Ebersole > IT Integration Engineer > Vignette Corporation > 512.741.4195 > > Visit http://www.vignette.com > > ******************************************** > > > -----Original Message----- > From: Thomas Mahler [mailto:tho...@ho...] > Sent: Friday, May 03, 2002 12:11 AM > To: Ebersole, Steven > Subject: Re: [ojb-users] references > > > Hi Steven, > > Ebersole, Steven wrote: > > > I am looking at switching from Castor over to OJB as it looks > really > > promising in terms of its functionality (I especially love the use > of > > virtual proxies here). I did have two questions come up from my > initial > > trials of OJB. > > > > 1) Is it necessary to have both the foreign key and the foreign > reference > > mapped and present on the object? > > > depends on the navigibility between your persistent classes. > If you want to navigate from the 1-side to the n-side only, you just > need a foreign key (and a ForeignKeyDescriptor). > > If you want navigation from the n-side to the 1-side too, you'll also > > need a reference attribute (and a ReferenceDecsriptor too). > > In the examples, the relation between > > Article and ProductGroup is the example From which I was working. > There, > > Article has two attributes dealing with its relation to a > ProductGroup, > > > Yes, because we have navigation from ProductGroup to all its Articles > > and from an Article to its associated ProductGroup. > > > > productGroupId (which is the DB fk field) and productGroup (which > is an > > instance of the ProductGroup object to which productGroupId > referes). Is > it > > necessary to do this, or is there a way to have the Product object > only > know > > about its related ProductGroup? > > > No, because ProductGroup and Article have a 1:n relation the table > representaing Article entities *must* have a foreign key to identify > the > associated ProductGroup. > > > > > > 2) I mapped a relationship, uing my classes, similiar to the above > > relationship (it is a company -> parent company relationship). > However, I > > get exceptions if a particular company did not have a parent > company (its > > PRTN_COMP_ID column on the DB is NULL). Is there something > additional I > > have to set up in the mapping to define that side of the > relationship as > > optional? Below is the mapping I have for this: > > > > > > <ClassDescriptor id="2"> > > > <class.name>com.vignette.it.apps.dbapi.domain.CompanyDO</class.name> > > <table.name>COMPANY</table.name> > > <FieldDescriptor id="1"> > > <field.name>id</field.name> > > <column.name>COMP_ID</column.name> > > <jdbc_type>INTEGER</jdbc_type> > > <PrimaryKey>true</PrimaryKey> > > </FieldDescriptor> > > ... > > <FieldDescriptor id="5"> > > <field.name>parentCompanyId</field.name> > > <column.name>PRNT_COMP_ID</column.name> > > <jdbc_type>INTEGER</jdbc_type> > > </FieldDescriptor> > > <ReferenceDescriptor id="1"> > > <rdfield.name>parentCompany</rdfield.name> > > > > > <referenced.class>com.vignette.it.apps.dbapi.domain.CompanyDO</referenced.cl > > ass> > > <fk_descriptor_ids>5</fk_descriptor_ids> > > </ReferenceDescriptor> > > </ClassDescriptor> > > > > > Your mapping seems OK. This must be an OJB bug! Can you provide me > with > a full stacktrace ? > > thanks, > > Thomas > > > > > > Thanks > > > > > > > > > > ******************************************** > > Steve Ebersole > > IT Integration Engineer > > Vignette Corporation > > 512.741.4195 > > > > Visit http://www.vignette.com > > > > ******************************************** > > > > _______________________________________________________________ > > > > Have big pipes? SourceForge.net is looking for download mirrors. We > supply > > the hardware. You get the recognition. Email Us: > ban...@so... > > _______________________________________________ > > Objectbridge-users mailing list > > Obj...@li... > > https://lists.sourceforge.net/lists/listinfo/objectbridge-users > > > > > > > > > > > _______________________________________________________________ > > Have big pipes? SourceForge.net is looking for download mirrors. We > supply > the hardware. You get the recognition. Email Us: > ban...@so... > _______________________________________________ > Objectbridge-users mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-users > > _______________________________________________________________ > Hundreds of nodes, one monster rendering program. > Now that's a super model! Visit http://clustering.foundries.sf.net/ > > _______________________________________________ > Objectbridge-users mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-users > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- > http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Objectbridge-users mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-users __________________________________________________ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com |
From: <Mao...@in...> - 2002-05-29 07:34:00
|
I am a new user of OBJ. The sample examples run ok when I use the default HSQLDB. But when I switch to MQSQL (I've only changed the switch in build.properties file), I had the following exceptions, Does anyone know how do i fix it? Your help is very much appreciated. Qingwen C:\OpenSource\ojb-0.8.400>build run_broker_example Buildfile: build.xml init: prepare: main: prepare-tests: [copy] Copying 1 file to C:\OpenSource\ojb-0.8.400\target\src\test\setup tests: [echo] using switches: -HSQLDB, -ORACLE, -MS_ACCESS, -INSTANTDB, -DB2, -POS TGRESQL, +MYSQL, -INFORMIX, -MSSQLSERVER2000 [java] . [move] Moving 1 files to C:\OpenSource\ojb-0.8.400\target\src\test\setup [copy] Copying 1 file to C:\OpenSource\ojb-0.8.400\target\test\setup [delete] Deleting: C:\OpenSource\ojb-0.8.400\target\src\test\setup\database-s etup.sql [java] [BOOT] INFO: process db-setup.sql [java] [BOOT] INFO: DB url: jdbc:mysql://localhost:3306/ojb [java] [BOOT] INFO: Driver: Mark Matthews' MySQL Driver [java] [BOOT] INFO: Version: 2.0.10 run_broker_example: [junit] .[BOOT] INFO: OJB.properties: file:/C:/OpenSource/ojb-0.8.400/target /test/ojb/OJB.properties [junit] [BOOT] INFO: loading XML took 882 msecs [junit] F.F.null [junit] ojb.broker.PersistenceBrokerSQLException [junit] at ojb.broker.accesslayer.JdbcAccess.materializeObject(JdbcAcces s.java:352) [junit] at ojb.broker.singlevm.PersistenceBrokerImpl.getDBObject(Persist enceBrokerImpl.java:1062) [junit] at ojb.broker.singlevm.PersistenceBrokerImpl.getObjectByIdentity (PersistenceBrokerImpl.java:1169) [junit] at ojb.broker.accesslayer.IndirectionHandler.materializeSubject( IndirectionHandler.java:202) [junit] at ojb.broker.accesslayer.IndirectionHandler.getRealSubject(Indi rectionHandler.java:187) [junit] at ojb.broker.VirtualProxy.getRealSubject(VirtualProxy.java:108) [junit] at test.ojb.broker.ProductGroupProxy.realSubject(ProductGroupPro xy.java:65) [junit] at test.ojb.broker.ProductGroupProxy.getName(ProductGroupProxy.j ava:53) [junit] at test.ojb.broker.Article.toString(Article.java:10) [junit] at java.lang.String.valueOf(String.java:1947) [junit] at java.lang.StringBuffer.append(StringBuffer.java:370) [junit] at ojb.broker.singlevm.PersistenceBrokerImpl.store(PersistenceBr okerImpl.java:278) [junit] at test.ojb.broker.BrokerExamples.testObjectCache(BrokerExamples .java:189) [junit] at java.lang.reflect.Method.invoke(Native Method) [junit] at junit.framework.TestCase.runTest(TestCase.java:166) [junit] at junit.framework.TestCase.runBare(TestCase.java:140) [junit] at junit.framework.TestResult$1.protect(TestResult.java:106) [junit] at junit.framework.TestResult.runProtected(TestResult.java:124) [junit] at junit.framework.TestResult.run(TestResult.java:109) [junit] at junit.framework.TestCase.run(TestCase.java:131) [junit] at junit.framework.TestSuite.runTest(TestSuite.java:173) [junit] at junit.framework.TestSuite.run(TestSuite.java:168) [junit] F.null [junit] at junit.textui.TestRunner.doRun(TestRunner.java:74) [junit] at junit.textui.TestRunner.start(TestRunner.java:234) [junit] at junit.textui.TestRunner.main(TestRunner.java:112) [junit] ojb.broker.PersistenceBrokerSQLException [junit] at ojb.broker.accesslayer.JdbcAccess.materializeObject(JdbcAcces s.java:352) [junit] at ojb.broker.singlevm.PersistenceBrokerImpl.getDBObject(Persist enceBrokerImpl.java:1062) [junit] at ojb.broker.singlevm.PersistenceBrokerImpl.getObjectByIdentity (PersistenceBrokerImpl.java:1169) [junit] at ojb.broker.accesslayer.IndirectionHandler.materializeSubject( IndirectionHandler.java:202) [junit] at ojb.broker.accesslayer.IndirectionHandler.getRealSubject(Indi rectionHandler.java:187) [junit] at ojb.broker.VirtualProxy.getRealSubject(VirtualProxy.java:108) [junit] at test.ojb.broker.ProductGroupProxy.realSubject(ProductGroupPro xy.java:65) [junit] at test.ojb.broker.ProductGroupProxy.getName(ProductGroupProxy.j ava:53) [junit] at test.ojb.broker.Article.toString(Article.java:10) [junit] at java.lang.String.valueOf(String.java:1947) [junit] at java.lang.StringBuffer.append(StringBuffer.java:370) [junit] at ojb.broker.singlevm.PersistenceBrokerImpl.store(PersistenceBr okerImpl.java:278) [junit] at test.ojb.broker.BrokerExamples.testShallowAndDeepRetrieval(Br okerExamples.java:252) [junit] at java.lang.reflect.Method.invoke(Native Method) [junit] at junit.framework.TestCase.runTest(TestCase.java:166) [junit] at junit.framework.TestCase.runBare(TestCase.java:140) [junit] at junit.framework.TestResult$1.protect(TestResult.java:106) [junit] at junit.framework.TestResult.runProtected(TestResult.java:124) [junit] at junit.framework.TestResult.run(TestResult.java:109) [junit] at junit.framework.TestCase.run(TestCase.java:131) [junit] null [junit] at junit.framework.TestSuite.runTest(TestSuite.java:173) [junit] at junit.framework.TestSuite.run(TestSuite.java:168) [junit] at junit.textui.TestRunner.doRun(TestRunner.java:74) [junit] at junit.textui.TestRunner.start(TestRunner.java:234) [junit] at junit.textui.TestRunner.main(TestRunner.java:112) [junit] java.lang.NullPointerException [junit] at test.ojb.broker.ProductGroupProxy.getName(ProductGroupProxy.j ava:53) [junit] at test.ojb.broker.Article.toString(Article.java:10) [junit] at java.lang.String.valueOf(String.java:1947) [junit] at java.lang.StringBuffer.append(StringBuffer.java:370) [junit] at ojb.broker.singlevm.PersistenceBrokerImpl.store(PersistenceBr okerImpl.java:278) [junit] at test.ojb.broker.BrokerExamples.testShallowAndDeepRetrieval(Br okerExamples.java:252) [junit] at java.lang.reflect.Method.invoke(Native Method) [junit] at junit.framework.TestCase.runTest(TestCase.java:166) [junit] at junit.framework.TestCase.runBare(TestCase.java:140) [junit] at junit.framework.TestResult$1.protect(TestResult.java:106) [junit] at junit.framework.TestResult.runProtected(TestResult.java:124) [junit] at junit.framework.TestResult.run(TestResult.java:109) [junit] at junit.framework.TestCase.run(TestCase.java:131) [junit] at junit.framework.TestSuite.runTest(TestSuite.java:173) [junit] F [junit] Time: 10.705 [junit] There were 4 failures: [junit] 1) testCollectionRetrieval(test.ojb.broker.BrokerExamples)junit.fram ework.AssertionFailedError [junit] at test.ojb.broker.BrokerExamples.testCollectionRetrieval(Broker Examples.java:128) [junit] at junit.framework.TestSuite.run(TestSuite.java:168) [junit] at junit.textui.TestRunner.doRun(TestRunner.java:74) [junit] at junit.textui.TestRunner.start(TestRunner.java:234) [junit] 2) testModifications(test.ojb.broker.BrokerExamples)junit.framework .AssertionFailedError [junit] at junit.textui.TestRunner.main(TestRunner.java:112) [junit] at test.ojb.broker.BrokerExamples.testModifications(BrokerExampl es.java:159) [junit] 3) testObjectCache(test.ojb.broker.BrokerExamples)junit.framework.As sertionFailedError [junit] at test.ojb.broker.BrokerExamples.testObjectCache(BrokerExamples .java:200) [junit] 4) testShallowAndDeepRetrieval(test.ojb.broker.BrokerExamples)junit. framework.AssertionFailedError [junit] at test.ojb.broker.BrokerExamples.testShallowAndDeepRetrieval(Br okerExamples.java:278) [junit] [junit] FAILURES!!! [junit] Tests run: 4, Failures: 4, Errors: 0 [junit] BUILD FAILED NOTICE The information contained in this electronic mail message is privileged and confidential, and is intended only for use of the addressee. If you are not the intended recipient, you are hereby notified that any disclosure, reproduction, distribution or other use of this communication is strictly prohibited. If you have received this communication in error, please notify the sender by reply transmission and delete the message without copying or disclosing it. |
From: Jakob B. <jbr...@ho...> - 2002-05-29 05:40:55
|
hi steven, i'm pleased to hear that your problems are all gone... you know, it was me who removed the call to nativeSql, because MS-Access didn't like it :-( jakob ----- Original Message ----- From: "Ebersole, Steven" <ste...@vi...> To: "'Jakob Braeuchi'" <jbr...@ho...>; <obj...@li...> Sent: Tuesday, May 28, 2002 9:45 PM Subject: RE: [ojb-users] references > Solved, was a previously known OJB "feature" > (http://sourceforge.net/forum/message.php?msg_id=1540574). Patched the OJB > source and re-built and all is fine. > > > > ******************************************** > Steve Ebersole > IT Integration Engineer > Vignette Corporation > 512.741.4195 > > Visit http://www.vignette.com > > ******************************************** > > > -----Original Message----- > From: Ebersole, Steven [mailto:ste...@vi...] > Sent: Tuesday, May 28, 2002 12:24 PM > To: 'Jakob Braeuchi'; 'obj...@li...' > Subject: RE: [ojb-users] references > > > Sorry, grabbed the .class files by accident > > Here is everything with .java instead of .class > > > > ******************************************** > Steve Ebersole > IT Integration Engineer > Vignette Corporation > 512.741.4195 > > Visit http://www.vignette.com > > ******************************************** > > > -----Original Message----- > From: Jakob Braeuchi [mailto:jbr...@ho...] > Sent: Tuesday, May 28, 2002 12:13 PM > To: Ebersole, Steven > Subject: Re: [ojb-users] references > > > hi steven, > > would you mind sending me the source-code of your classes ? > > jakob > > ----- Original Message ----- > From: "Ebersole, Steven" <ste...@vi...> > To: "'Jakob Braeuchi'" <jbr...@ho...> > Sent: Tuesday, May 28, 2002 6:12 PM > Subject: RE: [ojb-users] references > > > > Thanks for the reply... > > > > I use 0.8.375. > > > > > > As far as I can tell, there is really no difference between my mappings > and > > those of the tests aside from the fact that mine are simplier because I > have > > very few references mapped (this was only intended to be a quick product > > evaluation). > > > > I have included everything you have asked for, and in addition have added > > the four class files which are part of the drivers package which make up > the > > test cases. The class TestDataPersistorMapping succeeds (for me) while > the > > other two tests fail. TestDataPersistorMapping is the only one of the > three > > test-cases which does not include mapped references which is why the > others > > seem to fail. > > > > Thanks again... > > > > > > ******************************************** > > Steve Ebersole > > IT Integration Engineer > > Vignette Corporation > > 512.741.4195 > > > > Visit http://www.vignette.com > > > > ******************************************** > > > > > > -----Original Message----- > > From: Jakob Braeuchi [mailto:jbr...@ho...] > > Sent: Tuesday, May 28, 2002 10:35 AM > > To: Ebersole, Steven; 'Thomas Mahler'; > > obj...@li... > > Subject: Re: [ojb-users] references > > > > > > hi steven, > > > > what version of ojb do you use ? > > how does your test differ from the the testcase included in ojb ? > > > > please send me a complete test case including repository, java classes and > > the sql-scripts to setup the tables so i can have a look at it. > > > > jakob > > > > ----- Original Message ----- > > From: "Ebersole, Steven" <ste...@vi...> > > To: "'Thomas Mahler'" <tho...@ho...>; > > <obj...@li...> > > Sent: Tuesday, May 28, 2002 3:13 PM > > Subject: RE: [ojb-users] references > > > > > > > Trying not to sound pushy here, but as I mentioned in my first post I am > > > considering moving from Castor over to OJB for the project on which I am > > > currently working. However, I am unable to get even simple reference > > > relationships working. Obviously I can't move the project over to this > > > library if this is going to be the case. But it seems others are > getting > > > this to work. > > > > > > So I guess my question is now, should I even continue evaluating OJB? I > > > mean it has been almost a month since my original post, and I am still > no > > > closer to solving the issue and not a single person has been willing (or > > > knowledgeable enough) to help. I know this is open source and as such: > 1) > > I > > > could simply debug the library myself; 2) people contribute and help > > others > > > as their time allows. As for one, I am in the middle of a project > myself > > > and unfortunately cannot validate the time to spend troubleshooting a > > > proposed library which may not even be used. As for two, I understand > the > > > time constraints of others, but to wait one month for for a response on > > such > > > a basic O/R-mapping requirement as relationships? > > > > > > Also, as I have previously mentioned, the set-up and the implementation > of > > > this library are extremely promising (especially in the environment in > > which > > > I was hoping to use it). In short I want to use this product. However, > I > > > cannot swap out Castor to OJB at this time because I do not feel > confident > > > enough in OJB's capibilities mainly because every test I have tried to > run > > > (above and beyond strict table-to-object) fails. > > > > > > Please, please can anyone help with the below problem? Anyone > encountered > > > it before? > > > > > > Thanks in advance > > > > > > > > > > > > ******************************************** > > > Steve Ebersole > > > IT Integration Engineer > > > Vignette Corporation > > > 512.741.4195 > > > > > > Visit http://www.vignette.com > > > > > > ******************************************** > > > > > > > > > -----Original Message----- > > > From: Ebersole, Steven [mailto:ste...@vi...] > > > Sent: Monday, May 20, 2002 7:47 AM > > > To: 'Thomas Mahler'; obj...@li... > > > Subject: RE: [ojb-users] references > > > > > > > > > Any ideas? > > > > > > > > > ******************************************** > > > Steve Ebersole > > > IT Integration Engineer > > > Vignette Corporation > > > 512.741.4195 > > > > > > Visit http://www.vignette.com > > > > > > ******************************************** > > > > > > > > > -----Original Message----- > > > From: Ebersole, Steven [mailto:ste...@vi...] > > > Sent: Wednesday, May 08, 2002 7:09 AM > > > To: 'Thomas Mahler'; obj...@li... > > > Subject: RE: [ojb-users] references > > > > > > > > > Below is the exception I get. I appears that the exception occurs when > > > trying to resolve the reference to parent company when that fk column is > > > null. If I remove that reference descriptor, everything works. > > > > > > Query from class com.vignette.it.apps.dbapi.domain.CompanyDO where > > comp_id= > > > ? > > > [DEFAULT] WARN: Please define a public constructor for class > > > com.vignette.it.apps.dbapi.domain.CompanyDO > > > with the following signature: (java.lang.Integer, java.lang.String, > > > java.lang.Integer). > > > It must initialize the classes persistent attributes. This is > recommended > > to > > > increase performance but it's not mandatory! > > > [ojb.broker.singlevm.PersistenceBrokerImpl] ERROR: expected type: class > > > com.vignette.it.apps.dbapi.domain.CompanyDO > > > [ojb.broker.accesslayer.RsIterator] ERROR: null > > > java.lang.ArrayIndexOutOfBoundsException > > > at > > > > > > ojb.broker.metadata.ClassDescriptor.getFieldDescriptorByIndex(ClassDescripto > > > r.java:263) > > > at > > > > > > ojb.broker.metadata.ObjectReferenceDescriptor.getForeignKeyFieldDescriptors( > > > ObjectReferenceDescriptor.java:242) > > > at > > > > > > ojb.broker.metadata.ObjectReferenceDescriptor.getForeignKeyValues(ObjectRefe > > > renceDescriptor.java:264) > > > at > > > > > > ojb.broker.singlevm.PersistenceBrokerImpl.getReferencedObject(PersistenceBro > > > kerImpl.java:700) > > > at > > > > > > ojb.broker.singlevm.PersistenceBrokerImpl.retrieveReferences(PersistenceBrok > > > erImpl.java:517) > > > at > > > > > > ojb.broker.accesslayer.RsIterator.getObjectFromResultSet(RsIterator.java:263 > > > ) > > > at ojb.broker.accesslayer.RsIterator.next(RsIterator.java:145) > > > at > > > > > > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > > > okerImpl.java:900) > > > at > > > > > > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > > > okerImpl.java:966) > > > at > > > > > > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > > > okerImpl.java:1054) > > > at > > > > > > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > > > okerImpl.java:1041) > > > at TestOJBInstall.execute(TestOJBInstall.java:66) > > > at TestOJBInstall.main(TestOJBInstall.java:53) > > > java.util.NoSuchElementException > > > at ojb.broker.accesslayer.RsIterator.next(RsIterator.java:154) > > > at > > > > > > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > > > okerImpl.java:900) > > > at > > > > > > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > > > okerImpl.java:966) > > > at > > > > > > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > > > okerImpl.java:1054) > > > at > > > > > > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > > > okerImpl.java:1041) > > > at TestOJBInstall.execute(TestOJBInstall.java:66) > > > at TestOJBInstall.main(TestOJBIError occurred : > > > java.util.NoSuchElementException > > > nstall.java:53) > > > > > > > > > > > > > > > > > > ******************************************** > > > Steve Ebersole > > > IT Integration Engineer > > > Vignette Corporation > > > 512.741.4195 > > > > > > Visit http://www.vignette.com > > > > > > ******************************************** > > > > > > > > > -----Original Message----- > > > From: Thomas Mahler [mailto:tho...@ho...] > > > Sent: Friday, May 03, 2002 12:11 AM > > > To: Ebersole, Steven > > > Subject: Re: [ojb-users] references > > > > > > > > > Hi Steven, > > > > > > Ebersole, Steven wrote: > > > > > > > I am looking at switching from Castor over to OJB as it looks really > > > > promising in terms of its functionality (I especially love the use of > > > > virtual proxies here). I did have two questions come up from my > initial > > > > trials of OJB. > > > > > > > > 1) Is it necessary to have both the foreign key and the foreign > > reference > > > > mapped and present on the object? > > > > > > > > > depends on the navigibility between your persistent classes. > > > If you want to navigate from the 1-side to the n-side only, you just > > > need a foreign key (and a ForeignKeyDescriptor). > > > > > > If you want navigation from the n-side to the 1-side too, you'll also > > > need a reference attribute (and a ReferenceDecsriptor too). > > > > > > In the examples, the relation between > > > > Article and ProductGroup is the example From which I was working. > > There, > > > > Article has two attributes dealing with its relation to a > ProductGroup, > > > > > > > > > Yes, because we have navigation from ProductGroup to all its Articles > > > and from an Article to its associated ProductGroup. > > > > > > > > > > productGroupId (which is the DB fk field) and productGroup (which is > an > > > > instance of the ProductGroup object to which productGroupId referes). > > Is > > > it > > > > necessary to do this, or is there a way to have the Product object > only > > > know > > > > about its related ProductGroup? > > > > > > > > > No, because ProductGroup and Article have a 1:n relation the table > > > representaing Article entities *must* have a foreign key to identify the > > > associated ProductGroup. > > > > > > > > > > > > > > 2) I mapped a relationship, uing my classes, similiar to the above > > > > relationship (it is a company -> parent company relationship). > However, > > I > > > > get exceptions if a particular company did not have a parent company > > (its > > > > PRTN_COMP_ID column on the DB is NULL). Is there something additional > I > > > > have to set up in the mapping to define that side of the relationship > as > > > > optional? Below is the mapping I have for this: > > > > > > > > > > > > <ClassDescriptor id="2"> > > > > > > > <class.name>com.vignette.it.apps.dbapi.domain.CompanyDO</class.name> > > > > <table.name>COMPANY</table.name> > > > > <FieldDescriptor id="1"> > > > > <field.name>id</field.name> > > > > <column.name>COMP_ID</column.name> > > > > <jdbc_type>INTEGER</jdbc_type> > > > > <PrimaryKey>true</PrimaryKey> > > > > </FieldDescriptor> > > > > ... > > > > <FieldDescriptor id="5"> > > > > <field.name>parentCompanyId</field.name> > > > > <column.name>PRNT_COMP_ID</column.name> > > > > <jdbc_type>INTEGER</jdbc_type> > > > > </FieldDescriptor> > > > > <ReferenceDescriptor id="1"> > > > > <rdfield.name>parentCompany</rdfield.name> > > > > > > > > > > > > > > <referenced.class>com.vignette.it.apps.dbapi.domain.CompanyDO</referenced.cl > > > > ass> > > > > <fk_descriptor_ids>5</fk_descriptor_ids> > > > > </ReferenceDescriptor> > > > > </ClassDescriptor> > > > > > > > > > > > > > Your mapping seems OK. This must be an OJB bug! Can you provide me with > > > a full stacktrace ? > > > > > > thanks, > > > > > > Thomas > > > > > > > > > > > > > > Thanks > > > > > > > > > > > > > > > > > > > > ******************************************** > > > > Steve Ebersole > > > > IT Integration Engineer > > > > Vignette Corporation > > > > 512.741.4195 > > > > > > > > Visit http://www.vignette.com > > > > > > > > ******************************************** > > > > > > > > _______________________________________________________________ > > > > > > > > Have big pipes? SourceForge.net is looking for download mirrors. We > > supply > > > > the hardware. You get the recognition. Email Us: > > ban...@so... > > > > _______________________________________________ > > > > Objectbridge-users mailing list > > > > Obj...@li... > > > > https://lists.sourceforge.net/lists/listinfo/objectbridge-users > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________________________ > > > > > > Have big pipes? SourceForge.net is looking for download mirrors. We > supply > > > the hardware. You get the recognition. Email Us: > ban...@so... > > > _______________________________________________ > > > Objectbridge-users mailing list > > > Obj...@li... > > > https://lists.sourceforge.net/lists/listinfo/objectbridge-users > > > > > > _______________________________________________________________ > > > Hundreds of nodes, one monster rendering program. > > > Now that's a super model! Visit http://clustering.foundries.sf.net/ > > > > > > _______________________________________________ > > > Objectbridge-users mailing list > > > Obj...@li... > > > https://lists.sourceforge.net/lists/listinfo/objectbridge-users > > > > > > _______________________________________________________________ > > > > > > Don't miss the 2002 Sprint PCS Application Developer's Conference > > > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > > > > > _______________________________________________ > > > Objectbridge-users mailing list > > > Obj...@li... > > > https://lists.sourceforge.net/lists/listinfo/objectbridge-users > > > > > > > > > |
From: Thomas M. <tho...@ho...> - 2002-05-28 20:14:51
|
Hi Gonvindarajan, This is simple to fix: To use the OJB sequence numbering you'll need: 1. The OJB internal table and OJB_HL_SEQ must be in your target database. 2. ClassDescriptors for class ojb.broker.util.sequence.HighLowSequence must be declared in your repository. in the OJB distribution this descriptor resides in the file repository_internal.xml Just have a look at the repository.xml file how to include this file with internal mappings into your own repository file. hth, Thomas Govindarajan S (Gover) wrote: > HI, > I tried out the examples from tutorial1. When i set the autoincrement to > true in the repository.xml i get an exception like the one below, i used the > ojb.properties file that shipped along with the installable. > > what am i missing here? > > gover > > D:\OjbTest\UserDetails\src>java com.ojb.userdetails.UserDetailsClient > [BOOT] INFO: OJB.properties: file:/D:/OjbTest/UserDetails/src/OJB.properties > [ojb.broker.ta.ConfigurationProperties] INFO: > ojb.broker.ta.ConfigurationPropert > ies read OJB.properties > [ojb.broker.ta.ConfigurationProperties] INFO: OJB.properties: > file:/D:/OjbTest/U > serDetails/src/OJB.properties > [BOOT] INFO: OJB.properties: file:/D:/OjbTest/UserDetails/src/OJB.properties > [ojb.broker.ta.PersistenceBrokerFactoryFactory] INFO: Implementation of > Persiste > ncebrokerFactory: ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl > [DEFAULT] ERROR: ojb.broker.util.sequence.HighLowSequence not found in OJB > Repos > itory > ojb.broker.util.sequence.HighLowSequence not found in OJB Repository > at > ojb.broker.metadata.DescriptorRepository.getDescriptorFor(DescriptorR > epository.java:147) > at > ojb.broker.singlevm.PersistenceBrokerImpl.getClassDescriptor(Persiste > nceBrokerImpl.java:1445) > at ojb.broker.Identity.<init>(Identity.java:108) > at > ojb.broker.singlevm.PersistenceBrokerImpl.getObjectByExample(Persiste > nceBrokerImpl.java:1161) > at > ojb.broker.singlevm.PersistenceBrokerImpl.getObjectByQuery(Persistenc > eBrokerImpl.java:1206) > at > ojb.broker.util.sequence.SequenceManagerHighLowImpl.getUniqueId(Seque > nceManagerHighLowImpl.java:84) > at > ojb.broker.singlevm.PersistenceBrokerImpl.getUniqueId(PersistenceBrok > erImpl.java:1407) > at > ojb.broker.metadata.ClassDescriptor.getAutoIncrementValue(ClassDescri > ptor.java:750) > at > ojb.broker.metadata.ClassDescriptor.getKeyValues(ClassDescriptor.java > :639) > at ojb.broker.Identity.<init>(Identity.java:111) > at > ojb.broker.singlevm.PersistenceBrokerImpl.store(PersistenceBrokerImpl > .java:307) > at > com.ojb.userdetails.UserDetailsClient.addUserDetails(UserDetailsClien > t.java:56) > at > com.ojb.userdetails.UserDetailsClient.main(UserDetailsClient.java:40) > > [DEFAULT] ERROR: OJB ERROR: Dont know how to autoincrement field class > com.ojb.u > serdetails.UserDetails._id > java.lang.RuntimeException: OJB ERROR: Dont know how to autoincrement field > clas > s com.ojb.userdetails.UserDetails._id > at > ojb.broker.metadata.ClassDescriptor.getAutoIncrementValue(ClassDescri > ptor.java:809) > at > ojb.broker.metadata.ClassDescriptor.getKeyValues(ClassDescriptor.java > :639) > at ojb.broker.Identity.<init>(Identity.java:111) > at > ojb.broker.singlevm.PersistenceBrokerImpl.store(PersistenceBrokerImpl > .java:307) > at > com.ojb.userdetails.UserDetailsClient.addUserDetails(UserDetailsClien > t.java:56) > at > com.ojb.userdetails.UserDetailsClient.main(UserDetailsClient.java:40) > > [DEFAULT] ERROR: OJB ERROR: Dont know how to autoincrement field class > com.ojb.u > serdetails.UserDetails._id > OJB ERROR: Dont know how to autoincrement field class > com.ojb.userdetails.UserDe > tails._id > at > ojb.broker.metadata.ClassDescriptor.getKeyValues(ClassDescriptor.java > :645) > at ojb.broker.Identity.<init>(Identity.java:111) > at > ojb.broker.singlevm.PersistenceBrokerImpl.store(PersistenceBrokerImpl > .java:307) > at > com.ojb.userdetails.UserDetailsClient.addUserDetails(UserDetailsClien > t.java:56) > at > com.ojb.userdetails.UserDetailsClient.main(UserDetailsClient.java:40) > > ----- Persistence Broker Exp ------ > OJB ERROR: Dont know how to autoincrement field class > com.ojb.userdetails.UserDe > tails._id > at ojb.broker.Identity.<init>(Identity.java:119) > at > ojb.broker.singlevm.PersistenceBrokerImpl.store(PersistenceBrokerImpl > .java:307) > at > com.ojb.userdetails.UserDetailsClient.addUserDetails(UserDetailsClien > t.java:56) > at > com.ojb.userdetails.UserDetailsClient.main(UserDetailsClient.java:40) > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Objectbridge-users mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-users > > > > |
From: Ebersole, S. <ste...@vi...> - 2002-05-28 19:46:18
|
Solved, was a previously known OJB "feature" (http://sourceforge.net/forum/message.php?msg_id=1540574). Patched the OJB source and re-built and all is fine. ******************************************** Steve Ebersole IT Integration Engineer Vignette Corporation 512.741.4195 Visit http://www.vignette.com ******************************************** -----Original Message----- From: Ebersole, Steven [mailto:ste...@vi...] Sent: Tuesday, May 28, 2002 12:24 PM To: 'Jakob Braeuchi'; 'obj...@li...' Subject: RE: [ojb-users] references Sorry, grabbed the .class files by accident Here is everything with .java instead of .class ******************************************** Steve Ebersole IT Integration Engineer Vignette Corporation 512.741.4195 Visit http://www.vignette.com ******************************************** -----Original Message----- From: Jakob Braeuchi [mailto:jbr...@ho...] Sent: Tuesday, May 28, 2002 12:13 PM To: Ebersole, Steven Subject: Re: [ojb-users] references hi steven, would you mind sending me the source-code of your classes ? jakob ----- Original Message ----- From: "Ebersole, Steven" <ste...@vi...> To: "'Jakob Braeuchi'" <jbr...@ho...> Sent: Tuesday, May 28, 2002 6:12 PM Subject: RE: [ojb-users] references > Thanks for the reply... > > I use 0.8.375. > > > As far as I can tell, there is really no difference between my mappings and > those of the tests aside from the fact that mine are simplier because I have > very few references mapped (this was only intended to be a quick product > evaluation). > > I have included everything you have asked for, and in addition have added > the four class files which are part of the drivers package which make up the > test cases. The class TestDataPersistorMapping succeeds (for me) while the > other two tests fail. TestDataPersistorMapping is the only one of the three > test-cases which does not include mapped references which is why the others > seem to fail. > > Thanks again... > > > ******************************************** > Steve Ebersole > IT Integration Engineer > Vignette Corporation > 512.741.4195 > > Visit http://www.vignette.com > > ******************************************** > > > -----Original Message----- > From: Jakob Braeuchi [mailto:jbr...@ho...] > Sent: Tuesday, May 28, 2002 10:35 AM > To: Ebersole, Steven; 'Thomas Mahler'; > obj...@li... > Subject: Re: [ojb-users] references > > > hi steven, > > what version of ojb do you use ? > how does your test differ from the the testcase included in ojb ? > > please send me a complete test case including repository, java classes and > the sql-scripts to setup the tables so i can have a look at it. > > jakob > > ----- Original Message ----- > From: "Ebersole, Steven" <ste...@vi...> > To: "'Thomas Mahler'" <tho...@ho...>; > <obj...@li...> > Sent: Tuesday, May 28, 2002 3:13 PM > Subject: RE: [ojb-users] references > > > > Trying not to sound pushy here, but as I mentioned in my first post I am > > considering moving from Castor over to OJB for the project on which I am > > currently working. However, I am unable to get even simple reference > > relationships working. Obviously I can't move the project over to this > > library if this is going to be the case. But it seems others are getting > > this to work. > > > > So I guess my question is now, should I even continue evaluating OJB? I > > mean it has been almost a month since my original post, and I am still no > > closer to solving the issue and not a single person has been willing (or > > knowledgeable enough) to help. I know this is open source and as such: 1) > I > > could simply debug the library myself; 2) people contribute and help > others > > as their time allows. As for one, I am in the middle of a project myself > > and unfortunately cannot validate the time to spend troubleshooting a > > proposed library which may not even be used. As for two, I understand the > > time constraints of others, but to wait one month for for a response on > such > > a basic O/R-mapping requirement as relationships? > > > > Also, as I have previously mentioned, the set-up and the implementation of > > this library are extremely promising (especially in the environment in > which > > I was hoping to use it). In short I want to use this product. However, I > > cannot swap out Castor to OJB at this time because I do not feel confident > > enough in OJB's capibilities mainly because every test I have tried to run > > (above and beyond strict table-to-object) fails. > > > > Please, please can anyone help with the below problem? Anyone encountered > > it before? > > > > Thanks in advance > > > > > > > > ******************************************** > > Steve Ebersole > > IT Integration Engineer > > Vignette Corporation > > 512.741.4195 > > > > Visit http://www.vignette.com > > > > ******************************************** > > > > > > -----Original Message----- > > From: Ebersole, Steven [mailto:ste...@vi...] > > Sent: Monday, May 20, 2002 7:47 AM > > To: 'Thomas Mahler'; obj...@li... > > Subject: RE: [ojb-users] references > > > > > > Any ideas? > > > > > > ******************************************** > > Steve Ebersole > > IT Integration Engineer > > Vignette Corporation > > 512.741.4195 > > > > Visit http://www.vignette.com > > > > ******************************************** > > > > > > -----Original Message----- > > From: Ebersole, Steven [mailto:ste...@vi...] > > Sent: Wednesday, May 08, 2002 7:09 AM > > To: 'Thomas Mahler'; obj...@li... > > Subject: RE: [ojb-users] references > > > > > > Below is the exception I get. I appears that the exception occurs when > > trying to resolve the reference to parent company when that fk column is > > null. If I remove that reference descriptor, everything works. > > > > Query from class com.vignette.it.apps.dbapi.domain.CompanyDO where > comp_id= > > ? > > [DEFAULT] WARN: Please define a public constructor for class > > com.vignette.it.apps.dbapi.domain.CompanyDO > > with the following signature: (java.lang.Integer, java.lang.String, > > java.lang.Integer). > > It must initialize the classes persistent attributes. This is recommended > to > > increase performance but it's not mandatory! > > [ojb.broker.singlevm.PersistenceBrokerImpl] ERROR: expected type: class > > com.vignette.it.apps.dbapi.domain.CompanyDO > > [ojb.broker.accesslayer.RsIterator] ERROR: null > > java.lang.ArrayIndexOutOfBoundsException > > at > > > ojb.broker.metadata.ClassDescriptor.getFieldDescriptorByIndex(ClassDescripto > > r.java:263) > > at > > > ojb.broker.metadata.ObjectReferenceDescriptor.getForeignKeyFieldDescriptors( > > ObjectReferenceDescriptor.java:242) > > at > > > ojb.broker.metadata.ObjectReferenceDescriptor.getForeignKeyValues(ObjectRefe > > renceDescriptor.java:264) > > at > > > ojb.broker.singlevm.PersistenceBrokerImpl.getReferencedObject(PersistenceBro > > kerImpl.java:700) > > at > > > ojb.broker.singlevm.PersistenceBrokerImpl.retrieveReferences(PersistenceBrok > > erImpl.java:517) > > at > > > ojb.broker.accesslayer.RsIterator.getObjectFromResultSet(RsIterator.java:263 > > ) > > at ojb.broker.accesslayer.RsIterator.next(RsIterator.java:145) > > at > > > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > > okerImpl.java:900) > > at > > > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > > okerImpl.java:966) > > at > > > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > > okerImpl.java:1054) > > at > > > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > > okerImpl.java:1041) > > at TestOJBInstall.execute(TestOJBInstall.java:66) > > at TestOJBInstall.main(TestOJBInstall.java:53) > > java.util.NoSuchElementException > > at ojb.broker.accesslayer.RsIterator.next(RsIterator.java:154) > > at > > > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > > okerImpl.java:900) > > at > > > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > > okerImpl.java:966) > > at > > > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > > okerImpl.java:1054) > > at > > > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > > okerImpl.java:1041) > > at TestOJBInstall.execute(TestOJBInstall.java:66) > > at TestOJBInstall.main(TestOJBIError occurred : > > java.util.NoSuchElementException > > nstall.java:53) > > > > > > > > > > > > ******************************************** > > Steve Ebersole > > IT Integration Engineer > > Vignette Corporation > > 512.741.4195 > > > > Visit http://www.vignette.com > > > > ******************************************** > > > > > > -----Original Message----- > > From: Thomas Mahler [mailto:tho...@ho...] > > Sent: Friday, May 03, 2002 12:11 AM > > To: Ebersole, Steven > > Subject: Re: [ojb-users] references > > > > > > Hi Steven, > > > > Ebersole, Steven wrote: > > > > > I am looking at switching from Castor over to OJB as it looks really > > > promising in terms of its functionality (I especially love the use of > > > virtual proxies here). I did have two questions come up from my initial > > > trials of OJB. > > > > > > 1) Is it necessary to have both the foreign key and the foreign > reference > > > mapped and present on the object? > > > > > > depends on the navigibility between your persistent classes. > > If you want to navigate from the 1-side to the n-side only, you just > > need a foreign key (and a ForeignKeyDescriptor). > > > > If you want navigation from the n-side to the 1-side too, you'll also > > need a reference attribute (and a ReferenceDecsriptor too). > > > > In the examples, the relation between > > > Article and ProductGroup is the example From which I was working. > There, > > > Article has two attributes dealing with its relation to a ProductGroup, > > > > > > Yes, because we have navigation from ProductGroup to all its Articles > > and from an Article to its associated ProductGroup. > > > > > > > productGroupId (which is the DB fk field) and productGroup (which is an > > > instance of the ProductGroup object to which productGroupId referes). > Is > > it > > > necessary to do this, or is there a way to have the Product object only > > know > > > about its related ProductGroup? > > > > > > No, because ProductGroup and Article have a 1:n relation the table > > representaing Article entities *must* have a foreign key to identify the > > associated ProductGroup. > > > > > > > > > > 2) I mapped a relationship, uing my classes, similiar to the above > > > relationship (it is a company -> parent company relationship). However, > I > > > get exceptions if a particular company did not have a parent company > (its > > > PRTN_COMP_ID column on the DB is NULL). Is there something additional I > > > have to set up in the mapping to define that side of the relationship as > > > optional? Below is the mapping I have for this: > > > > > > > > > <ClassDescriptor id="2"> > > > > > <class.name>com.vignette.it.apps.dbapi.domain.CompanyDO</class.name> > > > <table.name>COMPANY</table.name> > > > <FieldDescriptor id="1"> > > > <field.name>id</field.name> > > > <column.name>COMP_ID</column.name> > > > <jdbc_type>INTEGER</jdbc_type> > > > <PrimaryKey>true</PrimaryKey> > > > </FieldDescriptor> > > > ... > > > <FieldDescriptor id="5"> > > > <field.name>parentCompanyId</field.name> > > > <column.name>PRNT_COMP_ID</column.name> > > > <jdbc_type>INTEGER</jdbc_type> > > > </FieldDescriptor> > > > <ReferenceDescriptor id="1"> > > > <rdfield.name>parentCompany</rdfield.name> > > > > > > > > > <referenced.class>com.vignette.it.apps.dbapi.domain.CompanyDO</referenced.cl > > > ass> > > > <fk_descriptor_ids>5</fk_descriptor_ids> > > > </ReferenceDescriptor> > > > </ClassDescriptor> > > > > > > > > > Your mapping seems OK. This must be an OJB bug! Can you provide me with > > a full stacktrace ? > > > > thanks, > > > > Thomas > > > > > > > > > > Thanks > > > > > > > > > > > > > > > ******************************************** > > > Steve Ebersole > > > IT Integration Engineer > > > Vignette Corporation > > > 512.741.4195 > > > > > > Visit http://www.vignette.com > > > > > > ******************************************** > > > > > > _______________________________________________________________ > > > > > > Have big pipes? SourceForge.net is looking for download mirrors. We > supply > > > the hardware. You get the recognition. Email Us: > ban...@so... > > > _______________________________________________ > > > Objectbridge-users mailing list > > > Obj...@li... > > > https://lists.sourceforge.net/lists/listinfo/objectbridge-users > > > > > > > > > > > > > > > > > > _______________________________________________________________ > > > > Have big pipes? SourceForge.net is looking for download mirrors. We supply > > the hardware. You get the recognition. Email Us: ban...@so... > > _______________________________________________ > > Objectbridge-users mailing list > > Obj...@li... > > https://lists.sourceforge.net/lists/listinfo/objectbridge-users > > > > _______________________________________________________________ > > Hundreds of nodes, one monster rendering program. > > Now that's a super model! Visit http://clustering.foundries.sf.net/ > > > > _______________________________________________ > > Objectbridge-users mailing list > > Obj...@li... > > https://lists.sourceforge.net/lists/listinfo/objectbridge-users > > > > _______________________________________________________________ > > > > Don't miss the 2002 Sprint PCS Application Developer's Conference > > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > > > _______________________________________________ > > Objectbridge-users mailing list > > Obj...@li... > > https://lists.sourceforge.net/lists/listinfo/objectbridge-users > > > > |
From: Jason M. <mc...@na...> - 2002-05-28 18:14:15
|
This puppy rocks! You've got us addicted. I'm gonna try to make this pretty much a standard tool for all non EJB J2EE projects (which hopefully will be all projects because I'm beginning to just hate entity beans). I think I'm supposed to give a colloquium talk at the College of Engineering and CS at Oregon State University in the near future, and I may make this tool a big part of it. Thanks for the great tool you guys! Jason McKerr, and the other java monkeys at the Northwest Alliance for Computational Science and Engineering. |
From: Ebersole, S. <ste...@vi...> - 2002-05-28 17:25:54
|
Sorry, grabbed the .class files by accident Here is everything with .java instead of .class ******************************************** Steve Ebersole IT Integration Engineer Vignette Corporation 512.741.4195 Visit http://www.vignette.com ******************************************** -----Original Message----- From: Jakob Braeuchi [mailto:jbr...@ho...] Sent: Tuesday, May 28, 2002 12:13 PM To: Ebersole, Steven Subject: Re: [ojb-users] references hi steven, would you mind sending me the source-code of your classes ? jakob ----- Original Message ----- From: "Ebersole, Steven" <ste...@vi...> To: "'Jakob Braeuchi'" <jbr...@ho...> Sent: Tuesday, May 28, 2002 6:12 PM Subject: RE: [ojb-users] references > Thanks for the reply... > > I use 0.8.375. > > > As far as I can tell, there is really no difference between my mappings and > those of the tests aside from the fact that mine are simplier because I have > very few references mapped (this was only intended to be a quick product > evaluation). > > I have included everything you have asked for, and in addition have added > the four class files which are part of the drivers package which make up the > test cases. The class TestDataPersistorMapping succeeds (for me) while the > other two tests fail. TestDataPersistorMapping is the only one of the three > test-cases which does not include mapped references which is why the others > seem to fail. > > Thanks again... > > > ******************************************** > Steve Ebersole > IT Integration Engineer > Vignette Corporation > 512.741.4195 > > Visit http://www.vignette.com > > ******************************************** > > > -----Original Message----- > From: Jakob Braeuchi [mailto:jbr...@ho...] > Sent: Tuesday, May 28, 2002 10:35 AM > To: Ebersole, Steven; 'Thomas Mahler'; > obj...@li... > Subject: Re: [ojb-users] references > > > hi steven, > > what version of ojb do you use ? > how does your test differ from the the testcase included in ojb ? > > please send me a complete test case including repository, java classes and > the sql-scripts to setup the tables so i can have a look at it. > > jakob > > ----- Original Message ----- > From: "Ebersole, Steven" <ste...@vi...> > To: "'Thomas Mahler'" <tho...@ho...>; > <obj...@li...> > Sent: Tuesday, May 28, 2002 3:13 PM > Subject: RE: [ojb-users] references > > > > Trying not to sound pushy here, but as I mentioned in my first post I am > > considering moving from Castor over to OJB for the project on which I am > > currently working. However, I am unable to get even simple reference > > relationships working. Obviously I can't move the project over to this > > library if this is going to be the case. But it seems others are getting > > this to work. > > > > So I guess my question is now, should I even continue evaluating OJB? I > > mean it has been almost a month since my original post, and I am still no > > closer to solving the issue and not a single person has been willing (or > > knowledgeable enough) to help. I know this is open source and as such: 1) > I > > could simply debug the library myself; 2) people contribute and help > others > > as their time allows. As for one, I am in the middle of a project myself > > and unfortunately cannot validate the time to spend troubleshooting a > > proposed library which may not even be used. As for two, I understand the > > time constraints of others, but to wait one month for for a response on > such > > a basic O/R-mapping requirement as relationships? > > > > Also, as I have previously mentioned, the set-up and the implementation of > > this library are extremely promising (especially in the environment in > which > > I was hoping to use it). In short I want to use this product. However, I > > cannot swap out Castor to OJB at this time because I do not feel confident > > enough in OJB's capibilities mainly because every test I have tried to run > > (above and beyond strict table-to-object) fails. > > > > Please, please can anyone help with the below problem? Anyone encountered > > it before? > > > > Thanks in advance > > > > > > > > ******************************************** > > Steve Ebersole > > IT Integration Engineer > > Vignette Corporation > > 512.741.4195 > > > > Visit http://www.vignette.com > > > > ******************************************** > > > > > > -----Original Message----- > > From: Ebersole, Steven [mailto:ste...@vi...] > > Sent: Monday, May 20, 2002 7:47 AM > > To: 'Thomas Mahler'; obj...@li... > > Subject: RE: [ojb-users] references > > > > > > Any ideas? > > > > > > ******************************************** > > Steve Ebersole > > IT Integration Engineer > > Vignette Corporation > > 512.741.4195 > > > > Visit http://www.vignette.com > > > > ******************************************** > > > > > > -----Original Message----- > > From: Ebersole, Steven [mailto:ste...@vi...] > > Sent: Wednesday, May 08, 2002 7:09 AM > > To: 'Thomas Mahler'; obj...@li... > > Subject: RE: [ojb-users] references > > > > > > Below is the exception I get. I appears that the exception occurs when > > trying to resolve the reference to parent company when that fk column is > > null. If I remove that reference descriptor, everything works. > > > > Query from class com.vignette.it.apps.dbapi.domain.CompanyDO where > comp_id= > > ? > > [DEFAULT] WARN: Please define a public constructor for class > > com.vignette.it.apps.dbapi.domain.CompanyDO > > with the following signature: (java.lang.Integer, java.lang.String, > > java.lang.Integer). > > It must initialize the classes persistent attributes. This is recommended > to > > increase performance but it's not mandatory! > > [ojb.broker.singlevm.PersistenceBrokerImpl] ERROR: expected type: class > > com.vignette.it.apps.dbapi.domain.CompanyDO > > [ojb.broker.accesslayer.RsIterator] ERROR: null > > java.lang.ArrayIndexOutOfBoundsException > > at > > > ojb.broker.metadata.ClassDescriptor.getFieldDescriptorByIndex(ClassDescripto > > r.java:263) > > at > > > ojb.broker.metadata.ObjectReferenceDescriptor.getForeignKeyFieldDescriptors( > > ObjectReferenceDescriptor.java:242) > > at > > > ojb.broker.metadata.ObjectReferenceDescriptor.getForeignKeyValues(ObjectRefe > > renceDescriptor.java:264) > > at > > > ojb.broker.singlevm.PersistenceBrokerImpl.getReferencedObject(PersistenceBro > > kerImpl.java:700) > > at > > > ojb.broker.singlevm.PersistenceBrokerImpl.retrieveReferences(PersistenceBrok > > erImpl.java:517) > > at > > > ojb.broker.accesslayer.RsIterator.getObjectFromResultSet(RsIterator.java:263 > > ) > > at ojb.broker.accesslayer.RsIterator.next(RsIterator.java:145) > > at > > > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > > okerImpl.java:900) > > at > > > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > > okerImpl.java:966) > > at > > > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > > okerImpl.java:1054) > > at > > > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > > okerImpl.java:1041) > > at TestOJBInstall.execute(TestOJBInstall.java:66) > > at TestOJBInstall.main(TestOJBInstall.java:53) > > java.util.NoSuchElementException > > at ojb.broker.accesslayer.RsIterator.next(RsIterator.java:154) > > at > > > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > > okerImpl.java:900) > > at > > > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > > okerImpl.java:966) > > at > > > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > > okerImpl.java:1054) > > at > > > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > > okerImpl.java:1041) > > at TestOJBInstall.execute(TestOJBInstall.java:66) > > at TestOJBInstall.main(TestOJBIError occurred : > > java.util.NoSuchElementException > > nstall.java:53) > > > > > > > > > > > > ******************************************** > > Steve Ebersole > > IT Integration Engineer > > Vignette Corporation > > 512.741.4195 > > > > Visit http://www.vignette.com > > > > ******************************************** > > > > > > -----Original Message----- > > From: Thomas Mahler [mailto:tho...@ho...] > > Sent: Friday, May 03, 2002 12:11 AM > > To: Ebersole, Steven > > Subject: Re: [ojb-users] references > > > > > > Hi Steven, > > > > Ebersole, Steven wrote: > > > > > I am looking at switching from Castor over to OJB as it looks really > > > promising in terms of its functionality (I especially love the use of > > > virtual proxies here). I did have two questions come up from my initial > > > trials of OJB. > > > > > > 1) Is it necessary to have both the foreign key and the foreign > reference > > > mapped and present on the object? > > > > > > depends on the navigibility between your persistent classes. > > If you want to navigate from the 1-side to the n-side only, you just > > need a foreign key (and a ForeignKeyDescriptor). > > > > If you want navigation from the n-side to the 1-side too, you'll also > > need a reference attribute (and a ReferenceDecsriptor too). > > > > In the examples, the relation between > > > Article and ProductGroup is the example From which I was working. > There, > > > Article has two attributes dealing with its relation to a ProductGroup, > > > > > > Yes, because we have navigation from ProductGroup to all its Articles > > and from an Article to its associated ProductGroup. > > > > > > > productGroupId (which is the DB fk field) and productGroup (which is an > > > instance of the ProductGroup object to which productGroupId referes). > Is > > it > > > necessary to do this, or is there a way to have the Product object only > > know > > > about its related ProductGroup? > > > > > > No, because ProductGroup and Article have a 1:n relation the table > > representaing Article entities *must* have a foreign key to identify the > > associated ProductGroup. > > > > > > > > > > 2) I mapped a relationship, uing my classes, similiar to the above > > > relationship (it is a company -> parent company relationship). However, > I > > > get exceptions if a particular company did not have a parent company > (its > > > PRTN_COMP_ID column on the DB is NULL). Is there something additional I > > > have to set up in the mapping to define that side of the relationship as > > > optional? Below is the mapping I have for this: > > > > > > > > > <ClassDescriptor id="2"> > > > > > <class.name>com.vignette.it.apps.dbapi.domain.CompanyDO</class.name> > > > <table.name>COMPANY</table.name> > > > <FieldDescriptor id="1"> > > > <field.name>id</field.name> > > > <column.name>COMP_ID</column.name> > > > <jdbc_type>INTEGER</jdbc_type> > > > <PrimaryKey>true</PrimaryKey> > > > </FieldDescriptor> > > > ... > > > <FieldDescriptor id="5"> > > > <field.name>parentCompanyId</field.name> > > > <column.name>PRNT_COMP_ID</column.name> > > > <jdbc_type>INTEGER</jdbc_type> > > > </FieldDescriptor> > > > <ReferenceDescriptor id="1"> > > > <rdfield.name>parentCompany</rdfield.name> > > > > > > > > > <referenced.class>com.vignette.it.apps.dbapi.domain.CompanyDO</referenced.cl > > > ass> > > > <fk_descriptor_ids>5</fk_descriptor_ids> > > > </ReferenceDescriptor> > > > </ClassDescriptor> > > > > > > > > > Your mapping seems OK. This must be an OJB bug! Can you provide me with > > a full stacktrace ? > > > > thanks, > > > > Thomas > > > > > > > > > > Thanks > > > > > > > > > > > > > > > ******************************************** > > > Steve Ebersole > > > IT Integration Engineer > > > Vignette Corporation > > > 512.741.4195 > > > > > > Visit http://www.vignette.com > > > > > > ******************************************** > > > > > > _______________________________________________________________ > > > > > > Have big pipes? SourceForge.net is looking for download mirrors. We > supply > > > the hardware. You get the recognition. Email Us: > ban...@so... > > > _______________________________________________ > > > Objectbridge-users mailing list > > > Obj...@li... > > > https://lists.sourceforge.net/lists/listinfo/objectbridge-users > > > > > > > > > > > > > > > > > > _______________________________________________________________ > > > > Have big pipes? SourceForge.net is looking for download mirrors. We supply > > the hardware. You get the recognition. Email Us: ban...@so... > > _______________________________________________ > > Objectbridge-users mailing list > > Obj...@li... > > https://lists.sourceforge.net/lists/listinfo/objectbridge-users > > > > _______________________________________________________________ > > Hundreds of nodes, one monster rendering program. > > Now that's a super model! Visit http://clustering.foundries.sf.net/ > > > > _______________________________________________ > > Objectbridge-users mailing list > > Obj...@li... > > https://lists.sourceforge.net/lists/listinfo/objectbridge-users > > > > _______________________________________________________________ > > > > Don't miss the 2002 Sprint PCS Application Developer's Conference > > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > > > _______________________________________________ > > Objectbridge-users mailing list > > Obj...@li... > > https://lists.sourceforge.net/lists/listinfo/objectbridge-users > > > > |
From: Ebersole, S. <ste...@vi...> - 2002-05-28 16:38:30
|
Yes I have. In fact as you can see below in the discussion thread, Thomas already validated that the mapping looked correct to him. ******************************************** Steve Ebersole IT Integration Engineer Vignette Corporation 512.741.4195 Visit http://www.vignette.com ******************************************** -----Original Message----- From: tr...@th... [mailto:tr...@th...] Sent: Tuesday, May 28, 2002 11:28 AM To: Ebersole, Steven; obj...@li... Subject: RE: RE: [ojb-users] references Have you looked at Tutorial 3 on mappings? http://objectbridge.sourceforge.net/tutorial3.html Travis ---- Original Message ---- From: "Ebersole, Steven" <ste...@vi...> Sent: 2002-05-28 To: 'Thomas Mahler' <tho...@ho...>, obj...@li... Subject: RE: [ojb-users] references Trying not to sound pushy here, but as I mentioned in my first post I am considering moving from Castor over to OJB for the project on which I am currently working. However, I am unable to get even simple reference relationships working. Obviously I can't move the project over to this library if this is going to be the case. But it seems others are getting this to work. So I guess my question is now, should I even continue evaluating OJB? I mean it has been almost a month since my original post, and I am still no closer to solving the issue and not a single person has been willing (or knowledgeable enough) to help. I know this is open source and as such: 1) I could simply debug the library myself; 2) people contribute and help others as their time allows. As for one, I am in the middle of a project myself and unfortunately cannot validate the time to spend troubleshooting a proposed library which may not even be used. As for two, I understand the time constraints of others, but to wait one month for for a response on such a basic O/R-mapping requirement as relationships? Also, as I have previously mentioned, the set-up and the implementation of this library are extremely promising (especially in the environment in which I was hoping to use it). In short I want to use this product. However, I cannot swap out Castor to OJB at this time because I do not feel confident enough in OJB's capibilities mainly because every test I have tried to run (above and beyond strict table-to-object) fails. Please, please can anyone help with the below problem? Anyone encountered it before? Thanks in advance ******************************************** Steve Ebersole IT Integration Engineer Vignette Corporation 512.741.4195 Visit http://www.vignette.com ******************************************** -----Original Message----- From: Ebersole, Steven [mailto:ste...@vi...] Sent: Monday, May 20, 2002 7:47 AM To: 'Thomas Mahler'; obj...@li... Subject: RE: [ojb-users] references Any ideas? ******************************************** Steve Ebersole IT Integration Engineer Vignette Corporation 512.741.4195 Visit http://www.vignette.com ******************************************** -----Original Message----- From: Ebersole, Steven [mailto:ste...@vi...] Sent: Wednesday, May 08, 2002 7:09 AM To: 'Thomas Mahler'; obj...@li... Subject: RE: [ojb-users] references Below is the exception I get. I appears that the exception occurs when trying to resolve the reference to parent company when that fk column is null. If I remove that reference descriptor, everything works. Query from class com.vignette.it.apps.dbapi.domain.CompanyDO where comp_id= ? [DEFAULT] WARN: Please define a public constructor for class com.vignette.it.apps.dbapi.domain.CompanyDO with the following signature: (java.lang.Integer, java.lang.String, java.lang.Integer). It must initialize the classes persistent attributes. This is recommended to increase performance but it's not mandatory! [ojb.broker.singlevm.PersistenceBrokerImpl] ERROR: expected type: class com.vignette.it.apps.dbapi.domain.CompanyDO [ojb.broker.accesslayer.RsIterator] ERROR: null java.lang.ArrayIndexOutOfBoundsException at ojb.broker.metadata.ClassDescriptor.getFieldDescriptorByIndex(ClassDescripto r.java:263) at ojb.broker.metadata.ObjectReferenceDescriptor.getForeignKeyFieldDescriptors( ObjectReferenceDescriptor.java:242) at ojb.broker.metadata.ObjectReferenceDescriptor.getForeignKeyValues(ObjectRefe renceDescriptor.java:264) at ojb.broker.singlevm.PersistenceBrokerImpl.getReferencedObject(PersistenceBro kerImpl.java:700) at ojb.broker.singlevm.PersistenceBrokerImpl.retrieveReferences(PersistenceBrok erImpl.java:517) at ojb.broker.accesslayer.RsIterator.getObjectFromResultSet(RsIterator.java:263 ) at ojb.broker.accesslayer.RsIterator.next(RsIterator.java:145) at ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr okerImpl.java:900) at ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr okerImpl.java:966) at ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr okerImpl.java:1054) at ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr okerImpl.java:1041) at TestOJBInstall.execute(TestOJBInstall.java:66) at TestOJBInstall.main(TestOJBInstall.java:53) java.util.NoSuchElementException at ojb.broker.accesslayer.RsIterator.next(RsIterator.java:154) at ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr okerImpl.java:900) at ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr okerImpl.java:966) at ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr okerImpl.java:1054) at ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr okerImpl.java:1041) at TestOJBInstall.execute(TestOJBInstall.java:66) at TestOJBInstall.main(TestOJBIError occurred : java.util.NoSuchElementException nstall.java:53) ******************************************** Steve Ebersole IT Integration Engineer Vignette Corporation 512.741.4195 Visit http://www.vignette.com ******************************************** -----Original Message----- From: Thomas Mahler [mailto:tho...@ho...] Sent: Friday, May 03, 2002 12:11 AM To: Ebersole, Steven Subject: Re: [ojb-users] references Hi Steven, Ebersole, Steven wrote: > I am looking at switching from Castor over to OJB as it looks really > promising in terms of its functionality (I especially love the use of > virtual proxies here). I did have two questions come up from my initial > trials of OJB. > > 1) Is it necessary to have both the foreign key and the foreign reference > mapped and present on the object? depends on the navigibility between your persistent classes. If you want to navigate from the 1-side to the n-side only, you just need a foreign key (and a ForeignKeyDescriptor). If you want navigation from the n-side to the 1-side too, you'll also need a reference attribute (and a ReferenceDecsriptor too). In the examples, the relation between > Article and ProductGroup is the example From which I was working. There, > Article has two attributes dealing with its relation to a ProductGroup, Yes, because we have navigation from ProductGroup to all its Articles and from an Article to its associated ProductGroup. > productGroupId (which is the DB fk field) and productGroup (which is an > instance of the ProductGroup object to which productGroupId referes). Is it > necessary to do this, or is there a way to have the Product object only know > about its related ProductGroup? No, because ProductGroup and Article have a 1:n relation the table representaing Article entities *must* have a foreign key to identify the associated ProductGroup. > > 2) I mapped a relationship, uing my classes, similiar to the above > relationship (it is a company -> parent company relationship). However, I > get exceptions if a particular company did not have a parent company (its > PRTN_COMP_ID column on the DB is NULL). Is there something additional I > have to set up in the mapping to define that side of the relationship as > optional? Below is the mapping I have for this: > > > <ClassDescriptor id="2"> > <class.name>com.vignette.it.apps.dbapi.domain.CompanyDO</class.name> > <table.name>COMPANY</table.name> > <FieldDescriptor id="1"> > <field.name>id</field.name> > <column.name>COMP_ID</column.name> > <jdbc_type>INTEGER</jdbc_type> > <PrimaryKey>true</PrimaryKey> > </FieldDescriptor> > ... > <FieldDescriptor id="5"> > <field.name>parentCompanyId</field.name> > <column.name>PRNT_COMP_ID</column.name> > <jdbc_type>INTEGER</jdbc_type> > </FieldDescriptor> > <ReferenceDescriptor id="1"> > <rdfield.name>parentCompany</rdfield.name> > > <referenced.class>com.vignette.it.apps.dbapi.domain.CompanyDO</referenced.cl > ass> > <fk_descriptor_ids>5</fk_descriptor_ids> > </ReferenceDescriptor> > </ClassDescriptor> > Your mapping seems OK. This must be an OJB bug! Can you provide me with a full stacktrace ? thanks, Thomas > > Thanks > > > > > ******************************************** > Steve Ebersole > IT Integration Engineer > Vignette Corporation > 512.741.4195 > > Visit http://www.vignette.com > > ******************************************** > > _______________________________________________________________ > > Have big pipes? SourceForge.net is looking for download mirrors. We supply > the hardware. You get the recognition. Email Us: ban...@so... > _______________________________________________ > Objectbridge-users mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-users > > > > _______________________________________________________________ Have big pipes? SourceForge.net is looking for download mirrors. We supply the hardware. You get the recognition. Email Us: ban...@so... _______________________________________________ Objectbridge-users mailing list Obj...@li... https://lists.sourceforge.net/lists/listinfo/objectbridge-users _______________________________________________________________ Hundreds of nodes, one monster rendering program. Now that's a super model! Visit http://clustering.foundries.sf.net/ _______________________________________________ Objectbridge-users mailing list Obj...@li... https://lists.sourceforge.net/lists/listinfo/objectbridge-users _______________________________________________________________ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm _______________________________________________ Objectbridge-users mailing list Obj...@li... https://lists.sourceforge.net/lists/listinfo/objectbridge-users |
From: <tr...@th...> - 2002-05-28 16:33:39
|
Have you looked at Tutorial 3 on mappings? http://objectbridge.sourceforge.net/tutorial3.html Travis ---- Original Message ---- From: "Ebersole, Steven" <ste...@vi...> Sent: 2002-05-28 To: 'Thomas Mahler' <tho...@ho...>, obj...@li... Subject: RE: [ojb-users] references Trying not to sound pushy here, but as I mentioned in my first post I am considering moving from Castor over to OJB for the project on which I am currently working. However, I am unable to get even simple reference relationships working. Obviously I can't move the project over to this library if this is going to be the case. But it seems others are getting this to work. So I guess my question is now, should I even continue evaluating OJB? I mean it has been almost a month since my original post, and I am still no closer to solving the issue and not a single person has been willing (or knowledgeable enough) to help. I know this is open source and as such: 1) I could simply debug the library myself; 2) people contribute and help others as their time allows. As for one, I am in the middle of a project myself and unfortunately cannot validate the time to spend troubleshooting a proposed library which may not even be used. As for two, I understand the time constraints of others, but to wait one month for for a response on such a basic O/R-mapping requirement as relationships? Also, as I have previously mentioned, the set-up and the implementation of this library are extremely promising (especially in the environment in which I was hoping to use it). In short I want to use this product. However, I cannot swap out Castor to OJB at this time because I do not feel confident enough in OJB's capibilities mainly because every test I have tried to run (above and beyond strict table-to-object) fails. Please, please can anyone help with the below problem? Anyone encountered it before? Thanks in advance ******************************************** Steve Ebersole IT Integration Engineer Vignette Corporation 512.741.4195 Visit http://www.vignette.com ******************************************** -----Original Message----- From: Ebersole, Steven [mailto:ste...@vi...] Sent: Monday, May 20, 2002 7:47 AM To: 'Thomas Mahler'; obj...@li... Subject: RE: [ojb-users] references Any ideas? ******************************************** Steve Ebersole IT Integration Engineer Vignette Corporation 512.741.4195 Visit http://www.vignette.com ******************************************** -----Original Message----- From: Ebersole, Steven [mailto:ste...@vi...] Sent: Wednesday, May 08, 2002 7:09 AM To: 'Thomas Mahler'; obj...@li... Subject: RE: [ojb-users] references Below is the exception I get. I appears that the exception occurs when trying to resolve the reference to parent company when that fk column is null. If I remove that reference descriptor, everything works. Query from class com.vignette.it.apps.dbapi.domain.CompanyDO where comp_id= ? [DEFAULT] WARN: Please define a public constructor for class com.vignette.it.apps.dbapi.domain.CompanyDO with the following signature: (java.lang.Integer, java.lang.String, java.lang.Integer). It must initialize the classes persistent attributes. This is recommended to increase performance but it's not mandatory! [ojb.broker.singlevm.PersistenceBrokerImpl] ERROR: expected type: class com.vignette.it.apps.dbapi.domain.CompanyDO [ojb.broker.accesslayer.RsIterator] ERROR: null java.lang.ArrayIndexOutOfBoundsException at ojb.broker.metadata.ClassDescriptor.getFieldDescriptorByIndex(ClassDescripto r.java:263) at ojb.broker.metadata.ObjectReferenceDescriptor.getForeignKeyFieldDescriptors( ObjectReferenceDescriptor.java:242) at ojb.broker.metadata.ObjectReferenceDescriptor.getForeignKeyValues(ObjectRefe renceDescriptor.java:264) at ojb.broker.singlevm.PersistenceBrokerImpl.getReferencedObject(PersistenceBro kerImpl.java:700) at ojb.broker.singlevm.PersistenceBrokerImpl.retrieveReferences(PersistenceBrok erImpl.java:517) at ojb.broker.accesslayer.RsIterator.getObjectFromResultSet(RsIterator.java:263 ) at ojb.broker.accesslayer.RsIterator.next(RsIterator.java:145) at ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr okerImpl.java:900) at ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr okerImpl.java:966) at ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr okerImpl.java:1054) at ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr okerImpl.java:1041) at TestOJBInstall.execute(TestOJBInstall.java:66) at TestOJBInstall.main(TestOJBInstall.java:53) java.util.NoSuchElementException at ojb.broker.accesslayer.RsIterator.next(RsIterator.java:154) at ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr okerImpl.java:900) at ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr okerImpl.java:966) at ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr okerImpl.java:1054) at ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr okerImpl.java:1041) at TestOJBInstall.execute(TestOJBInstall.java:66) at TestOJBInstall.main(TestOJBIError occurred : java.util.NoSuchElementException nstall.java:53) ******************************************** Steve Ebersole IT Integration Engineer Vignette Corporation 512.741.4195 Visit http://www.vignette.com ******************************************** -----Original Message----- From: Thomas Mahler [mailto:tho...@ho...] Sent: Friday, May 03, 2002 12:11 AM To: Ebersole, Steven Subject: Re: [ojb-users] references Hi Steven, Ebersole, Steven wrote: > I am looking at switching from Castor over to OJB as it looks really > promising in terms of its functionality (I especially love the use of > virtual proxies here). I did have two questions come up from my initial > trials of OJB. > > 1) Is it necessary to have both the foreign key and the foreign reference > mapped and present on the object? depends on the navigibility between your persistent classes. If you want to navigate from the 1-side to the n-side only, you just need a foreign key (and a ForeignKeyDescriptor). If you want navigation from the n-side to the 1-side too, you'll also need a reference attribute (and a ReferenceDecsriptor too). In the examples, the relation between > Article and ProductGroup is the example From which I was working. There, > Article has two attributes dealing with its relation to a ProductGroup, Yes, because we have navigation from ProductGroup to all its Articles and from an Article to its associated ProductGroup. > productGroupId (which is the DB fk field) and productGroup (which is an > instance of the ProductGroup object to which productGroupId referes). Is it > necessary to do this, or is there a way to have the Product object only know > about its related ProductGroup? No, because ProductGroup and Article have a 1:n relation the table representaing Article entities *must* have a foreign key to identify the associated ProductGroup. > > 2) I mapped a relationship, uing my classes, similiar to the above > relationship (it is a company -> parent company relationship). However, I > get exceptions if a particular company did not have a parent company (its > PRTN_COMP_ID column on the DB is NULL). Is there something additional I > have to set up in the mapping to define that side of the relationship as > optional? Below is the mapping I have for this: > > > <ClassDescriptor id="2"> > <class.name>com.vignette.it.apps.dbapi.domain.CompanyDO</class.name> > <table.name>COMPANY</table.name> > <FieldDescriptor id="1"> > <field.name>id</field.name> > <column.name>COMP_ID</column.name> > <jdbc_type>INTEGER</jdbc_type> > <PrimaryKey>true</PrimaryKey> > </FieldDescriptor> > ... > <FieldDescriptor id="5"> > <field.name>parentCompanyId</field.name> > <column.name>PRNT_COMP_ID</column.name> > <jdbc_type>INTEGER</jdbc_type> > </FieldDescriptor> > <ReferenceDescriptor id="1"> > <rdfield.name>parentCompany</rdfield.name> > > <referenced.class>com.vignette.it.apps.dbapi.domain.CompanyDO</referenced.cl > ass> > <fk_descriptor_ids>5</fk_descriptor_ids> > </ReferenceDescriptor> > </ClassDescriptor> > Your mapping seems OK. This must be an OJB bug! Can you provide me with a full stacktrace ? thanks, Thomas > > Thanks > > > > > ******************************************** > Steve Ebersole > IT Integration Engineer > Vignette Corporation > 512.741.4195 > > Visit http://www.vignette.com > > ******************************************** > > _______________________________________________________________ > > Have big pipes? SourceForge.net is looking for download mirrors. We supply > the hardware. You get the recognition. Email Us: ban...@so... > _______________________________________________ > Objectbridge-users mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-users > > > > _______________________________________________________________ Have big pipes? SourceForge.net is looking for download mirrors. We supply the hardware. You get the recognition. Email Us: ban...@so... _______________________________________________ Objectbridge-users mailing list Obj...@li... https://lists.sourceforge.net/lists/listinfo/objectbridge-users _______________________________________________________________ Hundreds of nodes, one monster rendering program. Now that's a super model! Visit http://clustering.foundries.sf.net/ _______________________________________________ Objectbridge-users mailing list Obj...@li... https://lists.sourceforge.net/lists/listinfo/objectbridge-users _______________________________________________________________ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm _______________________________________________ Objectbridge-users mailing list Obj...@li... https://lists.sourceforge.net/lists/listinfo/objectbridge-users |
From: Ebersole, S. <ste...@vi...> - 2002-05-28 16:13:36
|
Thanks for the reply... I use 0.8.375. As far as I can tell, there is really no difference between my mappings and those of the tests aside from the fact that mine are simplier because I have very few references mapped (this was only intended to be a quick product evaluation). I have included everything you have asked for, and in addition have added the four class files which are part of the drivers package which make up the test cases. The class TestDataPersistorMapping succeeds (for me) while the other two tests fail. TestDataPersistorMapping is the only one of the three test-cases which does not include mapped references which is why the others seem to fail. Thanks again... ******************************************** Steve Ebersole IT Integration Engineer Vignette Corporation 512.741.4195 Visit http://www.vignette.com ******************************************** -----Original Message----- From: Jakob Braeuchi [mailto:jbr...@ho...] Sent: Tuesday, May 28, 2002 10:35 AM To: Ebersole, Steven; 'Thomas Mahler'; obj...@li... Subject: Re: [ojb-users] references hi steven, what version of ojb do you use ? how does your test differ from the the testcase included in ojb ? please send me a complete test case including repository, java classes and the sql-scripts to setup the tables so i can have a look at it. jakob ----- Original Message ----- From: "Ebersole, Steven" <ste...@vi...> To: "'Thomas Mahler'" <tho...@ho...>; <obj...@li...> Sent: Tuesday, May 28, 2002 3:13 PM Subject: RE: [ojb-users] references > Trying not to sound pushy here, but as I mentioned in my first post I am > considering moving from Castor over to OJB for the project on which I am > currently working. However, I am unable to get even simple reference > relationships working. Obviously I can't move the project over to this > library if this is going to be the case. But it seems others are getting > this to work. > > So I guess my question is now, should I even continue evaluating OJB? I > mean it has been almost a month since my original post, and I am still no > closer to solving the issue and not a single person has been willing (or > knowledgeable enough) to help. I know this is open source and as such: 1) I > could simply debug the library myself; 2) people contribute and help others > as their time allows. As for one, I am in the middle of a project myself > and unfortunately cannot validate the time to spend troubleshooting a > proposed library which may not even be used. As for two, I understand the > time constraints of others, but to wait one month for for a response on such > a basic O/R-mapping requirement as relationships? > > Also, as I have previously mentioned, the set-up and the implementation of > this library are extremely promising (especially in the environment in which > I was hoping to use it). In short I want to use this product. However, I > cannot swap out Castor to OJB at this time because I do not feel confident > enough in OJB's capibilities mainly because every test I have tried to run > (above and beyond strict table-to-object) fails. > > Please, please can anyone help with the below problem? Anyone encountered > it before? > > Thanks in advance > > > > ******************************************** > Steve Ebersole > IT Integration Engineer > Vignette Corporation > 512.741.4195 > > Visit http://www.vignette.com > > ******************************************** > > > -----Original Message----- > From: Ebersole, Steven [mailto:ste...@vi...] > Sent: Monday, May 20, 2002 7:47 AM > To: 'Thomas Mahler'; obj...@li... > Subject: RE: [ojb-users] references > > > Any ideas? > > > ******************************************** > Steve Ebersole > IT Integration Engineer > Vignette Corporation > 512.741.4195 > > Visit http://www.vignette.com > > ******************************************** > > > -----Original Message----- > From: Ebersole, Steven [mailto:ste...@vi...] > Sent: Wednesday, May 08, 2002 7:09 AM > To: 'Thomas Mahler'; obj...@li... > Subject: RE: [ojb-users] references > > > Below is the exception I get. I appears that the exception occurs when > trying to resolve the reference to parent company when that fk column is > null. If I remove that reference descriptor, everything works. > > Query from class com.vignette.it.apps.dbapi.domain.CompanyDO where comp_id= > ? > [DEFAULT] WARN: Please define a public constructor for class > com.vignette.it.apps.dbapi.domain.CompanyDO > with the following signature: (java.lang.Integer, java.lang.String, > java.lang.Integer). > It must initialize the classes persistent attributes. This is recommended to > increase performance but it's not mandatory! > [ojb.broker.singlevm.PersistenceBrokerImpl] ERROR: expected type: class > com.vignette.it.apps.dbapi.domain.CompanyDO > [ojb.broker.accesslayer.RsIterator] ERROR: null > java.lang.ArrayIndexOutOfBoundsException > at > ojb.broker.metadata.ClassDescriptor.getFieldDescriptorByIndex(ClassDescripto > r.java:263) > at > ojb.broker.metadata.ObjectReferenceDescriptor.getForeignKeyFieldDescriptors( > ObjectReferenceDescriptor.java:242) > at > ojb.broker.metadata.ObjectReferenceDescriptor.getForeignKeyValues(ObjectRefe > renceDescriptor.java:264) > at > ojb.broker.singlevm.PersistenceBrokerImpl.getReferencedObject(PersistenceBro > kerImpl.java:700) > at > ojb.broker.singlevm.PersistenceBrokerImpl.retrieveReferences(PersistenceBrok > erImpl.java:517) > at > ojb.broker.accesslayer.RsIterator.getObjectFromResultSet(RsIterator.java:263 > ) > at ojb.broker.accesslayer.RsIterator.next(RsIterator.java:145) > at > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > okerImpl.java:900) > at > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > okerImpl.java:966) > at > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > okerImpl.java:1054) > at > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > okerImpl.java:1041) > at TestOJBInstall.execute(TestOJBInstall.java:66) > at TestOJBInstall.main(TestOJBInstall.java:53) > java.util.NoSuchElementException > at ojb.broker.accesslayer.RsIterator.next(RsIterator.java:154) > at > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > okerImpl.java:900) > at > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > okerImpl.java:966) > at > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > okerImpl.java:1054) > at > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > okerImpl.java:1041) > at TestOJBInstall.execute(TestOJBInstall.java:66) > at TestOJBInstall.main(TestOJBIError occurred : > java.util.NoSuchElementException > nstall.java:53) > > > > > > ******************************************** > Steve Ebersole > IT Integration Engineer > Vignette Corporation > 512.741.4195 > > Visit http://www.vignette.com > > ******************************************** > > > -----Original Message----- > From: Thomas Mahler [mailto:tho...@ho...] > Sent: Friday, May 03, 2002 12:11 AM > To: Ebersole, Steven > Subject: Re: [ojb-users] references > > > Hi Steven, > > Ebersole, Steven wrote: > > > I am looking at switching from Castor over to OJB as it looks really > > promising in terms of its functionality (I especially love the use of > > virtual proxies here). I did have two questions come up from my initial > > trials of OJB. > > > > 1) Is it necessary to have both the foreign key and the foreign reference > > mapped and present on the object? > > > depends on the navigibility between your persistent classes. > If you want to navigate from the 1-side to the n-side only, you just > need a foreign key (and a ForeignKeyDescriptor). > > If you want navigation from the n-side to the 1-side too, you'll also > need a reference attribute (and a ReferenceDecsriptor too). > > In the examples, the relation between > > Article and ProductGroup is the example From which I was working. There, > > Article has two attributes dealing with its relation to a ProductGroup, > > > Yes, because we have navigation from ProductGroup to all its Articles > and from an Article to its associated ProductGroup. > > > > productGroupId (which is the DB fk field) and productGroup (which is an > > instance of the ProductGroup object to which productGroupId referes). Is > it > > necessary to do this, or is there a way to have the Product object only > know > > about its related ProductGroup? > > > No, because ProductGroup and Article have a 1:n relation the table > representaing Article entities *must* have a foreign key to identify the > associated ProductGroup. > > > > > > 2) I mapped a relationship, uing my classes, similiar to the above > > relationship (it is a company -> parent company relationship). However, I > > get exceptions if a particular company did not have a parent company (its > > PRTN_COMP_ID column on the DB is NULL). Is there something additional I > > have to set up in the mapping to define that side of the relationship as > > optional? Below is the mapping I have for this: > > > > > > <ClassDescriptor id="2"> > > > <class.name>com.vignette.it.apps.dbapi.domain.CompanyDO</class.name> > > <table.name>COMPANY</table.name> > > <FieldDescriptor id="1"> > > <field.name>id</field.name> > > <column.name>COMP_ID</column.name> > > <jdbc_type>INTEGER</jdbc_type> > > <PrimaryKey>true</PrimaryKey> > > </FieldDescriptor> > > ... > > <FieldDescriptor id="5"> > > <field.name>parentCompanyId</field.name> > > <column.name>PRNT_COMP_ID</column.name> > > <jdbc_type>INTEGER</jdbc_type> > > </FieldDescriptor> > > <ReferenceDescriptor id="1"> > > <rdfield.name>parentCompany</rdfield.name> > > > > > <referenced.class>com.vignette.it.apps.dbapi.domain.CompanyDO</referenced.cl > > ass> > > <fk_descriptor_ids>5</fk_descriptor_ids> > > </ReferenceDescriptor> > > </ClassDescriptor> > > > > > Your mapping seems OK. This must be an OJB bug! Can you provide me with > a full stacktrace ? > > thanks, > > Thomas > > > > > > Thanks > > > > > > > > > > ******************************************** > > Steve Ebersole > > IT Integration Engineer > > Vignette Corporation > > 512.741.4195 > > > > Visit http://www.vignette.com > > > > ******************************************** > > > > _______________________________________________________________ > > > > Have big pipes? SourceForge.net is looking for download mirrors. We supply > > the hardware. You get the recognition. Email Us: ban...@so... > > _______________________________________________ > > Objectbridge-users mailing list > > Obj...@li... > > https://lists.sourceforge.net/lists/listinfo/objectbridge-users > > > > > > > > > > > _______________________________________________________________ > > Have big pipes? SourceForge.net is looking for download mirrors. We supply > the hardware. You get the recognition. Email Us: ban...@so... > _______________________________________________ > Objectbridge-users mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-users > > _______________________________________________________________ > Hundreds of nodes, one monster rendering program. > Now that's a super model! Visit http://clustering.foundries.sf.net/ > > _______________________________________________ > Objectbridge-users mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-users > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Objectbridge-users mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-users > |
From: Jakob B. <jbr...@ho...> - 2002-05-28 15:42:40
|
RE: [ojb-users] Does OJB supports 1:n uni-directional mapping?hi, ojb supports unidirectional mapping for 1:n relationships.=20 unidirectional m:n do not work, in some cases the inverse relationship = is used by the persistence broker. jakob ----- Original Message -----=20 From: Arvind Gudipati=20 To: Hoang, Hai ; 'obj...@li...'=20 Sent: Tuesday, May 28, 2002 2:40 PM Subject: RE: [ojb-users] Does OJB supports 1:n uni-directional = mapping? 1. Does OJB supports uni-directional mapping for 1:n and n:m?=20 A: Yes.. you cna check the documentation provided by OJB and included = in the download packages. They are pretty descriptive and infact i just = started using OJB and i think its pretty straightforward. The author has = donw pretty great work for an incredicble product. (Did i mention i just = love this project).. 2. Does OJB supports direct sql statement?=20 A: Yes, you can use QueryBySQL class and set the SQL using its = setSQL(String) method.=20 -----Original Message-----=20 From: Hoang, Hai [mailto:Hai...@co...]=20 Sent: Saturday, May 25, 2002 11:13 AM=20 To: 'obj...@li...'=20 Subject: [ojb-users] Does OJB supports 1:n uni-directional mapping?=20 I've a few questions for OBJ community:=20 1. Does OJB supports uni-directional mapping for 1:n and n:m?=20 2. Does OJB supports direct sql statement? this is useful for the case = where=20 I've a complex query statement and I don't want to translate to = complex qql=20 Thanks=20 _______________________________________________________________=20 Don't miss the 2002 Sprint PCS Application Developer's Conference=20 August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm = _______________________________________________=20 Objectbridge-users mailing list=20 Obj...@li...=20 https://lists.sourceforge.net/lists/listinfo/objectbridge-users=20 = *************************************************************************= **************** This E-mail is from = PANACYA Inc. The E-mail and any files transmitted with it are = confidential and may also be privileged and intended solely for the use = of the individual or entity to whom they are addressed. Any unauthorized = direct or indirect dissemination, distribution or copying of this = message and any attachments is strictly prohibited. If you have received = the E-mail in error please notify adm...@pa... or telephone = (410) 910-3300. = *************************************************************************= *************** |
From: Jakob B. <jbr...@ho...> - 2002-05-28 15:35:25
|
hi steven, what version of ojb do you use ? how does your test differ from the the testcase included in ojb ? please send me a complete test case including repository, java classes and the sql-scripts to setup the tables so i can have a look at it. jakob ----- Original Message ----- From: "Ebersole, Steven" <ste...@vi...> To: "'Thomas Mahler'" <tho...@ho...>; <obj...@li...> Sent: Tuesday, May 28, 2002 3:13 PM Subject: RE: [ojb-users] references > Trying not to sound pushy here, but as I mentioned in my first post I am > considering moving from Castor over to OJB for the project on which I am > currently working. However, I am unable to get even simple reference > relationships working. Obviously I can't move the project over to this > library if this is going to be the case. But it seems others are getting > this to work. > > So I guess my question is now, should I even continue evaluating OJB? I > mean it has been almost a month since my original post, and I am still no > closer to solving the issue and not a single person has been willing (or > knowledgeable enough) to help. I know this is open source and as such: 1) I > could simply debug the library myself; 2) people contribute and help others > as their time allows. As for one, I am in the middle of a project myself > and unfortunately cannot validate the time to spend troubleshooting a > proposed library which may not even be used. As for two, I understand the > time constraints of others, but to wait one month for for a response on such > a basic O/R-mapping requirement as relationships? > > Also, as I have previously mentioned, the set-up and the implementation of > this library are extremely promising (especially in the environment in which > I was hoping to use it). In short I want to use this product. However, I > cannot swap out Castor to OJB at this time because I do not feel confident > enough in OJB's capibilities mainly because every test I have tried to run > (above and beyond strict table-to-object) fails. > > Please, please can anyone help with the below problem? Anyone encountered > it before? > > Thanks in advance > > > > ******************************************** > Steve Ebersole > IT Integration Engineer > Vignette Corporation > 512.741.4195 > > Visit http://www.vignette.com > > ******************************************** > > > -----Original Message----- > From: Ebersole, Steven [mailto:ste...@vi...] > Sent: Monday, May 20, 2002 7:47 AM > To: 'Thomas Mahler'; obj...@li... > Subject: RE: [ojb-users] references > > > Any ideas? > > > ******************************************** > Steve Ebersole > IT Integration Engineer > Vignette Corporation > 512.741.4195 > > Visit http://www.vignette.com > > ******************************************** > > > -----Original Message----- > From: Ebersole, Steven [mailto:ste...@vi...] > Sent: Wednesday, May 08, 2002 7:09 AM > To: 'Thomas Mahler'; obj...@li... > Subject: RE: [ojb-users] references > > > Below is the exception I get. I appears that the exception occurs when > trying to resolve the reference to parent company when that fk column is > null. If I remove that reference descriptor, everything works. > > Query from class com.vignette.it.apps.dbapi.domain.CompanyDO where comp_id= > ? > [DEFAULT] WARN: Please define a public constructor for class > com.vignette.it.apps.dbapi.domain.CompanyDO > with the following signature: (java.lang.Integer, java.lang.String, > java.lang.Integer). > It must initialize the classes persistent attributes. This is recommended to > increase performance but it's not mandatory! > [ojb.broker.singlevm.PersistenceBrokerImpl] ERROR: expected type: class > com.vignette.it.apps.dbapi.domain.CompanyDO > [ojb.broker.accesslayer.RsIterator] ERROR: null > java.lang.ArrayIndexOutOfBoundsException > at > ojb.broker.metadata.ClassDescriptor.getFieldDescriptorByIndex(ClassDescripto > r.java:263) > at > ojb.broker.metadata.ObjectReferenceDescriptor.getForeignKeyFieldDescriptors( > ObjectReferenceDescriptor.java:242) > at > ojb.broker.metadata.ObjectReferenceDescriptor.getForeignKeyValues(ObjectRefe > renceDescriptor.java:264) > at > ojb.broker.singlevm.PersistenceBrokerImpl.getReferencedObject(PersistenceBro > kerImpl.java:700) > at > ojb.broker.singlevm.PersistenceBrokerImpl.retrieveReferences(PersistenceBrok > erImpl.java:517) > at > ojb.broker.accesslayer.RsIterator.getObjectFromResultSet(RsIterator.java:263 > ) > at ojb.broker.accesslayer.RsIterator.next(RsIterator.java:145) > at > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > okerImpl.java:900) > at > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > okerImpl.java:966) > at > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > okerImpl.java:1054) > at > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > okerImpl.java:1041) > at TestOJBInstall.execute(TestOJBInstall.java:66) > at TestOJBInstall.main(TestOJBInstall.java:53) > java.util.NoSuchElementException > at ojb.broker.accesslayer.RsIterator.next(RsIterator.java:154) > at > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > okerImpl.java:900) > at > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > okerImpl.java:966) > at > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > okerImpl.java:1054) > at > ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr > okerImpl.java:1041) > at TestOJBInstall.execute(TestOJBInstall.java:66) > at TestOJBInstall.main(TestOJBIError occurred : > java.util.NoSuchElementException > nstall.java:53) > > > > > > ******************************************** > Steve Ebersole > IT Integration Engineer > Vignette Corporation > 512.741.4195 > > Visit http://www.vignette.com > > ******************************************** > > > -----Original Message----- > From: Thomas Mahler [mailto:tho...@ho...] > Sent: Friday, May 03, 2002 12:11 AM > To: Ebersole, Steven > Subject: Re: [ojb-users] references > > > Hi Steven, > > Ebersole, Steven wrote: > > > I am looking at switching from Castor over to OJB as it looks really > > promising in terms of its functionality (I especially love the use of > > virtual proxies here). I did have two questions come up from my initial > > trials of OJB. > > > > 1) Is it necessary to have both the foreign key and the foreign reference > > mapped and present on the object? > > > depends on the navigibility between your persistent classes. > If you want to navigate from the 1-side to the n-side only, you just > need a foreign key (and a ForeignKeyDescriptor). > > If you want navigation from the n-side to the 1-side too, you'll also > need a reference attribute (and a ReferenceDecsriptor too). > > In the examples, the relation between > > Article and ProductGroup is the example From which I was working. There, > > Article has two attributes dealing with its relation to a ProductGroup, > > > Yes, because we have navigation from ProductGroup to all its Articles > and from an Article to its associated ProductGroup. > > > > productGroupId (which is the DB fk field) and productGroup (which is an > > instance of the ProductGroup object to which productGroupId referes). Is > it > > necessary to do this, or is there a way to have the Product object only > know > > about its related ProductGroup? > > > No, because ProductGroup and Article have a 1:n relation the table > representaing Article entities *must* have a foreign key to identify the > associated ProductGroup. > > > > > > 2) I mapped a relationship, uing my classes, similiar to the above > > relationship (it is a company -> parent company relationship). However, I > > get exceptions if a particular company did not have a parent company (its > > PRTN_COMP_ID column on the DB is NULL). Is there something additional I > > have to set up in the mapping to define that side of the relationship as > > optional? Below is the mapping I have for this: > > > > > > <ClassDescriptor id="2"> > > > <class.name>com.vignette.it.apps.dbapi.domain.CompanyDO</class.name> > > <table.name>COMPANY</table.name> > > <FieldDescriptor id="1"> > > <field.name>id</field.name> > > <column.name>COMP_ID</column.name> > > <jdbc_type>INTEGER</jdbc_type> > > <PrimaryKey>true</PrimaryKey> > > </FieldDescriptor> > > ... > > <FieldDescriptor id="5"> > > <field.name>parentCompanyId</field.name> > > <column.name>PRNT_COMP_ID</column.name> > > <jdbc_type>INTEGER</jdbc_type> > > </FieldDescriptor> > > <ReferenceDescriptor id="1"> > > <rdfield.name>parentCompany</rdfield.name> > > > > > <referenced.class>com.vignette.it.apps.dbapi.domain.CompanyDO</referenced.cl > > ass> > > <fk_descriptor_ids>5</fk_descriptor_ids> > > </ReferenceDescriptor> > > </ClassDescriptor> > > > > > Your mapping seems OK. This must be an OJB bug! Can you provide me with > a full stacktrace ? > > thanks, > > Thomas > > > > > > Thanks > > > > > > > > > > ******************************************** > > Steve Ebersole > > IT Integration Engineer > > Vignette Corporation > > 512.741.4195 > > > > Visit http://www.vignette.com > > > > ******************************************** > > > > _______________________________________________________________ > > > > Have big pipes? SourceForge.net is looking for download mirrors. We supply > > the hardware. You get the recognition. Email Us: ban...@so... > > _______________________________________________ > > Objectbridge-users mailing list > > Obj...@li... > > https://lists.sourceforge.net/lists/listinfo/objectbridge-users > > > > > > > > > > > _______________________________________________________________ > > Have big pipes? SourceForge.net is looking for download mirrors. We supply > the hardware. You get the recognition. Email Us: ban...@so... > _______________________________________________ > Objectbridge-users mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-users > > _______________________________________________________________ > Hundreds of nodes, one monster rendering program. > Now that's a super model! Visit http://clustering.foundries.sf.net/ > > _______________________________________________ > Objectbridge-users mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-users > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Objectbridge-users mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-users > |
From: Govindarajan S (Gover) <gov...@az...> - 2002-05-28 14:00:56
|
HI, Thanx for your mail, But i guess i have entries for the particular class which iam trying to persist in the ojb_hl_seq. I know iam missing a very trivial stuff. can u just explain me in detail what else is to be done! thanx gover Message: 2 From: Arvind Gudipati <Arv...@PA...> To: obj...@li... Subject: RE: [ojb-users] Problem with incrementing the primary key Date: Tue, 28 May 2002 08:36:16 -0400 This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C20644.42E0D990 Content-Type: text/plain; charset="iso-8859-1" Im pretty new to OJB myself but i guess i can answer that problem... (Experts correct me if im wrong ;).. You need to create the OJB specific tables. The sequences for each class types are stored in tables (OJB_SEQ for general auto-increment and OJB_HL_SEQ for hi-low sequence types) Arvind -----Original Message----- From: Govindarajan S (Gover) [mailto:gov...@az...] Sent: Tuesday, May 28, 2002 2:16 AM To: obj...@li... Subject: [ojb-users] Problem with incrementing the primary key HI, I tried out the examples from tutorial1. When i set the autoincrement to true in the repository.xml i get an exception like the one below, i used the ojb.properties file that shipped along with the installable. what am i missing here? gover D:\OjbTest\UserDetails\src>java com.ojb.userdetails.UserDetailsClient [BOOT] INFO: OJB.properties: file:/D:/OjbTest/UserDetails/src/OJB.properties [ojb.broker.ta.ConfigurationProperties] INFO: ojb.broker.ta.ConfigurationPropert ies read OJB.properties [ojb.broker.ta.ConfigurationProperties] INFO: OJB.properties: file:/D:/OjbTest/U serDetails/src/OJB.properties [BOOT] INFO: OJB.properties: file:/D:/OjbTest/UserDetails/src/OJB.properties [ojb.broker.ta.PersistenceBrokerFactoryFactory] INFO: Implementation of Persiste ncebrokerFactory: ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl [DEFAULT] ERROR: ojb.broker.util.sequence.HighLowSequence not found in OJB Repos itory ojb.broker.util.sequence.HighLowSequence not found in OJB Repository at ojb.broker.metadata.DescriptorRepository.getDescriptorFor(DescriptorR epository.java:147) at ojb.broker.singlevm.PersistenceBrokerImpl.getClassDescriptor(Persiste nceBrokerImpl.java:1445) at ojb.broker.Identity.<init>(Identity.java:108) at ojb.broker.singlevm.PersistenceBrokerImpl.getObjectByExample(Persiste nceBrokerImpl.java:1161) at ojb.broker.singlevm.PersistenceBrokerImpl.getObjectByQuery(Persistenc eBrokerImpl.java:1206) at ojb.broker.util.sequence.SequenceManagerHighLowImpl.getUniqueId(Seque nceManagerHighLowImpl.java:84) at ojb.broker.singlevm.PersistenceBrokerImpl.getUniqueId(PersistenceBrok erImpl.java:1407) at ojb.broker.metadata.ClassDescriptor.getAutoIncrementValue(ClassDescri ptor.java:750) at ojb.broker.metadata.ClassDescriptor.getKeyValues(ClassDescriptor.java :639) at ojb.broker.Identity.<init>(Identity.java:111) at ojb.broker.singlevm.PersistenceBrokerImpl.store(PersistenceBrokerImpl .java:307) at com.ojb.userdetails.UserDetailsClient.addUserDetails(UserDetailsClien t.java:56) at com.ojb.userdetails.UserDetailsClient.main(UserDetailsClient.java:40) [DEFAULT] ERROR: OJB ERROR: Dont know how to autoincrement field class com.ojb.u serdetails.UserDetails._id java.lang.RuntimeException: OJB ERROR: Dont know how to autoincrement field clas s com.ojb.userdetails.UserDetails._id at ojb.broker.metadata.ClassDescriptor.getAutoIncrementValue(ClassDescri ptor.java:809) at ojb.broker.metadata.ClassDescriptor.getKeyValues(ClassDescriptor.java :639) at ojb.broker.Identity.<init>(Identity.java:111) at ojb.broker.singlevm.PersistenceBrokerImpl.store(PersistenceBrokerImpl .java:307) at com.ojb.userdetails.UserDetailsClient.addUserDetails(UserDetailsClien t.java:56) at com.ojb.userdetails.UserDetailsClient.main(UserDetailsClient.java:40) [DEFAULT] ERROR: OJB ERROR: Dont know how to autoincrement field class com.ojb.u serdetails.UserDetails._id OJB ERROR: Dont know how to autoincrement field class com.ojb.userdetails.UserDe tails._id at ojb.broker.metadata.ClassDescriptor.getKeyValues(ClassDescriptor.java :645) at ojb.broker.Identity.<init>(Identity.java:111) at ojb.broker.singlevm.PersistenceBrokerImpl.store(PersistenceBrokerImpl .java:307) at com.ojb.userdetails.UserDetailsClient.addUserDetails(UserDetailsClien t.java:56) at com.ojb.userdetails.UserDetailsClient.main(UserDetailsClient.java:40) ----- Persistence Broker Exp ------ OJB ERROR: Dont know how to autoincrement field class com.ojb.userdetails.UserDe tails._id at ojb.broker.Identity.<init>(Identity.java:119) at ojb.broker.singlevm.PersistenceBrokerImpl.store(PersistenceBrokerImpl .java:307) at com.ojb.userdetails.UserDetailsClient.addUserDetails(UserDetailsClien t.java:56) at com.ojb.userdetails.UserDetailsClient.main(UserDetailsClient.java:40) |
From: Ebersole, S. <ste...@vi...> - 2002-05-28 13:14:41
|
Trying not to sound pushy here, but as I mentioned in my first post I am considering moving from Castor over to OJB for the project on which I am currently working. However, I am unable to get even simple reference relationships working. Obviously I can't move the project over to this library if this is going to be the case. But it seems others are getting this to work. So I guess my question is now, should I even continue evaluating OJB? I mean it has been almost a month since my original post, and I am still no closer to solving the issue and not a single person has been willing (or knowledgeable enough) to help. I know this is open source and as such: 1) I could simply debug the library myself; 2) people contribute and help others as their time allows. As for one, I am in the middle of a project myself and unfortunately cannot validate the time to spend troubleshooting a proposed library which may not even be used. As for two, I understand the time constraints of others, but to wait one month for for a response on such a basic O/R-mapping requirement as relationships? Also, as I have previously mentioned, the set-up and the implementation of this library are extremely promising (especially in the environment in which I was hoping to use it). In short I want to use this product. However, I cannot swap out Castor to OJB at this time because I do not feel confident enough in OJB's capibilities mainly because every test I have tried to run (above and beyond strict table-to-object) fails. Please, please can anyone help with the below problem? Anyone encountered it before? Thanks in advance ******************************************** Steve Ebersole IT Integration Engineer Vignette Corporation 512.741.4195 Visit http://www.vignette.com ******************************************** -----Original Message----- From: Ebersole, Steven [mailto:ste...@vi...] Sent: Monday, May 20, 2002 7:47 AM To: 'Thomas Mahler'; obj...@li... Subject: RE: [ojb-users] references Any ideas? ******************************************** Steve Ebersole IT Integration Engineer Vignette Corporation 512.741.4195 Visit http://www.vignette.com ******************************************** -----Original Message----- From: Ebersole, Steven [mailto:ste...@vi...] Sent: Wednesday, May 08, 2002 7:09 AM To: 'Thomas Mahler'; obj...@li... Subject: RE: [ojb-users] references Below is the exception I get. I appears that the exception occurs when trying to resolve the reference to parent company when that fk column is null. If I remove that reference descriptor, everything works. Query from class com.vignette.it.apps.dbapi.domain.CompanyDO where comp_id= ? [DEFAULT] WARN: Please define a public constructor for class com.vignette.it.apps.dbapi.domain.CompanyDO with the following signature: (java.lang.Integer, java.lang.String, java.lang.Integer). It must initialize the classes persistent attributes. This is recommended to increase performance but it's not mandatory! [ojb.broker.singlevm.PersistenceBrokerImpl] ERROR: expected type: class com.vignette.it.apps.dbapi.domain.CompanyDO [ojb.broker.accesslayer.RsIterator] ERROR: null java.lang.ArrayIndexOutOfBoundsException at ojb.broker.metadata.ClassDescriptor.getFieldDescriptorByIndex(ClassDescripto r.java:263) at ojb.broker.metadata.ObjectReferenceDescriptor.getForeignKeyFieldDescriptors( ObjectReferenceDescriptor.java:242) at ojb.broker.metadata.ObjectReferenceDescriptor.getForeignKeyValues(ObjectRefe renceDescriptor.java:264) at ojb.broker.singlevm.PersistenceBrokerImpl.getReferencedObject(PersistenceBro kerImpl.java:700) at ojb.broker.singlevm.PersistenceBrokerImpl.retrieveReferences(PersistenceBrok erImpl.java:517) at ojb.broker.accesslayer.RsIterator.getObjectFromResultSet(RsIterator.java:263 ) at ojb.broker.accesslayer.RsIterator.next(RsIterator.java:145) at ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr okerImpl.java:900) at ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr okerImpl.java:966) at ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr okerImpl.java:1054) at ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr okerImpl.java:1041) at TestOJBInstall.execute(TestOJBInstall.java:66) at TestOJBInstall.main(TestOJBInstall.java:53) java.util.NoSuchElementException at ojb.broker.accesslayer.RsIterator.next(RsIterator.java:154) at ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr okerImpl.java:900) at ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr okerImpl.java:966) at ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr okerImpl.java:1054) at ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBr okerImpl.java:1041) at TestOJBInstall.execute(TestOJBInstall.java:66) at TestOJBInstall.main(TestOJBIError occurred : java.util.NoSuchElementException nstall.java:53) ******************************************** Steve Ebersole IT Integration Engineer Vignette Corporation 512.741.4195 Visit http://www.vignette.com ******************************************** -----Original Message----- From: Thomas Mahler [mailto:tho...@ho...] Sent: Friday, May 03, 2002 12:11 AM To: Ebersole, Steven Subject: Re: [ojb-users] references Hi Steven, Ebersole, Steven wrote: > I am looking at switching from Castor over to OJB as it looks really > promising in terms of its functionality (I especially love the use of > virtual proxies here). I did have two questions come up from my initial > trials of OJB. > > 1) Is it necessary to have both the foreign key and the foreign reference > mapped and present on the object? depends on the navigibility between your persistent classes. If you want to navigate from the 1-side to the n-side only, you just need a foreign key (and a ForeignKeyDescriptor). If you want navigation from the n-side to the 1-side too, you'll also need a reference attribute (and a ReferenceDecsriptor too). In the examples, the relation between > Article and ProductGroup is the example From which I was working. There, > Article has two attributes dealing with its relation to a ProductGroup, Yes, because we have navigation from ProductGroup to all its Articles and from an Article to its associated ProductGroup. > productGroupId (which is the DB fk field) and productGroup (which is an > instance of the ProductGroup object to which productGroupId referes). Is it > necessary to do this, or is there a way to have the Product object only know > about its related ProductGroup? No, because ProductGroup and Article have a 1:n relation the table representaing Article entities *must* have a foreign key to identify the associated ProductGroup. > > 2) I mapped a relationship, uing my classes, similiar to the above > relationship (it is a company -> parent company relationship). However, I > get exceptions if a particular company did not have a parent company (its > PRTN_COMP_ID column on the DB is NULL). Is there something additional I > have to set up in the mapping to define that side of the relationship as > optional? Below is the mapping I have for this: > > > <ClassDescriptor id="2"> > <class.name>com.vignette.it.apps.dbapi.domain.CompanyDO</class.name> > <table.name>COMPANY</table.name> > <FieldDescriptor id="1"> > <field.name>id</field.name> > <column.name>COMP_ID</column.name> > <jdbc_type>INTEGER</jdbc_type> > <PrimaryKey>true</PrimaryKey> > </FieldDescriptor> > ... > <FieldDescriptor id="5"> > <field.name>parentCompanyId</field.name> > <column.name>PRNT_COMP_ID</column.name> > <jdbc_type>INTEGER</jdbc_type> > </FieldDescriptor> > <ReferenceDescriptor id="1"> > <rdfield.name>parentCompany</rdfield.name> > > <referenced.class>com.vignette.it.apps.dbapi.domain.CompanyDO</referenced.cl > ass> > <fk_descriptor_ids>5</fk_descriptor_ids> > </ReferenceDescriptor> > </ClassDescriptor> > Your mapping seems OK. This must be an OJB bug! Can you provide me with a full stacktrace ? thanks, Thomas > > Thanks > > > > > ******************************************** > Steve Ebersole > IT Integration Engineer > Vignette Corporation > 512.741.4195 > > Visit http://www.vignette.com > > ******************************************** > > _______________________________________________________________ > > Have big pipes? SourceForge.net is looking for download mirrors. We supply > the hardware. You get the recognition. Email Us: ban...@so... > _______________________________________________ > Objectbridge-users mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-users > > > > _______________________________________________________________ Have big pipes? SourceForge.net is looking for download mirrors. We supply the hardware. You get the recognition. Email Us: ban...@so... _______________________________________________ Objectbridge-users mailing list Obj...@li... https://lists.sourceforge.net/lists/listinfo/objectbridge-users _______________________________________________________________ Hundreds of nodes, one monster rendering program. Now that's a super model! Visit http://clustering.foundries.sf.net/ _______________________________________________ Objectbridge-users mailing list Obj...@li... https://lists.sourceforge.net/lists/listinfo/objectbridge-users |
From: Arvind G. <Arv...@PA...> - 2002-05-28 12:39:47
|
1. Does OJB supports uni-directional mapping for 1:n and n:m? A: Yes.. you cna check the documentation provided by OJB and included in the download packages. They are pretty descriptive and infact i just started using OJB and i think its pretty straightforward. The author has donw pretty great work for an incredicble product. (Did i mention i just love this project).. 2. Does OJB supports direct sql statement? A: Yes, you can use QueryBySQL class and set the SQL using its setSQL(String) method. -----Original Message----- From: Hoang, Hai [mailto:Hai...@co...] Sent: Saturday, May 25, 2002 11:13 AM To: 'obj...@li...' Subject: [ojb-users] Does OJB supports 1:n uni-directional mapping? I've a few questions for OBJ community: 1. Does OJB supports uni-directional mapping for 1:n and n:m? 2. Does OJB supports direct sql statement? this is useful for the case where I've a complex query statement and I don't want to translate to complex qql Thanks _______________________________________________________________ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm _______________________________________________ Objectbridge-users mailing list Obj...@li... https://lists.sourceforge.net/lists/listinfo/objectbridge-users **************************************************************************** ************* This E-mail is from PANACYA Inc. The E-mail and any files transmitted with it are confidential and may also be privileged and intended solely for the use of the individual or entity to whom they are addressed. Any unauthorized direct or indirect dissemination, distribution or copying of this message and any attachments is strictly prohibited. If you have received the E-mail in error please notify adm...@pa... or telephone (410) 910-3300. **************************************************************************** ************ |
From: Arvind G. <Arv...@PA...> - 2002-05-28 12:36:09
|
Im pretty new to OJB myself but i guess i can answer that problem... (Experts correct me if im wrong ;).. You need to create the OJB specific tables. The sequences for each class types are stored in tables (OJB_SEQ for general auto-increment and OJB_HL_SEQ for hi-low sequence types) Arvind -----Original Message----- From: Govindarajan S (Gover) [mailto:gov...@az...] Sent: Tuesday, May 28, 2002 2:16 AM To: obj...@li... Subject: [ojb-users] Problem with incrementing the primary key HI, I tried out the examples from tutorial1. When i set the autoincrement to true in the repository.xml i get an exception like the one below, i used the ojb.properties file that shipped along with the installable. what am i missing here? gover D:\OjbTest\UserDetails\src>java com.ojb.userdetails.UserDetailsClient [BOOT] INFO: OJB.properties: file:/D:/OjbTest/UserDetails/src/OJB.properties [ojb.broker.ta.ConfigurationProperties] INFO: ojb.broker.ta.ConfigurationPropert ies read OJB.properties [ojb.broker.ta.ConfigurationProperties] INFO: OJB.properties: file:/D:/OjbTest/U serDetails/src/OJB.properties [BOOT] INFO: OJB.properties: file:/D:/OjbTest/UserDetails/src/OJB.properties [ojb.broker.ta.PersistenceBrokerFactoryFactory] INFO: Implementation of Persiste ncebrokerFactory: ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl [DEFAULT] ERROR: ojb.broker.util.sequence.HighLowSequence not found in OJB Repos itory ojb.broker.util.sequence.HighLowSequence not found in OJB Repository at ojb.broker.metadata.DescriptorRepository.getDescriptorFor(DescriptorR epository.java:147) at ojb.broker.singlevm.PersistenceBrokerImpl.getClassDescriptor(Persiste nceBrokerImpl.java:1445) at ojb.broker.Identity.<init>(Identity.java:108) at ojb.broker.singlevm.PersistenceBrokerImpl.getObjectByExample(Persiste nceBrokerImpl.java:1161) at ojb.broker.singlevm.PersistenceBrokerImpl.getObjectByQuery(Persistenc eBrokerImpl.java:1206) at ojb.broker.util.sequence.SequenceManagerHighLowImpl.getUniqueId(Seque nceManagerHighLowImpl.java:84) at ojb.broker.singlevm.PersistenceBrokerImpl.getUniqueId(PersistenceBrok erImpl.java:1407) at ojb.broker.metadata.ClassDescriptor.getAutoIncrementValue(ClassDescri ptor.java:750) at ojb.broker.metadata.ClassDescriptor.getKeyValues(ClassDescriptor.java :639) at ojb.broker.Identity.<init>(Identity.java:111) at ojb.broker.singlevm.PersistenceBrokerImpl.store(PersistenceBrokerImpl .java:307) at com.ojb.userdetails.UserDetailsClient.addUserDetails(UserDetailsClien t.java:56) at com.ojb.userdetails.UserDetailsClient.main(UserDetailsClient.java:40) [DEFAULT] ERROR: OJB ERROR: Dont know how to autoincrement field class com.ojb.u serdetails.UserDetails._id java.lang.RuntimeException: OJB ERROR: Dont know how to autoincrement field clas s com.ojb.userdetails.UserDetails._id at ojb.broker.metadata.ClassDescriptor.getAutoIncrementValue(ClassDescri ptor.java:809) at ojb.broker.metadata.ClassDescriptor.getKeyValues(ClassDescriptor.java :639) at ojb.broker.Identity.<init>(Identity.java:111) at ojb.broker.singlevm.PersistenceBrokerImpl.store(PersistenceBrokerImpl .java:307) at com.ojb.userdetails.UserDetailsClient.addUserDetails(UserDetailsClien t.java:56) at com.ojb.userdetails.UserDetailsClient.main(UserDetailsClient.java:40) [DEFAULT] ERROR: OJB ERROR: Dont know how to autoincrement field class com.ojb.u serdetails.UserDetails._id OJB ERROR: Dont know how to autoincrement field class com.ojb.userdetails.UserDe tails._id at ojb.broker.metadata.ClassDescriptor.getKeyValues(ClassDescriptor.java :645) at ojb.broker.Identity.<init>(Identity.java:111) at ojb.broker.singlevm.PersistenceBrokerImpl.store(PersistenceBrokerImpl .java:307) at com.ojb.userdetails.UserDetailsClient.addUserDetails(UserDetailsClien t.java:56) at com.ojb.userdetails.UserDetailsClient.main(UserDetailsClient.java:40) ----- Persistence Broker Exp ------ OJB ERROR: Dont know how to autoincrement field class com.ojb.userdetails.UserDe tails._id at ojb.broker.Identity.<init>(Identity.java:119) at ojb.broker.singlevm.PersistenceBrokerImpl.store(PersistenceBrokerImpl .java:307) at com.ojb.userdetails.UserDetailsClient.addUserDetails(UserDetailsClien t.java:56) at com.ojb.userdetails.UserDetailsClient.main(UserDetailsClient.java:40) _______________________________________________________________ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm _______________________________________________ Objectbridge-users mailing list Obj...@li... https://lists.sourceforge.net/lists/listinfo/objectbridge-users **************************************************************************** ************* This E-mail is from PANACYA Inc. The E-mail and any files transmitted with it are confidential and may also be privileged and intended solely for the use of the individual or entity to whom they are addressed. Any unauthorized direct or indirect dissemination, distribution or copying of this message and any attachments is strictly prohibited. If you have received the E-mail in error please notify adm...@pa... or telephone (410) 910-3300. **************************************************************************** ************ |
From: Govindarajan S (Gover) <gov...@az...> - 2002-05-28 06:13:43
|
HI, I tried out the examples from tutorial1. When i set the autoincrement to true in the repository.xml i get an exception like the one below, i used the ojb.properties file that shipped along with the installable. what am i missing here? gover D:\OjbTest\UserDetails\src>java com.ojb.userdetails.UserDetailsClient [BOOT] INFO: OJB.properties: file:/D:/OjbTest/UserDetails/src/OJB.properties [ojb.broker.ta.ConfigurationProperties] INFO: ojb.broker.ta.ConfigurationPropert ies read OJB.properties [ojb.broker.ta.ConfigurationProperties] INFO: OJB.properties: file:/D:/OjbTest/U serDetails/src/OJB.properties [BOOT] INFO: OJB.properties: file:/D:/OjbTest/UserDetails/src/OJB.properties [ojb.broker.ta.PersistenceBrokerFactoryFactory] INFO: Implementation of Persiste ncebrokerFactory: ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl [DEFAULT] ERROR: ojb.broker.util.sequence.HighLowSequence not found in OJB Repos itory ojb.broker.util.sequence.HighLowSequence not found in OJB Repository at ojb.broker.metadata.DescriptorRepository.getDescriptorFor(DescriptorR epository.java:147) at ojb.broker.singlevm.PersistenceBrokerImpl.getClassDescriptor(Persiste nceBrokerImpl.java:1445) at ojb.broker.Identity.<init>(Identity.java:108) at ojb.broker.singlevm.PersistenceBrokerImpl.getObjectByExample(Persiste nceBrokerImpl.java:1161) at ojb.broker.singlevm.PersistenceBrokerImpl.getObjectByQuery(Persistenc eBrokerImpl.java:1206) at ojb.broker.util.sequence.SequenceManagerHighLowImpl.getUniqueId(Seque nceManagerHighLowImpl.java:84) at ojb.broker.singlevm.PersistenceBrokerImpl.getUniqueId(PersistenceBrok erImpl.java:1407) at ojb.broker.metadata.ClassDescriptor.getAutoIncrementValue(ClassDescri ptor.java:750) at ojb.broker.metadata.ClassDescriptor.getKeyValues(ClassDescriptor.java :639) at ojb.broker.Identity.<init>(Identity.java:111) at ojb.broker.singlevm.PersistenceBrokerImpl.store(PersistenceBrokerImpl .java:307) at com.ojb.userdetails.UserDetailsClient.addUserDetails(UserDetailsClien t.java:56) at com.ojb.userdetails.UserDetailsClient.main(UserDetailsClient.java:40) [DEFAULT] ERROR: OJB ERROR: Dont know how to autoincrement field class com.ojb.u serdetails.UserDetails._id java.lang.RuntimeException: OJB ERROR: Dont know how to autoincrement field clas s com.ojb.userdetails.UserDetails._id at ojb.broker.metadata.ClassDescriptor.getAutoIncrementValue(ClassDescri ptor.java:809) at ojb.broker.metadata.ClassDescriptor.getKeyValues(ClassDescriptor.java :639) at ojb.broker.Identity.<init>(Identity.java:111) at ojb.broker.singlevm.PersistenceBrokerImpl.store(PersistenceBrokerImpl .java:307) at com.ojb.userdetails.UserDetailsClient.addUserDetails(UserDetailsClien t.java:56) at com.ojb.userdetails.UserDetailsClient.main(UserDetailsClient.java:40) [DEFAULT] ERROR: OJB ERROR: Dont know how to autoincrement field class com.ojb.u serdetails.UserDetails._id OJB ERROR: Dont know how to autoincrement field class com.ojb.userdetails.UserDe tails._id at ojb.broker.metadata.ClassDescriptor.getKeyValues(ClassDescriptor.java :645) at ojb.broker.Identity.<init>(Identity.java:111) at ojb.broker.singlevm.PersistenceBrokerImpl.store(PersistenceBrokerImpl .java:307) at com.ojb.userdetails.UserDetailsClient.addUserDetails(UserDetailsClien t.java:56) at com.ojb.userdetails.UserDetailsClient.main(UserDetailsClient.java:40) ----- Persistence Broker Exp ------ OJB ERROR: Dont know how to autoincrement field class com.ojb.userdetails.UserDe tails._id at ojb.broker.Identity.<init>(Identity.java:119) at ojb.broker.singlevm.PersistenceBrokerImpl.store(PersistenceBrokerImpl .java:307) at com.ojb.userdetails.UserDetailsClient.addUserDetails(UserDetailsClien t.java:56) at com.ojb.userdetails.UserDetailsClient.main(UserDetailsClient.java:40) |
From: Thomas M. <tho...@ho...> - 2002-05-25 19:28:40
|
Hi Hoang, Hai wrote: > I've a few questions for OBJ community: > > 1. Does OJB supports uni-directional mapping for 1:n and n:m? Yes, please refer to tutorial3.html for details. > 2. Does OJB supports direct sql statement? this is useful for the case where > I've a complex query statement and I don't want to translate to complex qql > Yes. There is a QueryBySql Class that allows to use free-form SQL. OJB does also provide ReportQueries like TOPlink. (RepostQueries do not materialize persistent entity objects but return Object[] that contain the Column-values of a ResultSet row. See JavaDoc on ojb.broker.PersistenceBroker HTH, Thomas > Thanks > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Objectbridge-users mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-users > > > > |
From: Hoang, H. <Hai...@co...> - 2002-05-25 15:13:23
|
I've a few questions for OBJ community: 1. Does OJB supports uni-directional mapping for 1:n and n:m? 2. Does OJB supports direct sql statement? this is useful for the case where I've a complex query statement and I don't want to translate to complex qql Thanks |