HHH-4881: Use Loadable.getDiscriminatorValue() for nullSafeSet

This commit is contained in:
James Gilbertson 2011-10-07 20:09:43 -06:00 committed by Strong Liu
parent 11ef3e0765
commit 308847f526
1 changed files with 3 additions and 3 deletions

View File

@ -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 {