Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Problems with Session and transaction handling?
Read this:
http://hibernate.org/42.html
Hello, everybody! I've been using Hibernate with HSQLDB for some weeks and I have familiarized with the main features and have developed some simple applications to understand how to use it. Up to there, everything has been fine, I have achieved it relatively easy. But there is a problem I have found, during using Hibernate for the application I'm interested in. The thing is I have two entities like this
Entity{
composite-id "ID"
... (The rest of the fields)
}
ID{
"field 1"
"field 2" (foreign key, represents relationship between Entity and another entity)
}
How do I map this composite id? How do I map the foreign key called field 2? If all the fields in ID were foreign keys for Entity, how do I do these both things?