Hibernate question.

Does hibernate eliminate the DAO design pattern? If yes what are the advantages and disadvantages of hibernate over DAO design pattern.Thanks in advance.
[167 byte] By [ssv45324a] at [2007-10-2 12:57:08]
# 1
My impression--and I could be wrong--was that Hibernate is, in part at least, an implementation of the DAO pattern. I'm interested to hear what more knowledgeable folks have to say (even if it's just "STFW," which I'll do later).
jverda at 2007-7-13 10:14:03 > top of Java-index,Other Topics,Patterns & OO Design...
# 2

> Does hibernate eliminate the DAO design pattern? If

> yes what are the advantages and disadvantages of

> hibernate over DAO design pattern.

>

> Thanks in advance.

Usually Hibernate is just another way to implement a DAO. A DAO is usually an interface. You can implement it with hand-coded JDBC, Hibernate, iBatis, calling stored procedures, or whatever, but Hibernate doesn't eliminate the DAO.

%

duffymoa at 2007-7-13 10:14:03 > top of Java-index,Other Topics,Patterns & OO Design...
# 3
Thanks for your responses. Is it possible to create custom methods rather than the standard get methods in hibernate? For example sometimes i might require data from which satisfies criteria from 2 different columns or sometimes i might require data wihch is greater than a specific value.
ssv45324a at 2007-7-13 10:14:03 > top of Java-index,Other Topics,Patterns & OO Design...
# 4

> Thanks for your responses. Is it possible to create

> custom methods rather than the standard get methods

> in hibernate? For example sometimes i might require

> data from which satisfies criteria from 2 different

> columns or sometimes i might require data wihch is

> greater than a specific value.

I'm not sure exactly what you're asking, but if it's something you might do with halfway reasonable code and data model (or even for many things that that only very stupid code and data model would do), the answer to "can you do it with Hibernate" is almost certainly "YES."

Hibernate is very flexible. It will do most things in a very reasonable default way without you even having to tell it much. You can make custom queries with HQL--a SQL-like query language that Hibernate uses, or even directly in SQL. There are many ways to customize its behavior.

jverda at 2007-7-13 10:14:03 > top of Java-index,Other Topics,Patterns & OO Design...
# 5

> Thanks for your responses. Is it possible to create

> custom methods rather than the standard get methods

> in hibernate?

What "standard" get methods?

> For example sometimes i might require

> data from which satisfies criteria from 2 different

> columns or sometimes i might require data wihch is

> greater than a specific value.

It's called Hibernate Query Language (HQL). Go learn it.

%

duffymoa at 2007-7-13 10:14:03 > top of Java-index,Other Topics,Patterns & OO Design...