Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] JPA @Embeddable, containing foreign key, "must not reference the isolated class"

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