You need to create a CustomType as steve indicated. Here's part of what that implementation would look like, to help you out.
Code:
public Object nullSafeGet(ResultSet rs, String[] names, Object owner)
throws HibernateException, SQLException {
java.net.URL retVal = null;
retVal = new java.net.URL((String) Hibernate.STRING.nullSafeGet(rs, names[0]));
return retVal;
}
public void nullSafeSet(PreparedStatement st, Object value, int index)
throws HibernateException, SQLException {
if (value != null) {
if (value instanceof String) {
Hibernate.STRING.nullSafeSet(st, value, index);
}
else if (value instanceof java.net.URL) {
java.net.URL url = (java.net.URL)value;
Hibernate.STRING.nullSafeSet(st, url.toString(), index);
}
}
else {
st.setNull(index, Types.VARCHAR);
}
}