org.hibernate.AnnotationException: com.xxx.yyy.AllocationId has no persistent id property

Hibernate JIRA | Jean Paul Ebejer | 1 decade ago
  1. 0

    Hi there @Hibernate (must be a pretty often repeated joke in here...) I have an @Embeddable object AllocationId which extends another @Embeddable object (GenericId). AllocationId, is simply a marker class and has NO attributes in it, while all attributes (String id; which I want to persist) are in GenericId (inherited in AllocationId). I get the following exception: org.hibernate.AnnotationException: com.xxx.yyy.AllocationId has no persistent id property at org.hibernate.cfg.AnnotationBinder.bindId(AnnotationBinder.java:1714) at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1171) at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:706) at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:452) at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:268) at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1039) at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1207) at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:154) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:844) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:382) at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:126) at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:264) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.jboss.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:102) at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289) at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245) at sun.reflect.GeneratedMethodAccessor144.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) Any Ideas ? Code snippets as follow: @Embeddable public final class AllocationId extends GenericId { // ... serial UID here - removed as considered somewhat sensitive ... /** * @param id */ public AllocationId(final String id) { super(id); } } @Embeddable public abstract class GenericId implements Serializable { /** * The actual Id */ protected String id; // THIS IS NOT BEING 'SEEN' AS INSIDE AllocationId /** * Constructor to create a generic Id. * Syntactic checks are performed here (not null and empty string) * * @param allocationId The allocation Id */ protected GenericId(final String id) { validate(id); this.id = id; } /** * Performs syntactic checking of the generic id * * @param id may not be null or empty "" */ private void validate(final String id) throws IllegalArgumentException { if (id == null) { throw new IllegalArgumentException("id cannot be null"); } if (id.trim().length() == 0) { throw new IllegalArgumentException("id cannot be length 0"); } } /** * @return the id */ public String getId() { return this.id; } @Override public String toString() { return getId(); } // some less interesting code here .equals overrides etc. } Let me know. Many Thanks - for your attention and for your GREAT product, Malta (MT).

    Hibernate JIRA | 1 decade ago | Jean Paul Ebejer
    org.hibernate.AnnotationException: com.xxx.yyy.AllocationId has no persistent id property
  2. 0

    Hi there @Hibernate (must be a pretty often repeated joke in here...) I have an @Embeddable object AllocationId which extends another @Embeddable object (GenericId). AllocationId, is simply a marker class and has NO attributes in it, while all attributes (String id; which I want to persist) are in GenericId (inherited in AllocationId). I get the following exception: org.hibernate.AnnotationException: com.xxx.yyy.AllocationId has no persistent id property at org.hibernate.cfg.AnnotationBinder.bindId(AnnotationBinder.java:1714) at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1171) at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:706) at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:452) at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:268) at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1039) at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1207) at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:154) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:844) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:382) at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:126) at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:264) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.jboss.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:102) at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289) at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245) at sun.reflect.GeneratedMethodAccessor144.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) Any Ideas ? Code snippets as follow: @Embeddable public final class AllocationId extends GenericId { // ... serial UID here - removed as considered somewhat sensitive ... /** * @param id */ public AllocationId(final String id) { super(id); } } @Embeddable public abstract class GenericId implements Serializable { /** * The actual Id */ protected String id; // THIS IS NOT BEING 'SEEN' AS INSIDE AllocationId /** * Constructor to create a generic Id. * Syntactic checks are performed here (not null and empty string) * * @param allocationId The allocation Id */ protected GenericId(final String id) { validate(id); this.id = id; } /** * Performs syntactic checking of the generic id * * @param id may not be null or empty "" */ private void validate(final String id) throws IllegalArgumentException { if (id == null) { throw new IllegalArgumentException("id cannot be null"); } if (id.trim().length() == 0) { throw new IllegalArgumentException("id cannot be length 0"); } } /** * @return the id */ public String getId() { return this.id; } @Override public String toString() { return getId(); } // some less interesting code here .equals overrides etc. } Let me know. Many Thanks - for your attention and for your GREAT product, Malta (MT).

    Hibernate JIRA | 1 decade ago | Jean Paul Ebejer
    org.hibernate.AnnotationException: com.xxx.yyy.AllocationId has no persistent id property
  3. 0

    No identifier specified for entity: (Object Relational Mapping forum at Coderanch)

    coderanch.com | 5 months ago
    org.hibernate.AnnotationException: No identifier specified for entity: com.eyepacs.ejb.entity.SClinicalCases
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    bidirectional hibernate relationship

    Stack Overflow | 7 years ago | ddejmek
    org.hibernate.AnnotationException: Illegal use of mappedBy on both sides of the relationship: at.irian.conference.domain.Registration.orderedProducts
  6. 0

    @OneToOne mapping does not work with @Inheritance

    Stack Overflow | 4 years ago | kateryna
    org.hibernate.AnnotationException: referencedColumnNames(ENTITY_ID) of setup.entities.Clinic.child1 referencing setup.entities.Child1 not mapped to a single property

    4 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.hibernate.AnnotationException

      com.xxx.yyy.AllocationId has no persistent id property

      at org.hibernate.cfg.AnnotationBinder.bindId()
    2. Hibernate
      Configuration.buildMappings
      1. org.hibernate.cfg.AnnotationBinder.bindId(AnnotationBinder.java:1714)
      2. org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1171)
      3. org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:706)
      4. org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:452)
      5. org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:268)
      6. org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1039)
      6 frames
    3. Hibernate EJB
      HibernatePersistence.createContainerEntityManagerFactory
      1. org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1207)
      2. org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:154)
      3. org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:844)
      4. org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:382)
      5. org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:126)
      5 frames
    4. org.jboss.ejb3
      PersistenceUnitDeployment.start
      1. org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:264)
      1 frame
    5. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:585)
      4 frames
    6. org.jboss.ejb3
      ServiceDelegateWrapper.startService
      1. org.jboss.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:102)
      1 frame
    7. JBoss Application Server System
      ServiceMBeanSupport.jbossInternalLifecycle
      1. org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
      2. org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
      2 frames
    8. Java RT
      DelegatingMethodAccessorImpl.invoke
      1. sun.reflect.GeneratedMethodAccessor144.invoke(Unknown Source)
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      2 frames