Class SequenceValueExpression
java.lang.Object
org.fastnate.generator.statements.SequenceValueExpression
- All Implemented Interfaces:
ColumnExpression
- Direct Known Subclasses:
CurrentSequenceValueExpression,NextSequenceValueExpression
Base class for
ColumnExpressions which reference an ID by using the value of a sequence.- Author:
- Tobias Liefke
-
Constructor Summary
ConstructorsConstructorDescriptionSequenceValueExpression(SequenceIdGenerator sequence, long difference) Creates a newSequenceValueExpressioninstance. -
Method Summary
Modifier and TypeMethodDescriptionlongThe difference of the referenced ID to the sequence value.The written sequence.protected StringBuilds the SQL expression by using the given SQL and the currentdifference.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.fastnate.generator.statements.ColumnExpression
appendSql, toSql
-
Constructor Details
-
SequenceValueExpression
Creates a newSequenceValueExpressioninstance.- Parameters:
sequence- The written sequence.difference- The difference of the referenced ID to the sequence value.
-
-
Method Details
-
toSql
Builds the SQL expression by using the given SQL and the currentdifference.- Parameters:
sql- the SQL expression that references the sequence- Returns:
- the SQL expression that references the sequence and respects the difference
-
getSequence
The written sequence. -
getDifference
public long getDifference()The difference of the referenced ID to the sequence value.
-