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"

Hello Bart,

If you put the @Cache(shared=false) setting on the Entities directly and still get the issue, then it seems unrelated to the bug.  What is the exception you are getting, and what do the classes look like?

Best Regards,
Chris

On 08/12/2010 4:38 AM, Bart Kummel wrote:
Hi,

Could it be that this bug also occurs when using entities that have a @MappedSuperclass? I have two entities with a @OneToOne relationship. Both have their own @MappedSuperclass. I have set eclipselink.cache.shared.default to true. Both @MappedSuperclasses have @Cache(shared=false). I get the EclipseLink-195 error. I tried adding @Cache(shared=false) to the entity subclasses as well, but that doesn't make any difference.

Best regards,
Bart Kummel

On Tue, Oct 26, 2010 at 15:31, janne postilista <jannepostilistat@xxxxxxxxx> wrote:
voted

On Tue, Oct 26, 2010 at 3:49 PM, Christopher Delahunt
<christopher.delahunt@xxxxxxxxxx> wrote:
> This looks like the issue for bug
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=304868
>
> Please vote for it to have it fixed, and I believe it describes a
> workaround.
>
> Best Regards,
> Chris
>
> On 26/10/2010 2:32 AM, janne postilista wrote:
>
> 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?
>
>
>
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>
>
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>
>
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users



--
___________________________________________________________
Bart Kummel

Author of the book Apache MyFaces 1.2 Web Application Development
blog: BK | twitter: @bkummel

_______________________________________________ eclipselink-users mailing list eclipselink-users@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/eclipselink-users

Back to the top