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
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
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
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
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
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
: 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
=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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
: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
]
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
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
[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
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
: 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
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
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
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
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
[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
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
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
36 matches
Mail list logo