Hi guys,
I have an entity which has a field on it which is of type Long e.g.:
Code:
@Entity
public class MyEntity {
private Long myLongField;
...
}
I then use the JPA Criteria API to generate a query to find MyEntity's by myLongField e.g.
Code:
criteriaBuilder.equal(myEntityRoot.get("myLongField"), 12345678);
...
What I am seeing is that Hibernate generates an SQL query with the long value with an "L" appended onto the end of it, e.g.:
Code:
select ... from myentity myentity0_ where (myentity0_.mylongfield = 12345678L);
This obviously causes an exception to be thrown:
Code:
MySQLSyntaxErrorException: Unknown column '12345678L' in 'where clause'
I am using Hibernate-3.5.6-Final and MySQL 5.1
Any ideas on how to stop the "L" being appended onto the end of the long value?
Thanks,
Mark