Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

migrating code from hibernate 2 to hibernate 3.0  RSS feed

 
Sunitha Jampala
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!