Package org.hibernate.id
Class IdentifierGeneratorHelper.BigDecimalHolder
- java.lang.Object
-
- org.hibernate.id.IdentifierGeneratorHelper.BigDecimalHolder
-
- All Implemented Interfaces:
Serializable
,IntegralDataTypeHolder
- Enclosing class:
- IdentifierGeneratorHelper
public static class IdentifierGeneratorHelper.BigDecimalHolder extends Object implements IntegralDataTypeHolder
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BigDecimalHolder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IntegralDataTypeHolder
add(long increment)
Perform an additionvoid
bind(PreparedStatement preparedStatement, int position)
Bind this holder's internal value to the given result set.IntegralDataTypeHolder
copy()
Make a copy of this holder.IntegralDataTypeHolder
decrement()
Equivalent to a -- operationboolean
eq(long value)
Perform an equality comparison checkboolean
eq(IntegralDataTypeHolder other)
Perform an equality comparison checkboolean
equals(Object o)
boolean
gt(long value)
Perform a "greater than" comparison check.boolean
gt(IntegralDataTypeHolder other)
Perform a "greater than" comparison check.int
hashCode()
IntegralDataTypeHolder
increment()
Equivalent to a ++ operationIntegralDataTypeHolder
initialize(long value)
Initialize the internal value from the given primitive long.IntegralDataTypeHolder
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.Number
makeValue()
Return the internal value.Number
makeValueThenAdd(long addend)
Increment the internal state by the given addend, but return the pre-incremented value.Number
makeValueThenIncrement()
Increment the internal state, but return the pre-incremented value.IntegralDataTypeHolder
multiplyBy(long factor)
Perform a multiplication.IntegralDataTypeHolder
multiplyBy(IntegralDataTypeHolder factor)
Perform a multiplication.IntegralDataTypeHolder
subtract(long subtrahend)
Perform a subtractionString
toString()
-
-
-
Method Detail
-
initialize
public IntegralDataTypeHolder initialize(long value)
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
public void bind(PreparedStatement preparedStatement, int position) throws SQLException
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
public IntegralDataTypeHolder increment()
Description copied from interface:IntegralDataTypeHolder
Equivalent to a ++ operation- Specified by:
increment
in interfaceIntegralDataTypeHolder
- Returns:
this
, for method chaining
-
add
public IntegralDataTypeHolder add(long increment)
Description copied from interface:IntegralDataTypeHolder
Perform an addition- Specified by:
add
in interfaceIntegralDataTypeHolder
- Parameters:
increment
- The value to add to this integral.- Returns:
this
, for method chaining
-
decrement
public IntegralDataTypeHolder decrement()
Description copied from interface:IntegralDataTypeHolder
Equivalent to a -- operation- Specified by:
decrement
in interfaceIntegralDataTypeHolder
- Returns:
this
, for method chaining
-
subtract
public IntegralDataTypeHolder subtract(long subtrahend)
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
public IntegralDataTypeHolder multiplyBy(IntegralDataTypeHolder factor)
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
public IntegralDataTypeHolder multiplyBy(long factor)
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
public boolean eq(IntegralDataTypeHolder other)
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
public boolean lt(IntegralDataTypeHolder other)
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
public boolean gt(IntegralDataTypeHolder other)
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
public IntegralDataTypeHolder copy()
Description copied from interface:IntegralDataTypeHolder
Make a copy of this holder.- Specified by:
copy
in interfaceIntegralDataTypeHolder
- Returns:
- The copy.
-
makeValue
public Number makeValue()
Description copied from interface:IntegralDataTypeHolder
Return the internal value.- Specified by:
makeValue
in interfaceIntegralDataTypeHolder
- Returns:
- The current internal value
-
makeValueThenIncrement
public Number 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
public Number makeValueThenAdd(long addend)
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
-
-