Sequence no exception using eclipseLink with oracle db

I have the following JPA object:

@Entity
@Table(schema = "myschema")
@SequenceGenerator(schema = "myschema", name = "seqGenerator", 
                   sequenceName  = "person_s1", allocationSize = 1)
public class Person {

@Id
@GeneratedValue(generator = "seqGenerator", strategy = GenerationType.AUTO)
private long id;

The following exceptions are thrown:

Call: DROP SEQUENCE myschema.person_s1
Query: DataModifyQuery(sql="DROP SEQUENCE myschema.person_s1")
[EL Warning]: 2010-11-01 17:21:51.051--ServerSession(10605044)--Exception [EclipseLink-    4002] (Eclipse Persistence Services - 2.1.1.v20100817-r8050): 
org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: ORA-02289: sequence does not exist

Error Code: 2289
Call: SELECT myschema.person_s1.NEXTVAL FROM DUAL
Query: ValueReadQuery(sql="SELECT myschema.person_s1.NEXTVAL FROM DUAL")

The sequence is separated by EclipseLink and the request:

SELECT myschema.person_s1.NEXTVAL FROM DUAL

works great with direct use ...

Any help appreciated

Regards Marcel

+3
source share
2 answers

the following exceptions are thrown (...)

, , , . EclipseLink , Warning ( Error), ( , ?).

PS: 1, / ?

+3

, , .

@Entity
@Table(schema = "myschema")
public class Person {

   @Id
   @SequenceGenerator(schema = "myschema", name = "seqGenerator", sequenceName  = "person_s1", allocationSize = 1)
   @GeneratedValue(generator = "seqGenerator", strategy = GenerationType.AUTO)
   private Long id;
}
0

Source: https://habr.com/ru/post/1772507/


All Articles