Superclass of single-column nullable types.
| Method from org.hibernate.type.NullableType Detail: |
abstract public Object fromStringValue(String xml) throws HibernateException
|
public Object fromXMLNode(Node xml,
Mapping factory) throws HibernateException {
return fromXMLString( xml.getText(), factory );
}
|
public final Object fromXMLString(String xml,
Mapping factory) throws HibernateException {
return xml==null || xml.length()==0 ? null : fromStringValue(xml);
}
|
abstract public Object get(ResultSet rs,
String name) throws HibernateException, SQLException
Get a column value from a result set, without worrying about the
possibility of null values. Called from #nullSafeGet after
nullness checks have been performed. |
public final int getColumnSpan(Mapping session) {
return 1;
}
|
public boolean isDirty(Object old,
Object current,
boolean[] checkable,
SessionImplementor session) throws HibernateException {
return checkable[0] && isDirty(old, current, session);
}
|
public boolean isEqual(Object x,
Object y) {
return EqualsHelper.equals(x, y);
}
|
public final boolean isEqual(Object x,
Object y,
EntityMode entityMode) {
return isEqual(x, y);
}
|
public final Object nullSafeGet(ResultSet rs,
String[] names) throws HibernateException, SQLException {
return nullSafeGet(rs, names[0]);
}
|
public final Object nullSafeGet(ResultSet rs,
String name) throws HibernateException, SQLException {
try {
Object value = get(rs, name);
if ( value == null || rs.wasNull() ) {
if ( IS_VALUE_TRACING_ENABLED ) {
log().trace( "returning null as column: " + name );
}
return null;
}
else {
if ( IS_VALUE_TRACING_ENABLED ) {
log().trace( "returning '" + toString( value ) + "' as column: " + name );
}
return value;
}
}
catch ( RuntimeException re ) {
log().info( "could not read column value from result set: " + name + "; " + re.getMessage() );
throw re;
}
catch ( SQLException se ) {
log().info( "could not read column value from result set: " + name + "; " + se.getMessage() );
throw se;
}
}
|
public final Object nullSafeGet(ResultSet rs,
String[] names,
SessionImplementor session,
Object owner) throws HibernateException, SQLException {
return nullSafeGet(rs, names[0]);
}
|
public final Object nullSafeGet(ResultSet rs,
String name,
SessionImplementor session,
Object owner) throws HibernateException, SQLException {
return nullSafeGet(rs, name);
}
|
public final void nullSafeSet(PreparedStatement st,
Object value,
int index) throws HibernateException, SQLException {
try {
if ( value == null ) {
if ( IS_VALUE_TRACING_ENABLED ) {
log().trace( "binding null to parameter: " + index );
}
st.setNull( index, sqlType() );
}
else {
if ( IS_VALUE_TRACING_ENABLED ) {
log().trace( "binding '" + toString( value ) + "' to parameter: " + index );
}
set( st, value, index );
}
}
catch ( RuntimeException re ) {
log().info( "could not bind value '" + nullSafeToString( value ) + "' to parameter: " + index + "; " + re.getMessage() );
throw re;
}
catch ( SQLException se ) {
log().info( "could not bind value '" + nullSafeToString( value ) + "' to parameter: " + index + "; " + se.getMessage() );
throw se;
}
}
|
public final void nullSafeSet(PreparedStatement st,
Object value,
int index,
SessionImplementor session) throws HibernateException, SQLException {
nullSafeSet(st, value, index);
}
|
public final void nullSafeSet(PreparedStatement st,
Object value,
int index,
boolean[] settable,
SessionImplementor session) throws HibernateException, SQLException {
if ( settable[0] ) nullSafeSet(st, value, index);
}
|
public String nullSafeToString(Object value) throws HibernateException {
return value == null ? null : toString( value );
}
A null-safe version of #toString(Object) . Specifically we are
worried about null safeness in regards to the incoming value parameter,
not the return. |
abstract public void set(PreparedStatement st,
Object value,
int index) throws HibernateException, SQLException
Set a parameter value without worrying about the possibility of null
values. Called from #nullSafeSet after nullness checks have
been performed. |
public void setToXMLNode(Node xml,
Object value,
SessionFactoryImplementor factory) throws HibernateException {
xml.setText( toXMLString(value, factory) );
}
|
abstract public int sqlType()
|
public final int[] sqlTypes(Mapping session) {
return new int[] { sqlType() };
}
|
public boolean[] toColumnNullness(Object value,
Mapping mapping) {
return value==null ? ArrayHelper.FALSE : ArrayHelper.TRUE;
}
|
public String toLoggableString(Object value,
SessionFactoryImplementor factory) {
return value == null ? "null" : toString(value);
}
|
abstract public String toString(Object value) throws HibernateException
|
public final String toXMLString(Object value,
SessionFactoryImplementor pc) throws HibernateException {
return toString(value);
}
|