Methods Summary |
---|
public abstract java.lang.Object | fromStringValue(java.lang.String xml)
|
public java.lang.Object | fromXMLNode(org.dom4j.Node xml, org.hibernate.engine.Mapping factory)
return fromXMLString( xml.getText(), factory );
|
public final java.lang.Object | fromXMLString(java.lang.String xml, org.hibernate.engine.Mapping factory)
return xml==null || xml.length()==0 ? null : fromStringValue(xml);
|
public abstract java.lang.Object | get(java.sql.ResultSet rs, java.lang.String name)Get a column value from a result set, without worrying about the
possibility of null values. Called from {@link #nullSafeGet} after
nullness checks have been performed.
|
public final int | getColumnSpan(org.hibernate.engine.Mapping session)
return 1;
|
public boolean | isDirty(java.lang.Object old, java.lang.Object current, boolean[] checkable, org.hibernate.engine.SessionImplementor session)
return checkable[0] && isDirty(old, current, session);
|
public final boolean | isEqual(java.lang.Object x, java.lang.Object y, org.hibernate.EntityMode entityMode)
return isEqual(x, y);
|
public boolean | isEqual(java.lang.Object x, java.lang.Object y)
return EqualsHelper.equals(x, y);
|
private org.apache.commons.logging.Log | log()
if ( log == null ) {
log = LogFactory.getLog( getClass() );
}
return log;
|
public final java.lang.Object | nullSafeGet(java.sql.ResultSet rs, java.lang.String[] names, org.hibernate.engine.SessionImplementor session, java.lang.Object owner)
return nullSafeGet(rs, names[0]);
|
public final java.lang.Object | nullSafeGet(java.sql.ResultSet rs, java.lang.String[] names)
return nullSafeGet(rs, names[0]);
|
public final java.lang.Object | nullSafeGet(java.sql.ResultSet rs, java.lang.String name)
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 java.lang.Object | nullSafeGet(java.sql.ResultSet rs, java.lang.String name, org.hibernate.engine.SessionImplementor session, java.lang.Object owner)
return nullSafeGet(rs, name);
|
public final void | nullSafeSet(java.sql.PreparedStatement st, java.lang.Object value, int index)
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(java.sql.PreparedStatement st, java.lang.Object value, int index, boolean[] settable, org.hibernate.engine.SessionImplementor session)
if ( settable[0] ) {
nullSafeSet(st, value, index);
}
|
public final void | nullSafeSet(java.sql.PreparedStatement st, java.lang.Object value, int index, org.hibernate.engine.SessionImplementor session)
nullSafeSet(st, value, index);
|
public java.lang.String | nullSafeToString(java.lang.Object value)A null-safe version of {@link #toString(Object)}. Specifically we are
worried about null safeness in regards to the incoming value parameter,
not the return.
return value == null ? null : toString( value );
|
public abstract void | set(java.sql.PreparedStatement st, java.lang.Object value, int index)Set a parameter value without worrying about the possibility of null
values. Called from {@link #nullSafeSet} after nullness checks have
been performed.
|
public void | setToXMLNode(org.dom4j.Node xml, java.lang.Object value, org.hibernate.engine.SessionFactoryImplementor factory)
xml.setText( toXMLString(value, factory) );
|
public abstract int | sqlType()A convenience form of {@link #sqlTypes(org.hibernate.engine.Mapping)}, returning
just a single type value since these are explicitly dealing with single column
mappings.
|
public final int[] | sqlTypes(org.hibernate.engine.Mapping session)
return new int[] { sqlType() };
|
public boolean[] | toColumnNullness(java.lang.Object value, org.hibernate.engine.Mapping mapping)
return value==null ? ArrayHelper.FALSE : ArrayHelper.TRUE;
|
public java.lang.String | toLoggableString(java.lang.Object value, org.hibernate.engine.SessionFactoryImplementor factory)
return value==null ? "null" : toString(value);
|
public abstract java.lang.String | toString(java.lang.Object value)
|
public final java.lang.String | toXMLString(java.lang.Object value, org.hibernate.engine.SessionFactoryImplementor pc)
return toString(value);
|