enjoyourlife (1) [Avatar] Offline
I import maven project using eclipse(luna) and encounter some errors..

1. xmlns in persistence.xml


Eclipse shows following errors.

... Referenced file contains errors (http://xmlns.jcp.org/xml/ns/persistence_2_1.xsd). For more information..

So, I changed it like below,

<persistence xmlns="http://java.sun.com/xml/ns/persistence"

2. I cannot find the class in persistence.xml like <class>org.jpwh.model</class>
It seems just package, no class. So, i delete it.

<persistence-unit name="SimplePU">

<persistence-unit name="myPU">

3. No generator named “X” is defined in the persistence unit – Eclipse JPA

4. maven-antrun-plugin problem
You may encounter this problem when you importing maven project. i just disabled it by clicking eclipse error indicator.
Eclipse will insert following configuration to pom.xml

<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->

5. some errors in example project like below...

CreditCard_, Item_ classes seems does not exist. Many classes have this kinds of errors.

package org.jpwh.test.bulkbatch;

import org.jpwh.env.JPATest;
import org.jpwh.model.bulkbatch.BankAccount;
import org.jpwh.model.bulkbatch.Bid;
import org.jpwh.model.bulkbatch.CreditCard;
import org.jpwh.model.bulkbatch.CreditCard_;
import org.jpwh.model.bulkbatch.Item;
import org.jpwh.model.bulkbatch.Item_;

siebica (3) [Avatar] Offline
Please find some answers below:

2. I believe this is the extension that Hibernate provides for including the package-info.java (the file you can put your named queries inside)

Please check https://docs.jboss.org/hibernate/stable/entitymanager/reference/en/html/configuration.html#setup-configuration-packaging
As an extension to the specification, you can add a package name in the <class> element (eg <class>org.hibernate.eg</class> ). Caution, the package will include the metadata defined at the package level (ie in package-info.java), it will not include all the classes of a given package.

5. The CreditCard_, Item_ metadata classes are generated during the build process and you can find them under model/target/generated-sources/annotations. The book talks about this strongly typed metadata model at page 45 of MEAP v8
424033 (1) [Avatar] Offline

I spent hours trying to import the project within Eclipse Luna. I tried different plugins, searched the web for the many error messages I got with no success.

Is it possible for you to provide online an Eclipse version tu run the sample codes (or at least to give us in a README file indications concerning the necessary plugins) ? Because for the moment it looks as if the targeted audience was rather persons having a good knowledge of Maven and Hibernate (or both) than pure Java developers?

Best regards,