Service XML - Mapping to BigInt

Kevin Neibarger, modified 6 Years ago. Regular Member Posts: 105 Join Date: 2/2/18 Recent Posts
I'm having issues mapping a very large BigInt in my MySQL DB to the java type "int". The BigInt is 999999999999 and service layers API is turning it in to 9.99999999999E11. So, of course, I get the below error
[JDBCExceptionReporter:82] '9.99999999999E11' in column '1' is outside valid range for the datatype INTEGER.
When I try to change the service xml for that column and set the type="long" I get the error
ClassCastException: java.lang.Long cannot be cast to java.lang.Integer
Is there another data type besides I can set in my service.xml besides "int" that will work??
thumbnail
Jorge Díaz, modified 6 Years ago. Liferay Master Posts: 753 Join Date: 1/9/14 Recent Posts
Hi Kevin,About your exception:

ClassCastException: java.lang.Long cannot be cast to java.lang.Integer

Can you attach the log with the full exception?