Hibernate 4.1Final alternative for Hibernate.STRING

I used Hibernate 3.6, where I have code like this:

list =getSession().createSQLQuery(queryString) .addScalar("UNAME",Hibernate.STRING) .addScalar("COM",Hibernate.STRING) .addScalar("COM_DATE",Hibernate.DATE) .setString("id", Id).list(); 

Now I change the jar from 3.6 to 4.1Final

it looks like the addScalar method is requesting Type instead of Hibernate.STRING I could not find any example to solve this problem. if there is someone who knows, please help me thank you.

+48
java hibernate
Apr 21 2018-12-12T00:
source share
1 answer

Enter the fields in org.hibernate.Hibernate , deprecated (and actually deleted) as a result of HHH-5196

Now various types of Hibernate can be found from javadocs for Type . In your case, the following should work:

  .addScalar("UNAME", StringType.INSTANCE) .addScalar("COM", StringType.INSTANCE) .addScalar("COM_DATE", DateType.INSTANCE) 
+61
Apr 21 2018-12-12T00:
source share



All Articles