facebook

Hibernate for table without PK [Closed]

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #220530 Reply

    Lisa Carter
    Member

    I created a mapping file, abstract class and concreate class for a table using myEclipse for hibernate. The table does not have a primary key it consists of only foriegn keys in other tables. the problem is that the mapping file does not like it. Is this mapping possible in MyEclipse ? Is this mapping possible in Hibernate?

    #220542 Reply

    support-jeff
    Member

    You will need to declare a primary key for the table if you want to map it as an entity. However, if the only columns in the table are fk’s to other tables, is this not just a many-to-many relation? Hibernate has other ways to manage these that do not involve mapping them directly as an entity. I would check the Hibernate docs for many-to-many relationships.

    #220703 Reply

    Lisa Carter
    Member

    Thanks, for your help. I’ll look in to the documentation. I was confused since I am new to hibernate.

    Thanks again.

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Hibernate for table without PK [Closed]

You must be logged in to post in the forum log in