Package org.hibernate.id
Class IdentifierGeneratorHelper.BasicHolder
java.lang.Object
org.hibernate.id.IdentifierGeneratorHelper.BasicHolder
- All Implemented Interfaces:
Serializable,IntegralDataTypeHolder
- Enclosing class:
IdentifierGeneratorHelper
@Internal
public static class IdentifierGeneratorHelper.BasicHolder
extends Object
implements IntegralDataTypeHolder
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(long addend) Perform an additionvoidbind(PreparedStatement preparedStatement, int position) Bind this holder's internal value to the given result set.copy()Make a copy of this holder.Equivalent to a -- operationbooleaneq(long value) Perform an equality comparison checkbooleaneq(IntegralDataTypeHolder other) Perform an equality comparison checkbooleanlongbooleangt(long value) Perform a "greater than" comparison check.booleangt(IntegralDataTypeHolder other) Perform a "greater than" comparison check.inthashCode()Equivalent to a ++ operationinitialize(long value) Initialize the internal value from the given primitive long.initialize(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.Return the internal value.makeValueThenAdd(long addend) Increment the internal state by the given addend, but return the pre-incremented value.Increment the internal state, but return the pre-incremented value.multiplyBy(long factor) Perform a multiplication.multiplyBy(IntegralDataTypeHolder factor) Perform a multiplication.subtract(long subtrahend) Perform a subtractionConvert the internal value toBigDecimal.Convert the internal value toBigInteger.longtoLong()Convert the internal value tolong.toString()
-
Constructor Details
-
BasicHolder
-
-
Method Details
-
getActualLongValue
public long getActualLongValue() -
initialize
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
Description copied from interface:IntegralDataTypeHolderBind this holder's 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
Description copied from interface:IntegralDataTypeHolderEquivalent to a ++ operation- Specified by:
incrementin interfaceIntegralDataTypeHolder- Returns:
this, for method chaining
-
add
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
Description copied from interface:IntegralDataTypeHolderEquivalent to a -- operation- Specified by:
decrementin interfaceIntegralDataTypeHolder- Returns:
this, for method chaining
-
subtract
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
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
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
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
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
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
Description copied from interface:IntegralDataTypeHolderMake a copy of this holder.- Specified by:
copyin interfaceIntegralDataTypeHolder- Returns:
- The copy.
-
makeValue
Description copied from interface:IntegralDataTypeHolderReturn the internal value.- Specified by:
makeValuein interfaceIntegralDataTypeHolder- Returns:
- The current internal value
-
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
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
-
toLong
public long toLong()Description copied from interface:IntegralDataTypeHolderConvert the internal value tolong.- Specified by:
toLongin interfaceIntegralDataTypeHolder
-
toBigDecimal
Description copied from interface:IntegralDataTypeHolderConvert the internal value toBigDecimal.- Specified by:
toBigDecimalin interfaceIntegralDataTypeHolder
-
toBigInteger
Description copied from interface:IntegralDataTypeHolderConvert the internal value toBigInteger.- Specified by:
toBigIntegerin interfaceIntegralDataTypeHolder
-
toString
-
equals
-
hashCode
public int hashCode()
-