Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unknown entity class: java.lang.Integer

 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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():



 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Solved this problem with this line of code:

 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic