• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Unknown entity class: java.lang.Integer

 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Solved this problem with this line of code:

 
Not so fast naughty spawn! I want you to know about
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic