Note that there are some explanatory texts on larger screens.

plurals
  1. POHibernate Classes Not Importing with Eclipse Juno and GWT: LockMode, SessionFactory, Criterion
    primarykey
    data
    text
    <h2>Environment</h2> <ul> <li>Ubuntu 12.04 LTS</li> <li>Eclipse Juno 4.2 Build id: 20120614-1722</li> <li>GWT SDK - 2.4.0</li> <li>App Engine SDK - 1.7.2</li> <li>Hibernate Version 3.5</li> <li>JRE: java-7-openjdk-amd64</li> </ul> <p>In reference to @mael comment, Hibernate Tools was installed from the following Eclipse repo: <a href="http://download.jboss.org/jbosstools/updates/stable/indigo/" rel="nofollow noreferrer">http://download.jboss.org/jbosstools/updates/stable/indigo/</a></p> <h2>Problem</h2> <p>The project is a GWT Web Application that uses Hibernate as the entity/persistence manager. I have successfully configured Hibernate to connect to the database, and it pulls in all the tables and associated columns I am interested in. I use Hibernate to reverse engineer the entity/persistence classes; it runs successfully, but I get the import errors in the newly generated classes:</p> <ul> <li>The import org.hibernate.LockMode cannot be resolved.</li> <li>The import org.hibernate.SessionFactory cannot be resolved.</li> <li>The import org.hibernate.criterion.Example cannot be resolved.</li> </ul> <h2>Research/Troubleshooting</h2> <p>There was similar problem I found <a href="https://stackoverflow.com/questions/2122545/eclipse-the-import-cannot-be-resolved-after-java-update">here</a>. I performed the search for the aforementioned classes, and did not find them. I then readded <b>java-7-openjdk-amd64 JRE</b> under <b>Windows > Preferences > Installed JREs</b>. This did not resolve the problem.</p> <p>Also, there does not seem to be very much out there for this problem. So I am assuming there is something I have not understood in the setup of Hibernate and reverse engineering.</p> <p><a href="https://stackoverflow.com/questions/4322893/eclipse-error-the-import-xxx-cannot-be-resolved">Another Similar Problem - Same Solution</a></p> <h2>Update: Solution</h2> <ol> <li>Following @mael's solution, I confirmed that Hibernate Tools does not automatically include the Hibernate jar files required for the auto-generated entity/persistence classes.</li> <li>Downloaded the Hibernate4 jar files from the following <a href="http://sourceforge.net/projects/hibernate/files/hibernate4/4.1.7.Final/" rel="nofollow noreferrer">location</a>.</li> <li>Extracted files to the Eclipse workspace.</li> <li>In Eclipse, right-click on {Project} and go to <b>Build Path > Configure Build Path... > Java Build Path.</b></li> <li>Click on the Libraries tab.</li> <li>Click on Add External JARs...</li> <li>Go to directory where Hibernate4 JAR files were extracted, and follow the path to <b>lib > required</b>.</li> <li>Select all JAR files in the folder and confirm.</li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload