Question

I have read this on how to auto-generate the Entity Meta Model, but I think there is something wrong.

I have: Eclipse Indigo SR2, build 20120216-1857 and configured the "Annotation Processor" as specified here. To the factory path I have added ONLY these jars

  • hibernate-jpamodelgen-1.2.0.Final.jar (taken from here)
  • hibernate-jpa-2.0-api-1.0.1.Final.jar (taken from the zip archive of Hibernate ORM 4.1.0 from here)

I suppose after configuring this for my the EJB project (I did not do that for my Web or EAR Project), the project gets rebuild and the Meta Model Classes will be autogenerated, without clicking on another button, is that right?

If everything should have worked, do you have any clues on what could go wrong? Notes:

  • I see absolutely no messages from any annotation processors in the "Error Log" Eclipse View.
  • My persistence.xml file is in the ejbModule/META-INF/persistence.xml
  • All my entities extend an Abstract class, imported in the project with svn:externals.
  • My entities are annotated with @Entity, and that's all.
Was it helpful?

Solution

The problem is that the project has also AspectJ compatibility, which makes the Project use another compiler. More details on this bug here.

Beside that, you could (bun not mandatory you will) get an NullPointerException (see the "Error Log" Eclipse View) if you have at least an Abstract Class in your project.

OTHER TIPS

You just need to select the source folder of the generated metamodel on your Project -> Properties -> JPA

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top