legolas_wood wrote:
if we use an sql string then it will be like using plain JDBC, am i right?
No, you'll still be able to use some feature of Hibernate, like being able to ask it to automatically convert the result into an object list, instead of a list of arrays.
You'd be doing plain jdbc if retrieving the connection from the session and the using it as if Hibernate was not used.
Instead, if, for example, you can map a named query in the hbm.xml, you'd be able to do something like
Code:
Query q = session.getNamedQuery("myQuery");
q.setParameter(.....);
q.setParameter(.....);
List<MyClass> myClasses = q.list();
for(MyClass currentClass : myClasses)
{
...
}
As you see, it'd be a bit simpler less repetitive than jdbc, not having to iterate over the resultset to retrieve each column to build each object :-).
legolas_wood wrote:
what we want to achieve with moving to hibernate/ JPA(EJB 3.0) is using container provided facilities like security, transaction and....
Well, I guess you're speaking about things I know only by name like Seam or Hibernate Entity Manager, because I didn't know you could have security or tx management by using Hibernate.
We also use automatic tx demarcation, but we use Spring for this.