openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "KARR, DAVID (ATTSI)" <dk0...@att.com>
Subject How to map a one-to-one with a "condition"?
Date Fri, 11 Jun 2010 00:38:46 GMT
Using OpenJPA 1.2.2.

I have two tables called "FOO" and "BAR" with the following columns:

FOO
------
FOO_ID (PK)
JUNK

BAR
------
BAR_ID (PK)
FOO_ID
COND

I need to create a "bar" property in the "Foo" entity as a "one-to-one",
but I need the single BAR referenced from "Foo.bar" to be the BAR row
where "COND" is equal to a particular value.  I'll also have another
"one-to-one" on "Foo" called "otherbar", which refers to another BAR row
where "COND" is equal to another particular value.

I don't see an obvious way to do this in the mapping.

Mime
View raw message