Announcement Announcement Module
Collapse
No announcement yet.
Using Hibernate Criteria API with unmapped classes Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using Hibernate Criteria API with unmapped classes

    Hi all,

    I have a class mapped to a DB table that references another, unmapped table to get information about the tips - this unmapped table associates rows in my mapped table with dates on a one-to-one basis (think of an "X of the day" relation).

    I'm using the Hibernate criteria API in my DAO to access this mapped table, but I'd also like to use it to access this date-specific information without going to the relative trouble of mapping the currently unmapped table.

    The "Java persistence with Hibernate" book has limited coverage of Criteria (just the basic usages), so I'm not sure if I'm barking up the wrong tree with what I'm trying to accomplish, but it seems like there's some syntax that is (or should be!) available within the Restrictions class that would allow me to use an external table to restrict my query results. Does anyone have any experience with this kind of behavior?

    Thanks

  • #2
    Originally posted by rafuzo View Post
    I'm using the Hibernate criteria API in my DAO to access this mapped table, but I'd also like to use it to access this date-specific information without going to the relative trouble of mapping the currently unmapped table.
    Out of interest, why not just map the class? It's not that much effort.
    Last edited by karldmoore; Aug 30th, 2007, 05:24 AM.

    Comment

    Working...
    X