openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Get "but this mapping cannot have columns in this context" for one-to-one with a join table
Date Fri, 04 Jun 2010 18:10:10 GMT
Using OpenJPA 1.2.2 (I can't upgrade to 2.x).

I had a one-to-many with a join table that appears to be working.

I now have to implement a similar relationship, except as a one-to-one
(the one-to-many apparently only ever has a single object on the "many"
side, and I'm finding I need to exploit that).

I copied the "one-to-many" definition in the xml and just changed it to
"one-to-one".  I added the property to the domain class.  When I compile
this, I get the following error:

'You have supplied columns for "...Sku.parentProduct<element:class
java.lang.Object>", but this mapping cannot have columns in this

Searching for this error, I found other people have run into it, but it
seems like it usually happens when you try to use a "join-column"
without a "join-table".  That is not the case here.

Could I work around this by defining the join table as a
"secondary-table" and just specify a "join-column" in the "one-to-one"?
This appears to get past my trivial unit tests.

View raw message