JPQL Bug? BigInteger 22 digits (precision=22, scale=0) [message #979372] |
Sat, 10 November 2012 16:44  |
Eclipse User |
|
|
|
I tried with and without the "L" at the end of the value of numero, but is not working.
PD: This query runs well on PostgreSQL.
mapping
@Basic(optional = false)
@Column(name = "numero", nullable = false, precision = 22, scale = 0)
private BigInteger numero;
25450 (2012/11/10 18:34:42,586) ERROR controller.CuentabancariaController - java.lang.IllegalArgumentException: An exception occurred while creating a query in EntityManager:
Exception Description: General Problem parsing the query [SELECT o FROM CuentaBancaria o WHERE o.numero=2222444433335555666602L].
The parser returned the following [For input string: "2222444433335555666602"].
Internal Exception: java.lang.NumberFormatException: For input string: "2222444433335555666602"
|
|
|
Re: JPQL Bug? BigInteger 22 digits (precision=22, scale=0) [message #981746 is a reply to message #979372] |
Mon, 12 November 2012 12:04  |
Eclipse User |
|
|
|
2222444433335555666602 is too big for a long in Java, which has a maximum value of 9223372036854775807.
You will need to create the BigDecimal yourself and pass it as a parameter to the query:
em.createQuery("SELECT o FROM CuentaBancaria o WHERE o.numero=?1).setParameter(1, new BigInteger("2222444433335555666602")).getResultList();
Best Regards,
Chris
|
|
|
Powered by
FUDForum. Page generated in 0.03235 seconds