Results 1 to 2 of 2

Thread: How to retrieve objects with composite keys using Hibernate?

  1. #1
    Join Date
    Dec 2005
    Posts
    15

    Default How to retrieve objects with composite keys using Hibernate?

    Anybody knows how to do that? I cant seem to find a method in HibernateTemplate that does that. Do I have to use JdbcTemplate to access these kind of objects? Maybe an example would be an email with multiple attachments. Each email has an ID and an attachment has the email ID and the filename as its composite key, so the table schema for the attachment will have PRIMARY KEY ("EMAILID", "FILENAME") defined.

    Adrian

  2. #2

    Default

    Can you just do a query on those two columns? Only difference is this will return a list, and you'll have to get the first (and only) element in the list.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •