File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes migrating  code from hibernate 2 to hibernate 3.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "migrating  code from hibernate 2 to hibernate 3.0 " Watch "migrating  code from hibernate 2 to hibernate 3.0 " New topic
Author

migrating code from hibernate 2 to hibernate 3.0

Sunitha Jampala
Greenhorn

Joined: Jul 21, 2009
Posts: 1
I am trying to migrate code from hibernate 2 to hibernate 3.0 and our application is using many session.find(String query, String[] values, NulllableType[] types)

I want avoid writing too may session.createQuery ( query) as the queries are many

what is equivalent query method in hibernate 3

thanks
sunitha
Francois Nadeau
Ranch Hand

Joined: Apr 09, 2009
Posts: 46
Hello Sunitha,

According to the Hibernate migration guide find() has been replaced by createQuery().

I suppose you could wrap your session instances within a customized class with a find function which uses createQuery, but it may be better (from a standard point of view) to simply bite the bullet and rewrite all of the queries.

Hope this helps.

[url]http://FrancoisNadeau.com[/url]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: migrating code from hibernate 2 to hibernate 3.0