We are moving from Oracle to PostgreSQL. Some Oracle-specific queries had to be changed to Postgres equivalents. The following is one such commit:
At first
Query query = getEntityManager().createNativeQuery("SELECT PC_SITE_GROUP_ID_SEQ.NEXTVAL from DUAL");
BigDecimal result = (BigDecimal) query.getSingleResult();
has been changed to,
Query query = getEntityManager().createNativeQuery("SELECT NEXTVAL('pc_site_group_id_seq')");
BigDecimal result = (BigDecimal) query.getSingleResult();
When starting after the change, it launched an error,
java.math.BigInteger cannot be passed to java.math.BigDecimal
My question is, why did it work before? Recall that the first change was made to the Oracle database, and the second to the Postgres database. Please, help.
source
share