Package com.axelor.db
Class JpaSequence
java.lang.Object
com.axelor.db.JpaSequence
This class provides some helper static methods to deal with custom sequences.
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
Get the next sequence value of the given sequence.
This method must be called inside a running transaction as it updates the sequence details in database.static void
Set the next numeric value for the given sequence.
This method must be called inside a running transaction as it updates the sequence details in the database.static String
Get the next sequence value of the given sequence.
This method must be called inside a running transaction as it updates the sequence details in database.static void
Set the next numeric value for the given sequence.
This method must be called inside a running transaction as it updates the sequence details in the database.
-
Method Details
-
nextValue
Get the next sequence value of the given sequence.
This method must be called inside a running transaction as it updates the sequence details in database.- Parameters:
name
- the name of the sequence- Returns:
- next sequence value
-
nextValue
Get the next sequence value of the given sequence.
This method must be called inside a running transaction as it updates the sequence details in database.- Parameters:
em
- the entity managername
- the name of the sequence- Returns:
- next sequence value
-
nextValue
Set the next numeric value for the given sequence.
This method must be called inside a running transaction as it updates the sequence details in the database.
This method is generally used to reset the sequence. It may cause duplicates if given next number is less then the last next value of the sequence.- Parameters:
name
- the name of the sequencenext
- the next sequence number
-
nextValue
Set the next numeric value for the given sequence.
This method must be called inside a running transaction as it updates the sequence details in the database.
This method is generally used to reset the sequence. It may cause duplicates if given next number is less then the last next value of the sequence.- Parameters:
em
- the entity managername
- the name of the sequencenext
- the next sequence number
-