I am trying to get the sequence from oracle using the following code:
@Column(name = "REC_ID", scale = 14)
@Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_TEST")
@SequenceGenerator(name="SEQ_TEST", sequenceName="SEQ_TEST", allocationSize=1)
private long recId;
The sequence number is 14 digits. The problem is that I get an error on the terminal:
Raised: java.sql.SQLException: numeric overflow at oracle.jdbc.driver.NumberCommonAccessor.throwOverflow (NumberCommonAccessor.java:4381) at oracle.jdbc.driver.NumberCommonAccessor.getInt (NumberCommonAccessor.java:1db.c.driver .OracleResultSetImpl.getInt (OracleResultSetImpl.java:942) at com.avaje.ebean.config.dbplatform.SequenceIdGenerator.getMoreIds (SequenceIdGenerator.java:194) ... 31 details
I tried using Long, Double, BigDecimal. When changing the sequence to 10 digits, it works, so I feel that it is connected with 64-bit, but I run java on OSX, so this is 64-bit java.
Any idea what could be the problem?
source
share