Re: 1-1 Relationship Both ways

2005-04-28 Thread Martin Kalén
Lemke, Wesley wrote: Our problem occurs when we save a GenericGroup. It will first save the ClientBillingInfo object, so it puts -1 in the generic_grp_id field of the client_billing table (We are using database generated keys). If I understand you correctly, your problem is that your DB will set

Re: 1-1 Relationship Both ways

2005-04-28 Thread Armin Waibel
Hi Wes, Lemke, Wesley wrote: We have a 1-1 Relationship between GenericGroup and ClientBillingInfo. We have the client_billing_id in the generic_group table and the generic_grp_id in the client_billing table, because we need to traverse this relationship in both directions. Our problem occurs when

RE: 1-1 Relationship Both ways

2005-04-28 Thread Lemke, Wesley
Thanks. I did use an after insert type solution to update the field. -Original Message- From: Martin Kalén [mailto:[EMAIL PROTECTED] Sent: Thursday, April 28, 2005 3:56 AM To: OJB Users List Subject: Re: 1-1 Relationship Both ways Lemke, Wesley wrote: Our problem occurs when we save

1-1 Relationship Both ways

2005-04-27 Thread Lemke, Wesley
We have a 1-1 Relationship between GenericGroup and ClientBillingInfo. We have the client_billing_id in the generic_group table and the generic_grp_id in the client_billing table, because we need to traverse this relationship in both directions. Our problem occurs when we save a GenericGroup

1:1 relationship won't use an outer join

2004-10-12 Thread Tom Acree
I am a newbie to OJB and having a problem getting a 1-1 relationship to use a single query outer join to load the class. I have the following basic example where I have a Person and Address where Address is referenced by the Person class. See the mapping at the bottom, it is pretty much straight

1-1 Relationship with single FK ??

2004-04-29 Thread Stefan Schlösser
Hi, I would like to model a one-to-one Relationship between 2 classes. For simplicity I would like to have a single FK in one of the classes only. Unfortunately OJB does not allow the definition of an inverse-foreign-key within the reference descriptor. How do I solve this ? I don't wish to

RE: 1-1 Relationship with single FK ??

2004-04-29 Thread Gelhar, Wallace Joseph
: Stefan Schlösser [mailto:[EMAIL PROTECTED] Sent: Thursday, April 29, 2004 5:49 AM To: OJB Users List Subject: 1-1 Relationship with single FK ?? Hi, I would like to model a one-to-one Relationship between 2 classes. For simplicity I would like to have a single FK in one of the classes only

Re: 1-1 Relationship with single FK ??

2004-04-29 Thread Stefan Schlösser
=Bar inverse-foreignkey field-ref=fooID / /reference-descriptor ... /class-descriptor Thoughts? Wally -Original Message- From: Stefan Schlösser [mailto:[EMAIL PROTECTED] Sent: Thursday, April 29, 2004 5:49 AM To: OJB Users List Subject: 1-1 Relationship with single FK ?? Hi, I would

Re: 1:1 relationship

2003-12-16 Thread LAURENT Stephane
08, 2003 6:54 PM Subject: RE: 1:1 relationship Hej Stephan -Original Message- reference-descriptor [...] foreignkey field-ref=fk_cust here, field-ref should not be xml-content but an attribute in the opening tag. /foreignkey /reference

RE: 1:1 relationship

2003-12-11 Thread Stephan Wannenwetsch
Hallo Olli, thanks for your reply, now it works better, but not as I want it. What I want was a bidirectional 1:1 relationship but this one is only unidirectional. I can get the BusinessPartner from the Customer but not the otherway round. Also the FK_CUST column in the DB is NULL but I'm

RE: 1:1 relationship

2003-12-11 Thread oliver . matz
Hallo Sephan, What I want was a bidirectional 1:1 relationship but this one is only unidirectional. I can get the BusinessPartner from the Customer but not the otherway round. Also the FK_CUST column in the DB is NULL but I'm not sure if I need such a column, because in my opinion the key

RE: 1:1 relationship

2003-12-11 Thread Gelhar, Wallace Joseph
should be added to the reference descriptor to allow the FK column to exist in either table in a 1-1 relationship. Try this... Public class Customer { protected List businessPartner; public Customer() { businessPartner = new ArrayList(); } public

1:1 relationship

2003-12-08 Thread Stephan Wannenwetsch
Hallo, I'm try to establish a 1:1 relationship between two object via a simple object reference. Imagine the following object modell Class BusinessPartner(); Integer bpid; Customer customer; Class Customer(); BusinessPartner businessParner; To establish a relationship

RE: 1:1 relationship

2003-12-08 Thread oliver . matz
Hej Stephan -Original Message- reference-descriptor [...] foreignkey field-ref=fk_cust here, field-ref should not be xml-content but an attribute in the opening tag. /foreignkey /reference-descriptor HTH, Olli

RE: optional 1:1 relationship and null proxies

2003-11-18 Thread oliver . matz
Hej Andrew, -Original Message- From: Andrew Geery [mailto:[EMAIL PROTECTED] If the reference exists, everything works perfectly: I can dereference like this person.getLegalName().getFirstName() [..] My questions are: 1) Should this method be changed to return a default value

optional 1:1 relationship and null proxies

2003-11-14 Thread Andrew Geery
I have an optional 1:1 relationship between two tables that I have mapped as a proxy reference: reference-descriptor name=legalName class-ref=test.BasicLegalName proxy=true foreignkey field-ref=id/ foreignkey field-ref=type/ /reference-descriptor

Prefetching a 1:1:1 relationship

2003-10-22 Thread Boyes, Carl
Hi, Is there a way within OJB to prefetch a 1:1:1 relationship? The contents of this email are confidential to the intended recipient at the email address to which it has been addressed. It may not be disclosed to or used by anyone other than this addressee, nor may it be copied in any way

Auto Update in 1:1 relationship

2003-10-16 Thread Sukesh Garg
Hi, I had a very interesting experience with ODMG .. ObjectA--ObjectB--ObjectC There is a one to one relationship between them. ObjectC is in the DB with pk=1. I then added ObjectA, with a reference to Object B. Object A and Object B get added successfully with Object B having a reference to

How to map optional 1:1 relationship

2003-10-15 Thread Boyes, Carl
Hi, I wish to map a 1:0..1 relationship between two objects. I've currently mapped it as a 1:1, but the when the foreign key reference is null an extra sql statement with a where condition of fkey = '' is generated. Any help with this would be very much appreciated. The contents of

RE: How to map optional 1:1 relationship

2003-10-15 Thread oliver . matz
Hello, -Original Message- From: Boyes, Carl [mailto:[EMAIL PROTECTED] I've currently mapped it as a 1:1, but the when the foreign key reference is null an extra sql statement with a where condition of fkey = '' is generated. this question has been asked fairly often (for

Re: How to map optional 1:1 relationship

2003-10-15 Thread Jakob Braeuchi
hi olli, carl, you should try to avoid primitives for fk columns. when you disconnect the reference ojb will not be able to correctly set the fk to null when using primitives ! later when loading the parent object it may contain a fk to a non materializable proxy. the samples are not a good

Re: RE : How to map optional 1:1 relationship

2003-10-15 Thread Jakob Braeuchi
Objet : Re: How to map optional 1:1 relationship hi olli, carl, you should try to avoid primitives for fk columns. when you disconnect the reference ojb will not be able to correctly set the fk to null when using primitives ! later when loading the parent object it may contain a fk to a non

RE: RE : How to map optional 1:1 relationship

2003-10-15 Thread oliver . matz
Hello, -Original Message- From: Emmanuel Dupont [mailto:[EMAIL PROTECTED] No '' should be done. Sample : INSERT INTO A (Apk, Bfk) VALUES ('100',''); It should be : INSERT INTO A (Apk) VALUES ('100'); This problem is addressed by another thread in this list (also started

RE : RE : How to map optional 1:1 relationship

2003-10-15 Thread Emmanuel Dupont
:51 À : [EMAIL PROTECTED] Objet : RE: RE : How to map optional 1:1 relationship Hello, -Original Message- From: Emmanuel Dupont [mailto:[EMAIL PROTECTED] No '' should be done. Sample : INSERT INTO A (Apk, Bfk) VALUES ('100',''); It should be : INSERT INTO A (Apk) VALUES

Antwort: RE: How to map optional 1:1 relationship

2003-10-15 Thread Gerhard . Grosse
] 15.10.2003 13:24 Bitte antworten an OJB Users List An: [EMAIL PROTECTED] Kopie: Thema: RE: How to map optional 1:1 relationship Hello, -Original Message- From: Boyes, Carl [mailto:[EMAIL PROTECTED] I've currently mapped it as a 1:1, but the when

RE : RE : RE : How to map optional 1:1 relationship

2003-10-15 Thread Emmanuel Dupont
octobre 2003 14:51 À : [EMAIL PROTECTED] Objet : RE: RE : How to map optional 1:1 relationship Hello, -Original Message- From: Emmanuel Dupont [mailto:[EMAIL PROTECTED] No '' should be done. Sample : INSERT INTO A (Apk, Bfk) VALUES ('100',''); It should be : INSERT INTO A (Apk

Re: Antwort: RE: How to map optional 1:1 relationship

2003-10-15 Thread Jakob Braeuchi
[EMAIL PROTECTED] 15.10.2003 13:24 Bitte antworten an OJB Users List An: [EMAIL PROTECTED] Kopie: Thema: RE: How to map optional 1:1 relationship Hello, -Original Message- From: Boyes, Carl [mailto:[EMAIL PROTECTED] I've currently mapped it as a 1:1

Re: Antwort: RE: How to map optional 1:1 relationship

2003-10-15 Thread Gerhard . Grosse
to map optional 1:1 relationship hi gerhard, imo this is already implemented. see PersistenceBrokerImpl#getReferencedObject: ... // BRJ: check if we have non null pk values // TBD we should also check primitives // to avoid creation of unmaterializable proxies

RE: Antwort: RE: How to map optional 1:1 relationship

2003-10-15 Thread Boyes, Carl
: Antwort: RE: How to map optional 1:1 relationship Hi Jakob, I just checked and you are right. Nevertheless I find a lot of statements like SELECT ... FROM ... WHERE id='' in my P6Spy logs, where id is a not nullable primary key. I was assuming these were generated from resolving references

Re: Antwort: RE: How to map optional 1:1 relationship

2003-10-15 Thread Jakob Braeuchi
List [EMAIL PROTECTED] Kopie: Thema: Re: Antwort: RE: How to map optional 1:1 relationship hi carl,gerhard, your right, fkValues may be null and thus a query will be fired. can you confirm this gerhard ? jakob Boyes, Carl wrote: Hi Jakob, Gerhard In ReferencePrefetcher

Re: Antwort: RE: How to map optional 1:1 relationship

2003-10-15 Thread Jakob Braeuchi
antworten an OJB Users List An: OJB Users List [EMAIL PROTECTED] Kopie: Thema: Re: Antwort: RE: How to map optional 1:1 relationship hi carl,gerhard, your right, fkValues may be null and thus a query will be fired. can you confirm this gerhard ? jakob Boyes, Carl wrote

RE: Antwort: RE: How to map optional 1:1 relationship

2003-10-15 Thread Boyes, Carl
Hi Jakob, I have implemented your code and it works wonderfully! Many thanks, Carl. -Original Message- From: Jakob Braeuchi [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 15, 2003 4:50 PM To: OJB Users List Subject: Re: Antwort: RE: How to map optional 1:1 relationship hi

Antwort: [Fwd: Re: Antwort: RE: How to map optional 1:1 relationship]

2003-10-15 Thread Gerhard . Grosse
Hi Jakob, Yes, your patch did the trick! No more selects with id = null. Thanks! Gerhard Jakob Braeuchi [EMAIL PROTECTED] 15.10.2003 17:56 An: [EMAIL PROTECTED] Kopie: Thema: [Fwd: Re: Antwort: RE: How to map optional 1:1 relationship] - Nachricht

Re: Antwort: RE: How to map optional 1:1 relationship

2003-10-15 Thread Jakob Braeuchi
[mailto:[EMAIL PROTECTED] Sent: Wednesday, October 15, 2003 4:50 PM To: OJB Users List Subject: Re: Antwort: RE: How to map optional 1:1 relationship hi gerhard, sorry, i posted to wrong code. this is it: protected void associateBatched(Collection owners, Collection children

RE : RE : How to map optional 1:1 relationship

2003-10-15 Thread Emmanuel Dupont
1:1 relationship salut emmanuel, imo the problem is not the sql. ojb will not 'null' the fk if it's a primitive. from class PersistentFieldDirectAccessImpl: public void doSet(Object obj, Object value) throws MetadataException { Field fld = getField(); Class type

Re: Adding A New Component With A 1:1 Relationship

2003-03-18 Thread Michael Duffy
Thomas, Of course you're correct. I'd added foreign key constraints to all my tables. Once I removed them, OJB did the INSERT and managed all the keys for me, as you said. I apologize for missing that subtlety. Should I also remove foreign key constraints on many-to-many tables? I've got