Uploaded image for project: 'Application Server 7'
  1. Application Server 7
  2. AS7-1234

Hibernate does not read/use metadata for orm.xml defined entites

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Major
    • 7.0.0.Final
    • 7.0.0.Beta1, 7.0.0.Beta3, 7.0.0.CR1, 7.0.0.Final, 7.0.1.Final
    • JPA / Hibernate
    • None
    • Hide

      package any entity you have in jar, and then make this jar as as7 module.
      in your war application define manfiest.mf dependency on that module
      in orm.xml of you application define

      <entity class="my.package.EntityClass"/>
      

      try to run application

      Show
      package any entity you have in jar, and then make this jar as as7 module. in your war application define manfiest.mf dependency on that module in orm.xml of you application define <entity class= "my.package.EntityClass" /> try to run application

    Description

      I have setup where we have "common" entities defined in global lib/module that application(war/ear) in then dependent on.
      Then I declare this entities in orm.xml of my application just by class name.

      for instance:

      <entity class="com.company.module.Article"/>
      <entity class="com.company.module.Binary"/>
      <entity class="com.company.module.Category"/>
      

      Up until as7/hibernate 4 this worked with no problems, but now it dies with exception "no id defined on entity Article". If I defined id in orm.xml it then finds id field but fails to find anything that is annotated on classes.
      It looks like metadata is not read for this classes and hibernate sees them as just plain pojo with no annotations.
      I am guessing that problem has to do something with integration with AS7 that now has jandex index for all annotations...

      Attachments

        1. module.zip
          4 kB
        2. webapp-1.0.war
          3 kB

        Activity

          People

            sdouglas1@redhat.com Stuart Douglas
            tomazcerar Tomaž Cerar (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: