This week's book giveaway is in the General Computing forum.
We're giving away four copies of Emmy in the Key of Code and have Aimee Lucido on-line!
See this thread for details.
Win a copy of Emmy in the Key of Code this week in the General Computing 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
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Hibernate mapping with Annotations: Entity not Mapped.

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an application I am working on where I am trying to link to my PostgreSQL DB with the hibernate framework.  I am new to this framework and I am having some issues getting a couple of my classes to successfully map to the DB.  I will include the condensed, problematic, code below.

SQL


FeedingSchedule.java


Animal.java


hibernate.cfg.xml


I have a feeling it has something to do with the way my classes are mapped because the following class works fine.  These classes where actually originally generated with the jpa framework within Eclipse but they still did not work.

User.java


I get the following error
 
Saloon Keeper
Posts: 21229
137
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've pushed this to the Object Relational forum since it's not really about servlets.
 
Rancher
Posts: 4304
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you show us whatever query it is that is causing the issue?
If that bit at the end of the message is the query then I don't think you put the package name into it.
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don’t know that I can solve your problem, but the first thing I would do is ensure that all of my data model entity class attributes which represent database table columns are annotated @Column and have standard public getter and setter methods of the correct types on them.
 
We should throw him a surprise party. It will cheer him up. We can use this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!