diff --git a/hibernate-core/src/main/java/org/hibernate/type/AbstractStandardBasicType.java b/hibernate-core/src/main/java/org/hibernate/type/AbstractStandardBasicType.java index 57ad57753803..2dba605cfa54 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/AbstractStandardBasicType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/AbstractStandardBasicType.java @@ -30,8 +30,6 @@ import java.sql.SQLException; import java.util.Map; -import org.dom4j.Node; - import org.hibernate.Hibernate; import org.hibernate.HibernateException; import org.hibernate.MappingException; @@ -40,7 +38,6 @@ import org.hibernate.engine.spi.Mapping; import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.engine.spi.SessionImplementor; -import org.hibernate.internal.util.StringHelper; import org.hibernate.internal.util.collections.ArrayHelper; import org.hibernate.metamodel.spi.relational.Size; import org.hibernate.type.descriptor.WrapperOptions; @@ -79,14 +76,6 @@ public T fromStringValue(String xml) throws HibernateException { return fromString( xml ); } - public String toXMLString(T value, SessionFactoryImplementor factory) throws HibernateException { - return toString( value ); - } - - public T fromXMLString(String xml, Mapping factory) throws HibernateException { - return StringHelper.isEmpty( xml ) ? null : fromStringValue( xml ); - } - protected MutabilityPlan getMutabilityPlan() { return javaTypeDescriptor.getMutabilityPlan(); } @@ -303,7 +292,7 @@ public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescrip @SuppressWarnings({ "unchecked" }) protected final void nullSafeSet(PreparedStatement st, Object value, int index, WrapperOptions options) throws SQLException { - remapSqlTypeDescriptor( options ).getBinder( javaTypeDescriptor ).bind( st, ( T ) value, index, options ); + remapSqlTypeDescriptor( options ).getBinder( javaTypeDescriptor ).bind( st, (T) value, index, options ); } protected SqlTypeDescriptor remapSqlTypeDescriptor(WrapperOptions options) { @@ -346,7 +335,7 @@ public final void beforeAssemble(Serializable cached, SessionImplementor session public final Object hydrate(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException { - return nullSafeGet(rs, names, session, owner); + return nullSafeGet( rs, names, session, owner ); } public final Object resolve(Object value, SessionImplementor session, Object owner) throws HibernateException { diff --git a/hibernate-core/src/main/java/org/hibernate/type/MetaType.java b/hibernate-core/src/main/java/org/hibernate/type/MetaType.java index e7c6c293d8d0..d1c333509c34 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/MetaType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/MetaType.java @@ -122,17 +122,7 @@ public void nullSafeSet( } public String toLoggableString(Object value, SessionFactoryImplementor factory) throws HibernateException { - return toXMLString(value, factory); - } - - public String toXMLString(Object value, SessionFactoryImplementor factory) - throws HibernateException { - return (String) value; //value is the entity name - } - - public Object fromXMLString(String xml, Mapping factory) - throws HibernateException { - return xml; //xml is the entity name + return value == null ? "" : value.toString(); } public String getName() { diff --git a/hibernate-core/src/main/java/org/hibernate/type/NullableType.java b/hibernate-core/src/main/java/org/hibernate/type/NullableType.java index 53e0b11b2c51..74af6028f742 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/NullableType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/NullableType.java @@ -27,7 +27,6 @@ import java.sql.ResultSet; import java.sql.SQLException; -import org.dom4j.Node; import org.jboss.logging.Logger; import org.hibernate.HibernateException; @@ -207,15 +206,6 @@ public final Object nullSafeGet(ResultSet rs, String name, SessionImplementor se return nullSafeGet( rs, name ); } - public final String toXMLString(Object value, SessionFactoryImplementor pc) - throws HibernateException { - return toString(value); - } - - public final Object fromXMLString(String xml, Mapping factory) throws HibernateException { - return xml==null || xml.length()==0 ? null : fromStringValue(xml); - } - public final int getColumnSpan(Mapping session) { return 1; } @@ -236,7 +226,7 @@ public Size[] defaultSizes(Mapping mapping) throws MappingException { @Override public boolean isEqual(Object x, Object y) { - return EqualsHelper.equals(x, y); + return EqualsHelper.equals( x, y ); } public String toLoggableString(Object value, SessionFactoryImplementor factory) {