HHH-4881: Use Loadable.getDiscriminatorValue() for nullSafeSet
This commit is contained in:
parent
11ef3e0765
commit
308847f526
|
@ -109,9 +109,9 @@ public class DiscriminatorType extends AbstractType {
|
|||
Object value,
|
||||
int index,
|
||||
SessionImplementor session) throws HibernateException, SQLException {
|
||||
throw new UnsupportedOperationException(
|
||||
"At the moment this type is not the one actually used to map the discriminator."
|
||||
);
|
||||
String entityName = session.getFactory().getClassMetadata((Class) value).getEntityName();
|
||||
Loadable entityPersister = (Loadable) session.getFactory().getEntityPersister(entityName);
|
||||
underlyingType.nullSafeSet(st, entityPersister.getDiscriminatorValue(), index, session);
|
||||
}
|
||||
|
||||
public String toLoggableString(Object value, SessionFactoryImplementor factory) throws HibernateException {
|
||||
|
|
Loading…
Reference in New Issue