Fix type definition issues
This commit is contained in:
parent
3d612812b0
commit
05a724d757
|
@ -7,6 +7,11 @@ import java.sql.PreparedStatement;
|
|||
import java.sql.SQLException;
|
||||
import java.sql.Types;
|
||||
|
||||
/**
|
||||
* @deprecated hibernate's abstract class is depricated and those type of conversions and checks
|
||||
* are done by hibernate itself
|
||||
*/
|
||||
@Deprecated
|
||||
public class PostgreSQLEnumType extends org.hibernate.type.EnumType {
|
||||
|
||||
public void nullSafeSet(
|
||||
|
|
|
@ -42,7 +42,12 @@ public class UUIDType implements UserType<UUID> {
|
|||
|
||||
@Override
|
||||
public UUID nullSafeGet(ResultSet rs, int position, SharedSessionContractImplementor session, Object owner) throws SQLException {
|
||||
return null;
|
||||
assert (position >= 0);
|
||||
Object value = rs.getObject(position);
|
||||
if (value == null) return null;
|
||||
|
||||
UUID uuid = UUID.fromString(rs.getString(position));
|
||||
return rs.wasNull() ? null : uuid;
|
||||
}
|
||||
|
||||
public Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws HibernateException, SQLException {
|
||||
|
|
|
@ -44,7 +44,9 @@ public class XMLType implements UserType<String> {
|
|||
|
||||
@Override
|
||||
public String nullSafeGet(ResultSet resultSet, int i, SharedSessionContractImplementor sharedSessionContractImplementor, Object o) throws SQLException {
|
||||
return null;
|
||||
assert (i >= 0);
|
||||
String xmldoc = resultSet.getString(i);
|
||||
return resultSet.wasNull() ? null : xmldoc;
|
||||
}
|
||||
|
||||
public Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws HibernateException, SQLException {
|
||||
|
|
Loading…
Reference in New Issue