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 additionvoid
bind
(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 -- operationboolean
eq
(long value) Perform an equality comparison checkboolean
eq
(IntegralDataTypeHolder other) Perform an equality comparison checkboolean
long
boolean
gt
(long value) Perform a "greater than" comparison check.boolean
gt
(IntegralDataTypeHolder other) Perform a "greater than" comparison check.int
hashCode()
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).boolean
lt
(long value) Perform a "less than" comparison check.boolean
lt
(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 subtractiontoString()
-
Constructor Details
-
BasicHolder
-
-
Method Details
-
getActualLongValue
public long getActualLongValue() -
initialize
Description copied from interface:IntegralDataTypeHolder
Initialize the internal value from the given primitive long.- Specified by:
initialize
in 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:IntegralDataTypeHolder
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).- Specified by:
initialize
in 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:IntegralDataTypeHolder
Bind this holder's internal value to the given result set.- Specified by:
bind
in 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:IntegralDataTypeHolder
Equivalent to a ++ operation- Specified by:
increment
in interfaceIntegralDataTypeHolder
- Returns:
this
, for method chaining
-
add
Description copied from interface:IntegralDataTypeHolder
Perform an addition- Specified by:
add
in interfaceIntegralDataTypeHolder
- Parameters:
addend
- The value to add to this integral.- Returns:
this
, for method chaining
-
decrement
Description copied from interface:IntegralDataTypeHolder
Equivalent to a -- operation- Specified by:
decrement
in interfaceIntegralDataTypeHolder
- Returns:
this
, for method chaining
-
subtract
Description copied from interface:IntegralDataTypeHolder
Perform a subtraction- Specified by:
subtract
in interfaceIntegralDataTypeHolder
- Parameters:
subtrahend
- The value to subtract from this integral.- Returns:
this
, for method chaining
-
multiplyBy
Description copied from interface:IntegralDataTypeHolder
Perform a multiplication.- Specified by:
multiplyBy
in interfaceIntegralDataTypeHolder
- Parameters:
factor
- The factor by which to multiple this integral- Returns:
this
, for method chaining
-
multiplyBy
Description copied from interface:IntegralDataTypeHolder
Perform a multiplication.- Specified by:
multiplyBy
in interfaceIntegralDataTypeHolder
- Parameters:
factor
- The factor by which to multiple this integral- Returns:
this
, for method chaining
-
eq
Description copied from interface:IntegralDataTypeHolder
Perform an equality comparison check- Specified by:
eq
in 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:IntegralDataTypeHolder
Perform an equality comparison check- Specified by:
eq
in interfaceIntegralDataTypeHolder
- Parameters:
value
- The other value to check against our internal state- Returns:
- True if the two are equal
-
lt
Description copied from interface:IntegralDataTypeHolder
Perform a "less than" comparison check. We check to see if our value is less than the incoming value...- Specified by:
lt
in 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:IntegralDataTypeHolder
Perform a "less than" comparison check. We check to see if our value is less than the incoming value...- Specified by:
lt
in 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:IntegralDataTypeHolder
Perform a "greater than" comparison check. We check to see if our value is greater than the incoming value...- Specified by:
gt
in 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:IntegralDataTypeHolder
Perform a "greater than" comparison check. We check to see if our value is greater than the incoming value...- Specified by:
gt
in 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:IntegralDataTypeHolder
Make a copy of this holder.- Specified by:
copy
in interfaceIntegralDataTypeHolder
- Returns:
- The copy.
-
makeValue
Description copied from interface:IntegralDataTypeHolder
Return the internal value.- Specified by:
makeValue
in interfaceIntegralDataTypeHolder
- Returns:
- The current internal value
-
makeValueThenIncrement
Description copied from interface:IntegralDataTypeHolder
Increment the internal state, but return the pre-incremented value.- Specified by:
makeValueThenIncrement
in interfaceIntegralDataTypeHolder
- Returns:
- The pre-incremented internal value
-
makeValueThenAdd
Description copied from interface:IntegralDataTypeHolder
Increment the internal state by the given addend, but return the pre-incremented value.- Specified by:
makeValueThenAdd
in interfaceIntegralDataTypeHolder
- Parameters:
addend
- The value to be added to our internal state- Returns:
- The pre-incremented internal value
-
toString
-
equals
-
hashCode
public int hashCode()
-