wood burning stoves 2.0*
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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
 
Similar Threads
Mapping Query
Hibernate - Query Issues With Many-To-One Relationships
HQL join returns no results.
Querying tables with a one-to-many foreign key relationship
Unexpected Token Problem