org.hibernate.id
Class IdentifierGeneratorHelper.BasicHolder

java.lang.Object
  extended by 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
IdentifierGeneratorHelper.BasicHolder(Class exactType)
           
 
Method Summary
 IntegralDataTypeHolder add(long addend)
          Perform an addition
 void bind(PreparedStatement preparedStatement, int position)
          Bind this holders internal value to the given result set.
 IntegralDataTypeHolder copy()
          Make a copy of this holder.
 IntegralDataTypeHolder decrement()
          Equivalent to a -- operation
 boolean eq(IntegralDataTypeHolder other)
          Perform an equality comparison check
 boolean eq(long value)
          Perform an equality comparison check
 boolean equals(Object o)
           
 long getActualLongValue()
           
 boolean gt(IntegralDataTypeHolder other)
          Perform a "greater than" comparison check.
 boolean gt(long value)
          Perform a "greater than" comparison check.
 int hashCode()
           
 IntegralDataTypeHolder increment()
          Equivalent to a ++ operation
 IntegralDataTypeHolder 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(IntegralDataTypeHolder other)
          Perform a "less than" comparison check.
 boolean lt(long value)
          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(IntegralDataTypeHolder factor)
          Perform a multiplication.
 IntegralDataTypeHolder multiplyBy(long factor)
          Perform a multiplication.
 IntegralDataTypeHolder subtract(long subtrahend)
          Perform a subtraction
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IdentifierGeneratorHelper.BasicHolder

public IdentifierGeneratorHelper.BasicHolder(Class exactType)
Method Detail

getActualLongValue

public long getActualLongValue()

initialize

public IntegralDataTypeHolder initialize(long value)
Description copied from interface: IntegralDataTypeHolder
Initialize the internal value from the given primitive long.

Specified by:
initialize in interface IntegralDataTypeHolder
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 interface IntegralDataTypeHolder
Parameters:
resultSet - The JDBC result set
defaultValue - 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 holders internal value to the given result set.

Specified by:
bind in interface IntegralDataTypeHolder
Parameters:
preparedStatement - The JDBC prepared statement
position - 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 interface IntegralDataTypeHolder
Returns:
this, for method chaining

add

public IntegralDataTypeHolder add(long addend)
Description copied from interface: IntegralDataTypeHolder
Perform an addition

Specified by:
add in interface IntegralDataTypeHolder
Parameters:
addend - 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 interface IntegralDataTypeHolder
Returns:
this, for method chaining

subtract

public IntegralDataTypeHolder subtract(long subtrahend)
Description copied from interface: IntegralDataTypeHolder
Perform a subtraction

Specified by:
subtract in interface IntegralDataTypeHolder
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 interface IntegralDataTypeHolder
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 interface IntegralDataTypeHolder
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 interface IntegralDataTypeHolder
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 interface IntegralDataTypeHolder
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 interface IntegralDataTypeHolder
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 interface IntegralDataTypeHolder
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 interface IntegralDataTypeHolder
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 interface IntegralDataTypeHolder
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 interface IntegralDataTypeHolder
Returns:
The copy.

makeValue

public Number makeValue()
Description copied from interface: IntegralDataTypeHolder
Return the internal value.

Specified by:
makeValue in interface IntegralDataTypeHolder
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 interface IntegralDataTypeHolder
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 interface IntegralDataTypeHolder
Parameters:
addend - The value to be added to our internal state
Returns:
The pre-incremented internal value

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2001-2010 Red Hat, Inc. All Rights Reserved.