My application was working in hibernate 3.5.1-final. When upgrade it to 3.6.1.final, it started failing with below exception:
Caused by: java.lang.NoSuchFieldError: STRING
The line where it is failing is:
Code:
final Query query = getSession().createSQLQuery(sqlString)
.addScalar("xyz", Hibernate.STRING) <-- its failing here
.addScalar("bcd", Hibernate.BOOLEAN)
.setParameter("name", name);
When I opened Hibernate.java source code of 3.6.10, I can see Hibernate.STRING is deprecated. But, that should NOT stop me from using this right? Fix is to use StandardBasicTypes, but why is it failing even though field exists in Hibernate.java?.
Hibernate jars in my classpath:
hibernate-commons-annotations-3.2.0.Final.jar
hibernate-core-3.6.10.Final.jar
hibernate-jpa-2.0-api-1.0.1.Final.jar
hibernate-validator-4.0.2.GA.jar
Any help on this really appreciated.