Package org.hibernate.id
Class IdentifierGeneratorHelper.BasicHolder
- java.lang.Object
-
- org.hibernate.id.IdentifierGeneratorHelper.BasicHolder
-
- All Implemented Interfaces:
Serializable,IntegralDataTypeHolder
- Enclosing class:
- IdentifierGeneratorHelper
public static class IdentifierGeneratorHelper.BasicHolder extends Object implements IntegralDataTypeHolder
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BasicHolder(Class exactType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IntegralDataTypeHolderadd(long addend)Perform an additionvoidbind(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 value)Perform an equality comparison checkbooleaneq(IntegralDataTypeHolder other)Perform an equality comparison checkbooleanequals(Object o)longgetActualLongValue()booleangt(long value)Perform a "greater than" comparison check.booleangt(IntegralDataTypeHolder other)Perform a "greater than" comparison check.inthashCode()IntegralDataTypeHolderincrement()Equivalent to a ++ operationIntegralDataTypeHolderinitialize(long value)Initialize the internal value from the given primitive long.IntegralDataTypeHolderinitialize(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 value)Perform a "less than" comparison check.booleanlt(IntegralDataTypeHolder other)Perform a "less than" comparison check.NumbermakeValue()Return the internal value.NumbermakeValueThenAdd(long addend)Increment the internal state by the given addend, but return the pre-incremented value.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 subtractionStringtoString()
-
-
-
Constructor Detail
-
BasicHolder
public BasicHolder(Class exactType)
-
-
Method Detail
-
getActualLongValue
public long getActualLongValue()
-
initialize
public IntegralDataTypeHolder initialize(long value)
Description copied from interface:IntegralDataTypeHolderInitialize the internal value from the given primitive long.- Specified by:
initializein interfaceIntegralDataTypeHolder- Parameters:
value- The primitive integral value.- Returns:
- this, for method chaining
-
initialize
public IntegralDataTypeHolder initialize(ResultSet resultSet, long defaultValue) throws SQLException
Description copied from interface:IntegralDataTypeHolderInitialize 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).- Specified by:
initializein interfaceIntegralDataTypeHolder- 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:
SQLException- Any exception from accessing the result set
-
bind
public void bind(PreparedStatement preparedStatement, int position) throws SQLException
Description copied from interface:IntegralDataTypeHolderBind this holders internal value to the given result set.- Specified by:
bindin interfaceIntegralDataTypeHolder- Parameters:
preparedStatement- The JDBC prepared statementposition- The position at which to bind- Throws:
SQLException- Any exception from accessing the statement
-
increment
public IntegralDataTypeHolder increment()
Description copied from interface:IntegralDataTypeHolderEquivalent to a ++ operation- Specified by:
incrementin interfaceIntegralDataTypeHolder- Returns:
- this, for method chaining
-
add
public IntegralDataTypeHolder add(long addend)
Description copied from interface:IntegralDataTypeHolderPerform an addition- Specified by:
addin interfaceIntegralDataTypeHolder- Parameters:
addend- The value to add to this integral.- Returns:
- this, for method chaining
-
decrement
public IntegralDataTypeHolder decrement()
Description copied from interface:IntegralDataTypeHolderEquivalent to a -- operation- Specified by:
decrementin interfaceIntegralDataTypeHolder- Returns:
- this, for method chaining
-
subtract
public IntegralDataTypeHolder subtract(long subtrahend)
Description copied from interface:IntegralDataTypeHolderPerform a subtraction- Specified by:
subtractin interfaceIntegralDataTypeHolder- Parameters:
subtrahend- The value to subtract from this integral.- Returns:
- this, for method chaining
-
multiplyBy
public IntegralDataTypeHolder multiplyBy(IntegralDataTypeHolder factor)
Description copied from interface:IntegralDataTypeHolderPerform a multiplication.- Specified by:
multiplyByin interfaceIntegralDataTypeHolder- Parameters:
factor- The factor by which to multiple this integral- Returns:
- this, for method chaining
-
multiplyBy
public IntegralDataTypeHolder multiplyBy(long factor)
Description copied from interface:IntegralDataTypeHolderPerform a multiplication.- Specified by:
multiplyByin interfaceIntegralDataTypeHolder- Parameters:
factor- The factor by which to multiple this integral- Returns:
- this, for method chaining
-
eq
public boolean eq(IntegralDataTypeHolder other)
Description copied from interface:IntegralDataTypeHolderPerform an equality comparison check- Specified by:
eqin interfaceIntegralDataTypeHolder- Parameters:
other- The other value to check against our internal state- Returns:
- True if the two are equal
-
eq
public boolean eq(long value)
Description copied from interface:IntegralDataTypeHolderPerform an equality comparison check- Specified by:
eqin interfaceIntegralDataTypeHolder- Parameters:
value- The other value to check against our internal state- Returns:
- True if the two are equal
-
lt
public boolean lt(IntegralDataTypeHolder other)
Description copied from interface:IntegralDataTypeHolderPerform a "less than" comparison check. We check to see if our value is less than the incoming value...- Specified by:
ltin interfaceIntegralDataTypeHolder- Parameters:
other- The other value to check against our internal state- Returns:
- True if our value is less than the 'other' value.
-
lt
public boolean lt(long value)
Description copied from interface:IntegralDataTypeHolderPerform a "less than" comparison check. We check to see if our value is less than the incoming value...- Specified by:
ltin interfaceIntegralDataTypeHolder- Parameters:
value- The other value to check against our internal state- Returns:
- True if our value is less than the 'other' value.
-
gt
public boolean gt(IntegralDataTypeHolder other)
Description copied from interface:IntegralDataTypeHolderPerform a "greater than" comparison check. We check to see if our value is greater than the incoming value...- Specified by:
gtin interfaceIntegralDataTypeHolder- Parameters:
other- The other value to check against our internal state- Returns:
- True if our value is greater than the 'other' value.
-
gt
public boolean gt(long value)
Description copied from interface:IntegralDataTypeHolderPerform a "greater than" comparison check. We check to see if our value is greater than the incoming value...- Specified by:
gtin interfaceIntegralDataTypeHolder- Parameters:
value- The other value to check against our internal state- Returns:
- True if our value is greater than the 'other' value.
-
copy
public IntegralDataTypeHolder copy()
Description copied from interface:IntegralDataTypeHolderMake a copy of this holder.- Specified by:
copyin interfaceIntegralDataTypeHolder- Returns:
- The copy.
-
makeValue
public Number makeValue()
Description copied from interface:IntegralDataTypeHolderReturn the internal value.- Specified by:
makeValuein interfaceIntegralDataTypeHolder- Returns:
- The current internal value
-
makeValueThenIncrement
public Number makeValueThenIncrement()
Description copied from interface:IntegralDataTypeHolderIncrement the internal state, but return the pre-incremented value.- Specified by:
makeValueThenIncrementin interfaceIntegralDataTypeHolder- Returns:
- The pre-incremented internal value
-
makeValueThenAdd
public Number makeValueThenAdd(long addend)
Description copied from interface:IntegralDataTypeHolderIncrement the internal state by the given addend, but return the pre-incremented value.- Specified by:
makeValueThenAddin interfaceIntegralDataTypeHolder- Parameters:
addend- The value to be added to our internal state- Returns:
- The pre-incremented internal value
-
-