• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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:

 
Blueberry pie is best when it is firm and you can hold in your hand. Smell it. And smell this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic