Package org.hibernate.id
Interface IntegralDataTypeHolder
-
- All Superinterfaces:
java.io.Serializable
- All Known Implementing Classes:
IdentifierGeneratorHelper.BasicHolder,IdentifierGeneratorHelper.BigDecimalHolder,IdentifierGeneratorHelper.BigIntegerHolder
public interface IntegralDataTypeHolder extends java.io.SerializableDefines a common api for dealing with data of integral data type.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IntegralDataTypeHolderadd(long addend)Perform an additionvoidbind(java.sql.PreparedStatement preparedStatement, int position)Bind this holders internal value to the given result set.IntegralDataTypeHoldercopy()Make a copy of this holder.IntegralDataTypeHolderdecrement()Equivalent to a -- operationbooleaneq(long other)Perform an equality comparison checkbooleaneq(IntegralDataTypeHolder other)Perform an equality comparison checkbooleangt(long other)Perform a "greater than" comparison check.booleangt(IntegralDataTypeHolder other)Perform a "greater than" comparison check.IntegralDataTypeHolderincrement()Equivalent to a ++ operationIntegralDataTypeHolderinitialize(long value)Initialize the internal value from the given primitive long.IntegralDataTypeHolderinitialize(java.sql.ResultSet resultSet, long defaultValue)Initialize the internal value from the given result set, using the specified default value if we could not get a value from the result set (aka result was null).booleanlt(long other)Perform a "less than" comparison check.booleanlt(IntegralDataTypeHolder other)Perform a "less than" comparison check.java.lang.NumbermakeValue()Return the internal value.java.lang.NumbermakeValueThenAdd(long addend)Increment the internal state by the given addend, but return the pre-incremented value.java.lang.NumbermakeValueThenIncrement()Increment the internal state, but return the pre-incremented value.IntegralDataTypeHoldermultiplyBy(long factor)Perform a multiplication.IntegralDataTypeHoldermultiplyBy(IntegralDataTypeHolder factor)Perform a multiplication.IntegralDataTypeHoldersubtract(long subtrahend)Perform a subtraction
-
-
-
Method Detail
-
initialize
IntegralDataTypeHolder initialize(long value)
Initialize the internal value from the given primitive long.- Parameters:
value- The primitive integral value.- Returns:
- this, for method chaining
-
initialize
IntegralDataTypeHolder initialize(java.sql.ResultSet resultSet, long defaultValue) throws java.sql.SQLException
Initialize the internal value from the given result set, using the specified default value if we could not get a value from the result set (aka result was null).- Parameters:
resultSet- The JDBC result setdefaultValue- The default value to use if we did not get a result set value.- Returns:
- this, for method chaining
- Throws:
java.sql.SQLException- Any exception from accessing the result set
-
bind
void bind(java.sql.PreparedStatement preparedStatement, int position) throws java.sql.SQLExceptionBind this holders internal value to the given result set.- Parameters:
preparedStatement- The JDBC prepared statementposition- The position at which to bind- Throws:
java.sql.SQLException- Any exception from accessing the statement
-
increment
IntegralDataTypeHolder increment()
Equivalent to a ++ operation- Returns:
- this, for method chaining
-
add
IntegralDataTypeHolder add(long addend)
Perform an addition- Parameters:
addend- The value to add to this integral.- Returns:
- this, for method chaining
-
decrement
IntegralDataTypeHolder decrement()
Equivalent to a -- operation- Returns:
- this, for method chaining
-
subtract
IntegralDataTypeHolder subtract(long subtrahend)
Perform a subtraction- Parameters:
subtrahend- The value to subtract from this integral.- Returns:
- this, for method chaining
-
multiplyBy
IntegralDataTypeHolder multiplyBy(IntegralDataTypeHolder factor)
Perform a multiplication.- Parameters:
factor- The factor by which to multiple this integral- Returns:
- this, for method chaining
-
multiplyBy
IntegralDataTypeHolder multiplyBy(long factor)
Perform a multiplication.- Parameters:
factor- The factor by which to multiple this integral- Returns:
- this, for method chaining
-
eq
boolean eq(IntegralDataTypeHolder other)
Perform an equality comparison check- Parameters:
other- The other value to check against our internal state- Returns:
- True if the two are equal
-
eq
boolean eq(long other)
Perform an equality comparison check- Parameters:
other- The other value to check against our internal state- Returns:
- True if the two are equal
-
lt
boolean lt(IntegralDataTypeHolder other)
Perform a "less than" comparison check. We check to see if our value is less than the incoming value...- Parameters:
other- The other value to check against our internal state- Returns:
- True if our value is less than the 'other' value.
-
lt
boolean lt(long other)
Perform a "less than" comparison check. We check to see if our value is less than the incoming value...- Parameters:
other- The other value to check against our internal state- Returns:
- True if our value is less than the 'other' value.
-
gt
boolean gt(IntegralDataTypeHolder other)
Perform a "greater than" comparison check. We check to see if our value is greater than the incoming value...- Parameters:
other- The other value to check against our internal state- Returns:
- True if our value is greater than the 'other' value.
-
gt
boolean gt(long other)
Perform a "greater than" comparison check. We check to see if our value is greater than the incoming value...- Parameters:
other- The other value to check against our internal state- Returns:
- True if our value is greater than the 'other' value.
-
copy
IntegralDataTypeHolder copy()
Make a copy of this holder.- Returns:
- The copy.
-
makeValue
java.lang.Number makeValue()
Return the internal value.- Returns:
- The current internal value
-
makeValueThenIncrement
java.lang.Number makeValueThenIncrement()
Increment the internal state, but return the pre-incremented value.- Returns:
- The pre-incremented internal value
-
makeValueThenAdd
java.lang.Number makeValueThenAdd(long addend)
Increment the internal state by the given addend, but return the pre-incremented value.- Parameters:
addend- The value to be added to our internal state- Returns:
- The pre-incremented internal value
-
-