Multitenancy and @EmbeddedId [message #965727] |
Wed, 31 October 2012 09:11  |
Eclipse User |
|
|
|
Hi,
Have simple entity with embeded ID:
@Entity
@Table(name = "customer", catalog = "db", schema = "")
@Multitenant(MultitenantType.SINGLE_TABLE)
@TenantDiscriminatorColumn(name = "tenant_id", contextProperty = "tenant.id", primaryKey = true)
@EmbeddedId
protected CustomerPK customerPK;
...
During start of application got errors:
Internal Exception: Exception [EclipseLink-7163] (Eclipse Persistence Services - 2.4.1.v20121003-ad44345): org.eclipse.persistence.exceptions.ValidationException
Exception Description: Entity class [class entity.Customer] has both an @EmbdeddedId (on attribute [customerPK]) and an @Id (on attribute []. Both ID types cannot be specified on the same entity.
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.createPredeployFailedPersistenceException(EntityManagerSetupImpl.java:1541)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:1532)
at org.eclipse.persistence.internal.jpa.deployment.JPAInitializer.callPredeploy(JPAInitializer.java:98)
at org.eclipse.persistence.jpa.PersistenceProvider.createEntityManagerFactory(PersistenceProvider.java:108)
The problem is, I have no @ID in my entity, so why eclipselink complains about that?
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05609 seconds