Skip to content

Commit

Permalink
Fix bug #72
Browse files Browse the repository at this point in the history
  • Loading branch information
ilopmar committed Sep 8, 2015
1 parent 50ff33b commit dd9a5c3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/java/net/kaleidos/hibernate/usertype/JsonMapType.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.hibernate.HibernateException;
import org.hibernate.engine.spi.SessionImplementor;
import org.hibernate.usertype.UserType;
import org.postgresql.util.PGobject;

import java.io.Serializable;
import java.lang.reflect.Type;
Expand Down Expand Up @@ -46,7 +47,7 @@ public int hashCode(Object x) throws HibernateException {

@Override
public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException {
String jsonString = (String) rs.getObject(names[0]);
String jsonString = ((PGobject)rs.getObject(names[0])).getValue();
return gson.fromJson(jsonString, userType);
}

Expand Down

0 comments on commit dd9a5c3

Please sign in to comment.