Community
Participate
Working Groups
Build Identifier: 2.1.1.v20100817-r8050 I've got an entity with a primary key annotated with org.jetbrains' NotNull annotation. When I deploy this code, EclipseLink fails to find a primary key in the entity. Removing the @NotNull fixes this issue. Code: @Entity public class Promotion implements Serializable { @Id @NotNull private final String name; ... } Exception: Exception Description: Entity class [class net.link.redbutton.server.scheduler.data.Promotion] has no primary key specified. It should define either an @Id, @EmbeddedId or an @IdClass. If you have defined PK using any of these annotations then make sure that you do not have mixed access-type (both fields and properties annotated) in your entity class hierarchy. at org.eclipse.persistence.exceptions.ValidationException.noPrimaryKeyAnnotationsFound(ValidationException.java:1374) [eclipselink-2.1.1.jar:2.1.1.v20100817-r8050] at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.validatePrimaryKey(EntityAccessor.java:1366) [eclipselink-2.1.1.jar:2.1.1.v20100817-r8050] at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.processAccessors(EntityAccessor.java:885) [eclipselink-2.1.1.jar:2.1.1.v20100817-r8050] at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.process(EntityAccessor.java:691) [eclipselink-2.1.1.jar:2.1.1.v20100817-r8050] at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.processStage2(MetadataProject.java:1531) [eclipselink-2.1.1.jar:2.1.1.v20100817-r8050] at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.processORMMetadata(MetadataProcessor.java:474) [eclipselink-2.1.1.jar:2.1.1.v20100817-r8050] at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:441) [eclipselink-2.1.1.jar:2.1.1.v20100817-r8050] at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:959) [eclipselink-2.1.1.jar:2.1.1.v20100817-r8050] ... 31 common frames omitted Reproducible: Always Steps to Reproduce: 1. Make a valid entity class. 2. Put @NotNull or @Nullable from org.jetbrains.annotations on the @Id 3. Open a persistence session.
Duplicate of Bug 324862?
Seems unlikely; I'm not seeing any IndexOutOfBounds exception, for one.
Bug 324408? The common denominator is @Retention(RetentionPolicy.CLASS) (http://grepcode.com/file/repository.jboss.com/maven2/org.jetbrains/annotations/7.0.2/org/jetbrains/annotations/NotNull.java)
Yup; looks like that'd be it.
*** This bug has been marked as a duplicate of bug 324408 ***
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink