java - Converting varchar to integer on Oracle using Hibernate -


in project score field in database varchar datatype, contains integer values need fetch records having score between 70 50. (i.e less 70).

my query

query count_query =     stmt1.query().from(selectedtable).selectcount().    where(districtcolumn).equals(district_code).    and(score).isnull().or(score).lessthan("70").toquery(); 

trying to_num not accepting. accepts column data types.

try modify entity (tested on mysql):

@formula(value = " cast(score decimal(10,0) ) ") public long getscore() 

Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -