permaculture playing cards*
The moose likes Object Relational Mapping and the fly likes Unknown entity class: java.lang.Integer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Unknown entity class: java.lang.Integer" Watch "Unknown entity class: java.lang.Integer" New topic
Author

Unknown entity class: java.lang.Integer

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

I am trying to work on some simple mappings to try and begin once again to understand how hibernate works (I'm tired of writing a ton of SQL ).

I have 3 beans that have related tables. Employee, User, and Issue. The issue table in the database has 2 foreign keys. 1 for user_id and one for employee_id. I am trying to query for an issue with a specific createdByUser (user_id). And for some reason I am getting the Unknown entity class: java.lang.Integer error messsage. Below are all the relivant files. Thanks for any help.

Hibernate Version: 2.1.7c

Issue.java


User.java


Employee.java


Mapping documents:

Employee.hbm.xml


User.hbm.xml


Issue.hbm.xml


Code between sessionFactory.openSession() and session.close():





GenRocket - Experts at Building Test Data
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Solved this problem with this line of code:

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Unknown entity class: java.lang.Integer
 
Similar Threads
Joining tables
hibernate3 : help find out the error
Hibernate: Problem getting a simple list
jsp:useBean id not clear
Hibernate mapping