I am writing a code in spring boot 1.5.22 with java 8 and oracle 11g. Here, In my repository class, I have tried to call one native query as-
@Query(value = "ALTER SEQUENCE <SEQ_NAME> RESTART START WITH 0", nativeQuery = true)
void resetSequence();
when I try to call this method in my service Impl class, I get the following error:-
java.lang.NegativeArraySizeException:-1
However, I can execute select sequence commands using java code as-
@Query(value = "select <Seq_name>.nextVal from dual", nativeQuery = true)
int getNextCount();
I don't know how exactly I can command to reset my sequence using java code/job here.