Skip to main content

[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"

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?
>


Back to the top