Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

My class is not mapped

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi cowboys,


I've an odd problem with my hibernate. I've mapped it to a class and can easily do inserts. However when it comes to doing a select, hibernate complains my given class isn't mapped.

The class code itself is as simple as it gets: it contains 4 attributes and the corresponding getters / setters. The class also contains a static method used to generate uuids.

My config file includes:



And the contents of Federation.hbm.xml are:


My db table is as follows (mysql):


My class attributes and getters / setters:


So where have I erred?

Thanks for your help...
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you post the calling code and stacktrace? Off hand I don't see anything wrong with your code/mappings.
 
David Brossard
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the stack trace:



Actually the insert works fine. Only the listing (method listItems) doesn't work which probably means I made a mistake there. I'll try to figure it out and update this thread hopefully.
 
David Brossard
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the problem is that when I executed my select query in HQL, I gave the sql table name rather than the java class name as the from attributes e.g. from federations (my sql table) rather than from federation (my class).
 
reply
    Bookmark Topic Watch Topic
  • New Topic