I am writing a Hibernate CompositeUserType, and in order to serialize the custom object to JDBC, I need to know the name of the table I am updating (because there is some configuration for my tool attached to the table).
The only way I can make this work right now, is to explicitly parameterize my UserType with the entity tablename, which is redundant and error-prone.
Is there a way to get to this information in "nullSafeSet" ?
public void nullSafeSet(PreparedStatement ps, Object value, int index,
SessionImplementor session)
throws HibernateException, SQLException {
// find out the entity table name here
If not, is there a way to get to the owning entity's definition during the initialization of the UserType (similar to how parameters are passed)?