Friday, 15 June 2012

java - Hibernate.INTEGER is unavailable, when the Hibernate version is upgraded to 4.2.0.CR1 -



java - Hibernate.INTEGER is unavailable, when the Hibernate version is upgraded to 4.2.0.CR1 -

i have upgraded hibernate 3.2.5 4.2.0.cr1. using next methods in dao classes locate current row number in oracle 10g createsqlquery() method.

class="lang-sql prettyprint-override">select row_num (select row_number() on ( order banner_id desc) row_num, banner_id banner_images order banner_id desc) banner_id = :id class="lang-java prettyprint-override">@override @suppresswarnings("unchecked") public int getcurrentrow(string id, int rowsperpage) { homecoming (integer) sessionfactory .getcurrentsession() .createsqlquery("above query") .addscalar("row_num", hibernate.integer) //<------- ??? .setparameter("id", long.parselong(id)) .uniqueresult(); }

the .addscalar("row_num", hibernate.integer) method shown in above code snippet, issues compile-time error.

cannot find symbol symbol: variable integer location: class hibernate

it not available in org.hibernate.hibernate class. netbeans ide i'm using 7.2.1 not listing such constant. google search couldn't lead me actual solution. alternative in version of hibernate (4.2.0.cr1)?

this hinernate.integer deprecated since 3.6.x

you should utilize integertype.instance instead.

java oracle hibernate compiler-errors

No comments:

Post a Comment