objectbridge-users Mailing List for ObJectRelationalBridge (Page 3)
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: Mahler T. <tho...@it...> - 2002-06-04 07:52:16
|
Hi all, =20 after some minor problems I managed to assemble a new release. As I had to fix several bugs to get this release stable, I did not find = the time to keep the documentation up to date. In particular the documentation regarding the repository is out of sync = due to the redesigned repository.dtd. =20 Lasse Lindg=E5rd wrote a stylesheet to transform existing repositories = to the new syntax. I hope this will help users to migrate quickly! From the relase notes: Changes in Release 0.9 new features: - Servlet Implementation of PersistenceBrokerServer, allows to easily deploy the OJB Server as a normal Http-Servlet - JDO prototype and sample application. Cuurently we are using the bytecode enhancer from the JDO Reference Implementation. We are not allowed to ship the jdori.jar from SUN's reference implementation. If you play around with our JDO sample, just download jdori.jar from = SUN and add it to the ojb-0-9/lib directory! - complete redesign of the repository grammar. To help users to migrate their existing repository.xml files we provide a XSLT stylesheet (see ojb-0-9/src/test/test/ojb/0.8to0.9.xsl) - performance test-suite for the ODMG implementation - Full JTA and JCA integration! - PersistenceBroker interface now extends the org.odbms.ObjectContainer interface to provide a better integration for the S.O.D.A query API. bug fixes: - tons of bug fixes Refactorings: - performance enhancements - redesign of SqlGenerator - redesign of the build process, now using Torque and Maven - redesign of Repository parser - ConversionStrategies have been moved from the class-level to the field-level.=20 With this release we are feature complete for the 1.0 release! For 1.0 you should not expect more features to be added. In OJB 1.0 we will have more bug fixes, better documentation and we = will add the=20 prefix "org.apache" to all ojb packages to reflect our new home at = Jakarta. Important note: We did not yet change the documentation to reflect the changes to the repository.dtd. We will try to correct it asap. cheers, =20 Thomas =20 |
From: Govindarajan S (Gover) <gov...@az...> - 2002-06-04 07:06:56
|
HI, You havent attached your repository.xml you used for this, also u havent mentioned what type of relation is it between the object and the collections? i assume that it is m:n mapping. So just check if u have the auto.retrieve element in your repository.xml and the value that is set is true, something like this. <auto.retrieve>true</auto.retrieve> <auto.update>true</auto.update> inside your collection descriptor. hope this helps gover |
From: <Ste...@eu...> - 2002-06-04 06:53:47
|
Though the exception chaining is implemented in the PersistenceBrokerException class (it contains a source exception), we h= ave no debug information from the source exception (PersistenceBrokerExcept= ion doesn't override printStackTrace methods from java.lang.Throwable is no= t overridden). It can be done for example this way: public class PersistenceBrokerException extends RuntimeException { . . . public void printStackTrace() { super.printStackTrace(); Throwable cause =3D getSourceException(); if(cause !=3D null) { System.err.println("Caused by:"); cause.printStackTrace(); } } public void printStackTrace(java.io.PrintStream ps) { super.printStackTrace(ps); Throwable cause =3D getSourceException(); if (cause !=3D null) { ps.println("Caused by:"); cause.printStackTrace(ps); } } public void printStackTrace(java.io.PrintWriter pw) { super.printStackTrace(pw); Throwable cause =3D getSourceException(); if (cause !=3D null) { pw.println("Caused by:"); cause.printStackTrace(pw); } } } Stefan |--------+----------------------------------------------> | | Thomas Mahler | | | <tho...@ho...> | | | Odeslal: | | | obj...@li...urc| | | eforge.net | | | 04.06.2002 07:57 | | | | |--------+----------------------------------------------> >--------------------------------------------------------------------= ----------------------------| | = | | Komu: Arvind Gudipati <Arv...@PA...>, ojb = | | <obj...@li...> = | | Kopie: = | | P=F8edm=ECt: Re: [ojb-users] no help with exception messs= ages | | = | | = | >--------------------------------------------------------------------= ----------------------------| Hi Arvind, Arvind Gudipati wrote: > I was getting a ojb.broker.PersistenceBrokerSQLException on severa= l > occasion .. i had to debug the source files of OJB to find the reason= > that i was inserting NULLs to a NOT NULL column or the column name wa= s > not existing etc., > > I thought it would be helpful if when the exception is thrown, there = are > some helpful messages of what REALLY is the problem.. > > > Check out for example JdbcAccess.java line:153 the exception is simpl= e > consumed ... > Mhh, I don't know which method of JdbcAccess you are referring to, as I= have only new code than release 0.8.400 at hand. There should not be any place where exceptions are just consumend without deeper reason. typically exceptions are sometimes caught, converted to a PBException and then rethrown. In rare cases exceptions are just consumed. In those cases there should= be a comment why this is done. And typically those things are logged. hth, Thomas > Arvind > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ***********************************************************************= ****************** > 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 sole= ly > for the use of the individual or entity to whom they are addressed. A= ny > unauthorized direct or indirect dissemination, distribution or copyin= g > of this message and any attachments is strictly prohibited. If you ha= ve > received the E-mail in error please notify adm...@pa... = or > telephone (410) 910-3300. > ***********************************************************************= ***************** > _______________________________________________________________ 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-06-04 05:57:03
|
Hi Arvind, Arvind Gudipati wrote: > I was getting a ojb.broker.PersistenceBrokerSQLException on several > occasion .. i had to debug the source files of OJB to find the reason > that i was inserting NULLs to a NOT NULL column or the column name was > not existing etc., > > I thought it would be helpful if when the exception is thrown, there are > some helpful messages of what REALLY is the problem.. > > > Check out for example JdbcAccess.java line:153 the exception is simple > consumed ... > Mhh, I don't know which method of JdbcAccess you are referring to, as I have only new code than release 0.8.400 at hand. There should not be any place where exceptions are just consumend without deeper reason. typically exceptions are sometimes caught, converted to a PBException and then rethrown. In rare cases exceptions are just consumed. In those cases there should be a comment why this is done. And typically those things are logged. hth, Thomas > Arvind > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ***************************************************************************************** > 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-06-03 22:51:19
|
I was getting a ojb.broker.PersistenceBrokerSQLException on several occasion .. i had to debug the source files of OJB to find the reason that i was inserting NULLs to a NOT NULL column or the column name was not existing etc., I thought it would be helpful if when the exception is thrown, there are some helpful messages of what REALLY is the problem.. Check out for example JdbcAccess.java line:153 the exception is simple consumed ... Arvind **************************************************************************** ************* 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: Vullanki, S. <Sri...@co...> - 2002-06-03 15:30:17
|
Hi, I am unable to rehydrate an object, which has Collection objects in it ! I am getting all the normal data(ie., strings, integers etc.,) but the collections are not filled back in my object. Do i need to include the constructor which i am getting as warning!! Here is the what i am getting DEFAULT] WARN: Please define a public constructor for class com.co.engine.container. DataContainer with the following signature: (int, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String). It must initialize the classes persistent attributes. This is recommended to increase performance but it's not mandatory! [ojb.broker.accesslayer.RsIterator] ERROR: null and the object DataContainer is having all strings and integers populated back. but the vectors are all empty!! Thanks Srividya |
From: Govindarajan S (Gover) <gov...@az...> - 2002-06-03 13:29:41
|
Hi, I have a doubt regarding the mapping of an inheritance hierarchy. The first approach of mapping the entire inheritance hierarchy seems to be fine. Also i understand that OBJ supports 'Concrete Table inheritance mapping' ie mapping all concrete tables. My question is whether i can implement the 'Class table inheritance mapping' ie mapping all classes (including abstract classes)to individual tables. If yes how? One doubt i had is how to link a derived class 'D' with its parent class 'A'. Assume FootBall player class is inherited from Player and that player has an unique playerId. Now when u map the FootBall player to its corresponding table how will you write/read values from the Player table ? One of the white-papers suggested using foreignkey reference to the parent table. I understand that to implement this i would need to do a 1-1 mapping between the derived classes and the base class. But the way OBJ does 1-1 mapping u need to have a reference to the Base class in the derived class instance or vice-versa. This is where it hurts me, becoz what is the point in referring to the base class explicitly in a derived class? or iam missing some very obivious point here? I dont think i can use an external table for doing a 1-1 mapping between the Player table and Football player? gover |
From: Thomas M. <tho...@ho...> - 2002-05-31 18:50:09
|
Hi Matthew, Matthew baird wrote: > Dynamic Proxies are cool. FULL ACK ;-) > Having said that, they'd be even better if they knew when to > automatically materialize based on the proxy leaving the VM, as after > they leave they can't materialize :( > Sorry I'm too stupid! I read the last sentance several times but did not grok it... Is something not working in client/server mode? Or are you looking for an additional feature? Is this problem related to marshalling dynamic proxies objects to a remote client (RMI or EJB) ? If it is something like that, I think it could be done with OJB c/s mode: since shortly there is new implementation of the PersistenceBrokerServer, which can be deployed as a HTTP Servlet in your app server. Thus we don't need an proprietary server any more. Once the proxy object is sent to the client, the invocation handler (in our case the ojb.broker.accesslayer.IndirectionHandler has set its broker member to null, as it is marked transient. If a materialization is requested then, PersistenceBrokerFactory is asked to create a new broker instance. In C/S mode you will have a OJB.properties on the client, telling the PersistenceBrokerFactory to not use a "normal" PersistenceBroker, but a PersistenceBrokerClient, that operates a PeristenceBroker-proxy, delegating all calls to the Servlet. This scenario is explained here: http://objectbridge.sourceforge.net/system/clientserver.html I hope I got you right ! cheers, Thomas > Any ideas on how to do this? I'm looking at externalizable interface, > but no real thoughts are surfacing... > > > ------------------------------------------------------------------------ > *Do You Yahoo!?* > Yahoo! <http://rd.yahoo.com/welcome/*http://fifaworldcup.yahoo.com> - > Official partner of 2002 FIFA World Cup |
From: Matthew b. <mat...@ya...> - 2002-05-31 16:37:22
|
it would be easy enough to make a new type of dynamic proxy called the "RemoteableDynamicProxy" or something like that. "Ebersole, Steven" <ste...@vi...> wrote: I would warn that this has the potential to be extremely expensive for those of us with non-simple schemas/domain-models. ******************************************** Steve Ebersole IT Integration Engineer Vignette Corporation 512.741.4195 Visit http://www.vignette.com ******************************************** -----Original Message----- From: Matthew baird [mailto:mat...@ya...] Sent: Friday, May 31, 2002 11:20 AM To: obj...@li... Subject: [ojb-users] Dynamic Proxies Dynamic Proxies are cool. Having said that, they'd be even better if they knew when to automatically materialize based on the proxy leaving the VM, as after they leave they can't materialize :( Any ideas on how to do this? I'm looking at externalizable interface, but no real thoughts are surfacing... --------------------------------- Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup --------------------------------- Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup |
From: Ebersole, S. <ste...@vi...> - 2002-05-31 16:29:41
|
I would warn that this has the potential to be extremely expensive for those of us with non-simple schemas/domain-models. ******************************************** Steve Ebersole IT Integration Engineer Vignette Corporation 512.741.4195 Visit http://www.vignette.com <http://www.vignette.com/> ******************************************** -----Original Message----- From: Matthew baird [mailto:mat...@ya...] Sent: Friday, May 31, 2002 11:20 AM To: obj...@li... Subject: [ojb-users] Dynamic Proxies Dynamic Proxies are cool. Having said that, they'd be even better if they knew when to automatically materialize based on the proxy leaving the VM, as after they leave they can't materialize :( Any ideas on how to do this? I'm looking at externalizable interface, but no real thoughts are surfacing... _____ Do You Yahoo!? Yahoo! <http://rd.yahoo.com/welcome/*http://fifaworldcup.yahoo.com> - Official partner of 2002 FIFA World Cup |
From: Matthew b. <mat...@ya...> - 2002-05-31 16:20:21
|
Dynamic Proxies are cool. Having said that, they'd be even better if they knew when to automatically materialize based on the proxy leaving the VM, as after they leave they can't materialize :( Any ideas on how to do this? I'm looking at externalizable interface, but no real thoughts are surfacing... --------------------------------- Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup |
From: Matthew b. <mat...@ya...> - 2002-05-31 15:38:11
|
As for the JCA and JTA stuff, I could help out with some sample code. However, I do not have the code including any JTA or JCA components. By what tag do I need to do a check-out to get that code (is it HEAD, or 4_0)? But seeing as how I haven't even seen the code for it, I am not sure I would be the right one to write up any sort of documentation. JCA stuff was added a while ago, hasn't gone out as an official part of OJB yet I believe. So, it is HEAD. To what extent does the JCA code go? I mean, is it just the JTA piece for connecting to transaction managers or is it a "full-fledged" attempt to allow OJB to be plugged into containers as the persistence engine? JCA code allows you to plug OJB into app server and use either persistencebroker or odmg. I haven't worked on this in a while, as there are other OJB bugs holding up our transition. As soon as I finish those, I'm back on JCA. --------------------------------- Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup |
From: Ebersole, S. <ste...@vi...> - 2002-05-31 13:57:01
|
Was the fix to add in the indirection table? Do you know as of what project version that was done? ******************************************** Steve Ebersole IT Integration Engineer Vignette Corporation 512.741.4195 Visit http://www.vignette.com ******************************************** -----Original Message----- From: Jakob Braeuchi [mailto:jbr...@ho...] Sent: Friday, May 31, 2002 8:51 AM To: Ebersole, Steven; obj...@li... Subject: Re: [ojb-users] proxied collections and non-decomposed m:n relati onships hi steven, i remeber i fixed a problem in SqlGenerator in the count(*) when dealing with m:n. yes, here it is: Revision 1.3 / (view) - annotate - [select for diffs] , Wed Apr 24 06:53:11 2002 UTC (5 weeks, 2 days ago) by brj Branch: MAIN Changes since 1.2: +11 -3 lines Diff to previous 1.2 fix for count-statement with M:N Criteria jakob ----- Original Message ----- From: "Ebersole, Steven" <ste...@vi...> To: "'Jakob Braeuchi'" <jbr...@ho...>; <obj...@li...> Sent: Friday, May 31, 2002 3:19 PM Subject: RE: [ojb-users] proxied collections and non-decomposed m:n relati onships > With proxy: > > SELECT COUNT(*) > FROM ADDR_TYPE_LU > WHERE (ADDR_ID= ? ) > AND ADDR_ADDR_TYPE_JT.ADDR_TYPE_ID=ADDR_TYPE_LU.ADDR_TYPE_ID > > > Without proxy: > > SELECT ADDR_TYPE_LU.ADDR_TYPE_ID, > ADDR_TYPE_LU.ACTIVE_FLG, > ADDR_TYPE_LU.CRTD_BY, > ADDR_TYPE_LU.CRTD_DT, > ADDR_TYPE_LU.CHGD_BY, > ADDR_TYPE_LU.CHGD_DT, > ADDR_TYPE_LU.NAME, > ADDR_TYPE_LU.OPT_ORDER > FROM ADDR_TYPE_LU, > ADDR_ADDR_TYPE_JT > WHERE (ADDR_ID= ? ) > AND ADDR_ADDR_TYPE_JT.ADDR_TYPE_ID=ADDR_TYPE_LU.ADDR_TYPE_ID > > > Mapping: > > <CollectionDescriptor id="1"> > <cdfield.name>addressTypes</cdfield.name> > <!-- > <proxyCollection>true</proxyCollection> > --> > > <items.class>com.vignette.it.apps.dbapi.domain.AddressTypeDO</items.class> > <indirection_table>ADDR_ADDR_TYPE_JT</indirection_table> > <fks_pointing_to_this_class>ADDR_ID</fks_pointing_to_this_class> > > <fks_pointing_to_items_class>ADDR_TYPE_ID</fks_pointing_to_items_class> > </CollectionDescriptor> > > > So basically, when I specify a collection proxy, the code is not grabbing > the indirection table from the mapping to add into the SQL FROM clause. > > I am using 0.8.375 version of OJB, so maybe this is something which has > since been taken care of. > > > > ******************************************** > Steve Ebersole > IT Integration Engineer > Vignette Corporation > 512.741.4195 > > Visit http://www.vignette.com > > ******************************************** > > > -----Original Message----- > From: Jakob Braeuchi [mailto:jbr...@ho...] > Sent: Friday, May 31, 2002 7:49 AM > To: Thomas Mahler; Ebersole, Steven > Cc: obj...@li... > Subject: Re: [ojb-users] proxied collections and non-decomposed m:n > relationships > > > hi steven, > > can you please provide the generated sql with and without proxy ? > > jakob > > > ----- Original Message ----- > From: "Thomas Mahler" <tho...@ho...> > To: "Ebersole, Steven" <ste...@vi...> > Cc: <obj...@li...> > Sent: Friday, May 31, 2002 2:21 PM > Subject: Re: [ojb-users] proxied collections and non-decomposed m:n > relationships > > > > Hi Steven, > > > > Ebersole, Steven wrote: > > > > > 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? > > > > > > > > > Mhh, I don't think that this is implemented yet. > > We should as Jakob Braeuchli, who implemented this feature... > > > > > > > > > > > > > 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. > > > > > > Sure, this is a must, as The List interface is supported everywhere > > else. implementing this won't be too difficult. > > > > > > > > > > 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. > > > > > > > > > AFAIK JTA and JCA stuff are completed. But it would be good to have more > > Examplecode and documentation on these feature > > > > Thanks for your offer to help! > > > > cheers, > > > > Thomas > > > > > > > > > > > > > > > > ******************************************** > > > 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 > > > > > > > > > > > > > > > > > > > > _______________________________________________________________ > > > > 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 > > > > _______________________________________________________________ > > 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-31 13:50:40
|
hi steven, i remeber i fixed a problem in SqlGenerator in the count(*) when dealing with m:n. yes, here it is: Revision 1.3 / (view) - annotate - [select for diffs] , Wed Apr 24 06:53:11 2002 UTC (5 weeks, 2 days ago) by brj Branch: MAIN Changes since 1.2: +11 -3 lines Diff to previous 1.2 fix for count-statement with M:N Criteria jakob ----- Original Message ----- From: "Ebersole, Steven" <ste...@vi...> To: "'Jakob Braeuchi'" <jbr...@ho...>; <obj...@li...> Sent: Friday, May 31, 2002 3:19 PM Subject: RE: [ojb-users] proxied collections and non-decomposed m:n relati onships > With proxy: > > SELECT COUNT(*) > FROM ADDR_TYPE_LU > WHERE (ADDR_ID= ? ) > AND ADDR_ADDR_TYPE_JT.ADDR_TYPE_ID=ADDR_TYPE_LU.ADDR_TYPE_ID > > > Without proxy: > > SELECT ADDR_TYPE_LU.ADDR_TYPE_ID, > ADDR_TYPE_LU.ACTIVE_FLG, > ADDR_TYPE_LU.CRTD_BY, > ADDR_TYPE_LU.CRTD_DT, > ADDR_TYPE_LU.CHGD_BY, > ADDR_TYPE_LU.CHGD_DT, > ADDR_TYPE_LU.NAME, > ADDR_TYPE_LU.OPT_ORDER > FROM ADDR_TYPE_LU, > ADDR_ADDR_TYPE_JT > WHERE (ADDR_ID= ? ) > AND ADDR_ADDR_TYPE_JT.ADDR_TYPE_ID=ADDR_TYPE_LU.ADDR_TYPE_ID > > > Mapping: > > <CollectionDescriptor id="1"> > <cdfield.name>addressTypes</cdfield.name> > <!-- > <proxyCollection>true</proxyCollection> > --> > > <items.class>com.vignette.it.apps.dbapi.domain.AddressTypeDO</items.class> > <indirection_table>ADDR_ADDR_TYPE_JT</indirection_table> > <fks_pointing_to_this_class>ADDR_ID</fks_pointing_to_this_class> > > <fks_pointing_to_items_class>ADDR_TYPE_ID</fks_pointing_to_items_class> > </CollectionDescriptor> > > > So basically, when I specify a collection proxy, the code is not grabbing > the indirection table from the mapping to add into the SQL FROM clause. > > I am using 0.8.375 version of OJB, so maybe this is something which has > since been taken care of. > > > > ******************************************** > Steve Ebersole > IT Integration Engineer > Vignette Corporation > 512.741.4195 > > Visit http://www.vignette.com > > ******************************************** > > > -----Original Message----- > From: Jakob Braeuchi [mailto:jbr...@ho...] > Sent: Friday, May 31, 2002 7:49 AM > To: Thomas Mahler; Ebersole, Steven > Cc: obj...@li... > Subject: Re: [ojb-users] proxied collections and non-decomposed m:n > relationships > > > hi steven, > > can you please provide the generated sql with and without proxy ? > > jakob > > > ----- Original Message ----- > From: "Thomas Mahler" <tho...@ho...> > To: "Ebersole, Steven" <ste...@vi...> > Cc: <obj...@li...> > Sent: Friday, May 31, 2002 2:21 PM > Subject: Re: [ojb-users] proxied collections and non-decomposed m:n > relationships > > > > Hi Steven, > > > > Ebersole, Steven wrote: > > > > > 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? > > > > > > > > > Mhh, I don't think that this is implemented yet. > > We should as Jakob Braeuchli, who implemented this feature... > > > > > > > > > > > > > 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. > > > > > > Sure, this is a must, as The List interface is supported everywhere > > else. implementing this won't be too difficult. > > > > > > > > > > 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. > > > > > > > > > AFAIK JTA and JCA stuff are completed. But it would be good to have more > > Examplecode and documentation on these feature > > > > Thanks for your offer to help! > > > > cheers, > > > > Thomas > > > > > > > > > > > > > > > > ******************************************** > > > 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 > > > > > > > > > > > > > > > > > > > > _______________________________________________________________ > > > > 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 > > > > _______________________________________________________________ > > 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-31 13:44:43
|
hi steven, thomas proxy collection works for me with m:n relationships, but i found and fixed a problem with extents. jakob ----- Original Message ----- From: "Thomas Mahler" <tho...@ho...> To: "Ebersole, Steven" <ste...@vi...> Cc: <obj...@li...> Sent: Friday, May 31, 2002 2:21 PM Subject: Re: [ojb-users] proxied collections and non-decomposed m:n relationships > Hi Steven, > > Ebersole, Steven wrote: > > > 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? > > > > > Mhh, I don't think that this is implemented yet. > We should as Jakob Braeuchli, who implemented this feature... > > > > > > > > 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. > > > Sure, this is a must, as The List interface is supported everywhere > else. implementing this won't be too difficult. > > > > > > 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. > > > > > AFAIK JTA and JCA stuff are completed. But it would be good to have more > Examplecode and documentation on these feature > > Thanks for your offer to help! > > cheers, > > Thomas > > > > > > > > > > ******************************************** > > 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 > > > > > > > > > > > > _______________________________________________________________ > > 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-31 13:20:34
|
With proxy: SELECT COUNT(*) FROM ADDR_TYPE_LU WHERE (ADDR_ID= ? ) AND ADDR_ADDR_TYPE_JT.ADDR_TYPE_ID=ADDR_TYPE_LU.ADDR_TYPE_ID Without proxy: SELECT ADDR_TYPE_LU.ADDR_TYPE_ID, ADDR_TYPE_LU.ACTIVE_FLG, ADDR_TYPE_LU.CRTD_BY, ADDR_TYPE_LU.CRTD_DT, ADDR_TYPE_LU.CHGD_BY, ADDR_TYPE_LU.CHGD_DT, ADDR_TYPE_LU.NAME, ADDR_TYPE_LU.OPT_ORDER FROM ADDR_TYPE_LU, ADDR_ADDR_TYPE_JT WHERE (ADDR_ID= ? ) AND ADDR_ADDR_TYPE_JT.ADDR_TYPE_ID=ADDR_TYPE_LU.ADDR_TYPE_ID Mapping: <CollectionDescriptor id="1"> <cdfield.name>addressTypes</cdfield.name> <!-- <proxyCollection>true</proxyCollection> --> <items.class>com.vignette.it.apps.dbapi.domain.AddressTypeDO</items.class> <indirection_table>ADDR_ADDR_TYPE_JT</indirection_table> <fks_pointing_to_this_class>ADDR_ID</fks_pointing_to_this_class> <fks_pointing_to_items_class>ADDR_TYPE_ID</fks_pointing_to_items_class> </CollectionDescriptor> So basically, when I specify a collection proxy, the code is not grabbing the indirection table from the mapping to add into the SQL FROM clause. I am using 0.8.375 version of OJB, so maybe this is something which has since been taken care of. ******************************************** Steve Ebersole IT Integration Engineer Vignette Corporation 512.741.4195 Visit http://www.vignette.com ******************************************** -----Original Message----- From: Jakob Braeuchi [mailto:jbr...@ho...] Sent: Friday, May 31, 2002 7:49 AM To: Thomas Mahler; Ebersole, Steven Cc: obj...@li... Subject: Re: [ojb-users] proxied collections and non-decomposed m:n relationships hi steven, can you please provide the generated sql with and without proxy ? jakob ----- Original Message ----- From: "Thomas Mahler" <tho...@ho...> To: "Ebersole, Steven" <ste...@vi...> Cc: <obj...@li...> Sent: Friday, May 31, 2002 2:21 PM Subject: Re: [ojb-users] proxied collections and non-decomposed m:n relationships > Hi Steven, > > Ebersole, Steven wrote: > > > 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? > > > > > Mhh, I don't think that this is implemented yet. > We should as Jakob Braeuchli, who implemented this feature... > > > > > > > > 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. > > > Sure, this is a must, as The List interface is supported everywhere > else. implementing this won't be too difficult. > > > > > > 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. > > > > > AFAIK JTA and JCA stuff are completed. But it would be good to have more > Examplecode and documentation on these feature > > Thanks for your offer to help! > > cheers, > > Thomas > > > > > > > > > > ******************************************** > > 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 > > > > > > > > > > > > _______________________________________________________________ > > 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-31 13:03:42
|
For the List stuff, I agree it will be easy to do seeing as how most of the work has already been done in the CollectionProxy class. What was your thinking on how to decide which to return? Should it just always return the ListProxy? I will work on this this weekend. As for the JCA and JTA stuff, I could help out with some sample code. However, I do not have the code including any JTA or JCA components. By what tag do I need to do a check-out to get that code (is it HEAD, or 4_0)? But seeing as how I haven't even seen the code for it, I am not sure I would be the right one to write up any sort of documentation. To what extent does the JCA code go? I mean, is it just the JTA piece for connecting to transaction managers or is it a "full-fledged" attempt to allow OJB to be plugged into containers as the persistence engine? ******************************************** 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 31, 2002 7:21 AM To: Ebersole, Steven Cc: obj...@li... Subject: Re: [ojb-users] proxied collections and non-decomposed m:n relationships Hi Steven, Ebersole, Steven wrote: > 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? > Mhh, I don't think that this is implemented yet. We should as Jakob Braeuchli, who implemented this feature... > > > 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. Sure, this is a must, as The List interface is supported everywhere else. implementing this won't be too difficult. > > 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. > AFAIK JTA and JCA stuff are completed. But it would be good to have more Examplecode and documentation on these feature Thanks for your offer to help! cheers, Thomas > > > > ******************************************** > 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: Jakob B. <jbr...@ho...> - 2002-05-31 12:49:00
|
hi steven, can you please provide the generated sql with and without proxy ? jakob ----- Original Message ----- From: "Thomas Mahler" <tho...@ho...> To: "Ebersole, Steven" <ste...@vi...> Cc: <obj...@li...> Sent: Friday, May 31, 2002 2:21 PM Subject: Re: [ojb-users] proxied collections and non-decomposed m:n relationships > Hi Steven, > > Ebersole, Steven wrote: > > > 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? > > > > > Mhh, I don't think that this is implemented yet. > We should as Jakob Braeuchli, who implemented this feature... > > > > > > > > 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. > > > Sure, this is a must, as The List interface is supported everywhere > else. implementing this won't be too difficult. > > > > > > 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. > > > > > AFAIK JTA and JCA stuff are completed. But it would be good to have more > Examplecode and documentation on these feature > > Thanks for your offer to help! > > cheers, > > Thomas > > > > > > > > > > ******************************************** > > 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 > > > > > > > > > > > > _______________________________________________________________ > > 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-31 12:20:57
|
Hi Steven, Ebersole, Steven wrote: > 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? > Mhh, I don't think that this is implemented yet. We should as Jakob Braeuchli, who implemented this feature... > > > 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. Sure, this is a must, as The List interface is supported everywhere else. implementing this won't be too difficult. > > 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. > AFAIK JTA and JCA stuff are completed. But it would be good to have more Examplecode and documentation on these feature Thanks for your offer to help! cheers, Thomas > > > > ******************************************** > 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: Thomas M. <tho...@ho...> - 2002-05-31 09:39:01
|
Hi all Govindarajan S (Gover) wrote: > HI, > Thanx for yr answer. While working through the tutorial:3 i found an > addition to the repository.xml which would do this persistence by > reachability. > <auto.retrieve>true</auto.retrieve> > <auto.update>false</auto.update> > <auto.delete>false</auto.delete> > Adding the above set of elements to your mapping would persist all dependent > objects aswell. > The OJB PersistenceBroker also provides persistence by reachability, sure. but use this feature in the PB API you'll have to change the above mentioned flags to <auto.retrieve>true</auto.retrieve> <auto.update>true</auto.update> <auto.delete>true</auto.delete> > I agree with your second observation aswell. Since there isnt a direct > mapping of the roles table in case of non-decomposed mapping, there are > cases when your mapping table is filled partially. Take the case of > PERSON_PROJECT, which has the > * PERSON_ID > * PROJECT_ID > * ROLE_NAME > With the non-decomposed mapping where u have mapped only the PERSON_ID and > PROJECT_ID in the ClassDescriptor mapping for PERSON and PROJECT when we try > to add a person who has a project associated with him, the ROLE_NAME field > is NULL and the Broker comes back with an error message as below, > > [DEFAULT] ERROR: 1, > Acme, > Acme Systems Inc., > int, > java.lang.String, > java.lang.String, > > this would probably have a wider implication. > > I havent looked at fully the ODMG spec, maybe that can help here. > > gover > > -----Original Message----- > From: Domagoj Jugovic [mailto:do...@la...] > Sent: Wednesday, May 29, 2002 7:16 PM > To: Govindarajan R S > Subject: Re: [ojb-users] Storing mapped objects > > > As I red the tutorials only ODMG implementation supports "persistence by > reachability" , so try with ODMG api. > That's not true! (see my statement above) > This leaves one question , OK, it's no problem to save the objects manualy, > but how to save data in "association table" in non-decomposed m:n mapping > (tutorial3 - Support for non-decomposed . . . .). OJB is doing this for you ! There are several testcases proving that this works! > In this case there is no concrete mapping for the "association table", so > OJB could only update that table by looking at new objects in Collection > specified by CollectionDescriptor. That's exactly what happens internally! > But if OJB doesn't look in that > Collection it seems inpossible to insert data in that table without > implicit mapping for "association table"?? Why do think OJB does not do this? Hey, this is an *open source* project. One short look at the source code of the respective testcases or stepping through the debugger will help you more than all these speculations! > 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. you'll have to set <auto.update>true</auto.update> on the respective Reference- and CollectionDescriptors. It's explained here: http://objectbridge.sourceforge.net/tutorial3.html#cascading Again there is no need for "doubts". All those features are regression tested. HTH, Thomas > > 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 > > _______________________________________________________________ > > 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-31 09:25:24
|
Hi Stefan, Stefan Tamasi wrote: > Hello all. > > > > I am just evaluating OJB. Does it supports something like "Aggregate > object mappings" in Toplink. (Parent object owns referenced object, and > all referenced object attributes are mapped to the same table to which > parent object attributes are mapped). > Yes, that's possible. OJB provides "RowReaders" (http://objectbridge.sourceforge.net/tutorial3.html#rowreaders), that allow to build such aggregate mappings. It's not as elegant as with TopLink, but it will safe you a lot of money :-) See: http://objectbridge.sourceforge.net/tutorial3.html#rowreader-example for an example. cheers, Thomas > > > Thnx Stefan > |
From: Thomas M. <tho...@ho...> - 2002-05-31 09:16:48
|
Hi Joerg, Mhh, this is a starange behaviour, as there are testcase, that prrof that automatic assignment works. Also, your mapping seems OK! You could try the following: set <autoincrement>true</autoincrement> in the mapping of the primary key of EObject. before storing your eObject, just compute its Identity by Identity oid = new Identity(eObject); now eObjects primary is set! than store eObject. I hope this will solve your problem, Thomas Jörg Benne wrote: > 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 > > > > _______________________________________________________________ > > 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-31 05:40:28
|
HI, Thanx for yr answer. While working through the tutorial:3 i found an addition to the repository.xml which would do this persistence by reachability. <auto.retrieve>true</auto.retrieve> <auto.update>false</auto.update> <auto.delete>false</auto.delete> Adding the above set of elements to your mapping would persist all dependent objects aswell. I agree with your second observation aswell. Since there isnt a direct mapping of the roles table in case of non-decomposed mapping, there are cases when your mapping table is filled partially. Take the case of PERSON_PROJECT, which has the * PERSON_ID * PROJECT_ID * ROLE_NAME With the non-decomposed mapping where u have mapped only the PERSON_ID and PROJECT_ID in the ClassDescriptor mapping for PERSON and PROJECT when we try to add a person who has a project associated with him, the ROLE_NAME field is NULL and the Broker comes back with an error message as below, [DEFAULT] ERROR: 1, Acme, Acme Systems Inc., int, java.lang.String, java.lang.String, this would probably have a wider implication. I havent looked at fully the ODMG spec, maybe that can help here. gover -----Original Message----- From: Domagoj Jugovic [mailto:do...@la...] Sent: Wednesday, May 29, 2002 7:16 PM To: Govindarajan R S Subject: Re: [ojb-users] Storing mapped objects As I red the tutorials only ODMG implementation supports "persistence by reachability" , so try with ODMG api. This leaves one question , OK, it's no problem to save the objects manualy, but how to save data in "association table" in non-decomposed m:n mapping (tutorial3 - Support for non-decomposed . . . .). In this case there is no concrete mapping for the "association table", so OJB could only update that table by looking at new objects in Collection specified by CollectionDescriptor. But if OJB doesn't look in that Collection it seems inpossible to insert data in that table without implicit mapping for "association table"?? 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 |
From: Stefan T. <pi...@ho...> - 2002-05-30 21:02:43
|
Hello all. I am just evaluating OJB. Does it supports something like "Aggregate = object mappings" in Toplink. (Parent object owns referenced object, and = all referenced object attributes are mapped to the same table to which = parent object attributes are mapped). Thnx Stefan |
From: <jo...@ga...> - 2002-05-30 20:18:46
|
Hi, yu didn't post your mapping but I guess you've forgotten so set <auto.update>true</auto.update>, am I right? (See OJB-tutorial "1:n mappings" for details) Joerg 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 |