This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Object Relational Mapping question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Object Relational Mapping question" Watch "Object Relational Mapping question" New topic

Object Relational Mapping question

Dave Van Even
Ranch Hand

Joined: Jul 19, 2001
Posts: 101
I don't know exactly where to ask this question (there are so many forums here) but I know some of you guys here can give some insight.
Simple question: If you use an ORM tool would you
a) use it in your domain model (business logic)
b) use it in DAO's that your domain model uses

It looks interesting to really seperate the ORM stuff into DAO's but somehow it's strange
opinions ?
Thank you
Kyle Brown
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
Use it under a layer of DAO's. That way the DAO's just magically produce objects, and you don't have to worry about how they do it.

Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at for other WebSphere information.
Dave Van Even
Ranch Hand

Joined: Jul 19, 2001
Posts: 101
Thanks I got convinced enough now to go that way
I agree. Here's the link:
subject: Object Relational Mapping question
Similar Threads
Mixing JPA and JAXB on the same POJO is a bad idea?
Persistence in the Enterprise - efficiency
Domain objects with no dependencys on DAOs
Custom annotations ?
Stateful Session Bean