[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [eclipselink-users] JPA @Embeddable, containing foreign key, "must not reference the isolated class"
|
Found one similar posting to mine, but no resolution for it:
http://groups.google.com/group/javaee6-codecamp/browse_thread/thread/721889032219d008/e9ed7a37d37b63af?#e9ed7a37d37b63af
The error message seems to imply that Address ends up in the shared
(L2?) cache even when I try to define that L2 should not be used at
all with eclipselink.cache.shared.default=false. Why does this
happen...?
The same @Embeddable class is used in other entities as well, such as
(again, imaginary example)
@Entity
Warehouse {
@Embedded
private Address address
}
On Tue, Oct 26, 2010 at 9:18 AM, janne postilista
<jannepostilistat@xxxxxxxxx> wrote:
> Seems this is related to the fact that I have turned eclipselink L2 cache off:
>
> persistence.xml:
> <property name="eclipselink.cache.shared.default" value="false"/>
>
> when I remove this setting, the mapping works fine.
>
> What do I need to do to make this work when
> eclipselink.cache.shared.default=false (or is it possible)?
>
>
> On Mon, Oct 25, 2010 at 5:48 PM, janne postilista
> <jannepostilistat@xxxxxxxxx> wrote:
>> I'm trying to map a case like
>>
>> @Entity
>> Employer {
>> @Embedded
>> private Address address
>> }
>>
>>
>> @Embeddable
>> Address {
>> @ManyToOne
>> @JoinColumn(name="fofofof");
>> private City city
>> }
>>
>> @Entity
>> City
>>
>> (not my actual setup, but the same kind of structure)
>>
>> When I try to use this, I get error
>>
>> Exception [EclipseLink-195] (Eclipse Persistence Services -
>> 2.0.1.v20100213-r6600):
>> org.eclipse.persistence.exceptions.DescriptorException
>> Exception Description: The shared class com.zzz.Address must not
>> reference the isolated class com.zzz.City.
>> Mapping: org.eclipse.persistence.mappings.OneToOneMapping[city]
>> Descriptor: RelationalDescriptor(com.zzz.Address --> [DatabaseTable(EMPLOYER)])
>>
>> Is there anything I can do to make my Embeddable object have link to
>> another table?
>>
>