java - Float in JPQL query -
i have following method:
public book findbookbytitleandversion(string title, float version) { typedquery<book>query = em.createquery("select b book b b.title = ?1 , b.version = ?2" ,book.class); query.setparameter(1, title); query.setparameter(2, version); return query.getsingleresult(); }
i'm using mysql , have records should returned. store 'version' float type (1.22 in case). query returns:
javax.persistence.noresultexception: no entity found query
float has here, query title works fine.
Comments
Post a Comment