use of org.hibernate.type.spi.TypeConfigurationAware in project hibernate-orm by hibernate.
the class TypeFactory method custom.
public CustomType custom(Class<UserType> typeClass, Properties parameters) {
try {
UserType userType = typeClass.newInstance();
if (TypeConfigurationAware.class.isInstance(userType)) {
((TypeConfigurationAware) userType).setTypeConfiguration(typeConfiguration);
}
injectParameters(userType, parameters);
return new CustomType(userType);
} catch (Exception e) {
throw new MappingException("Unable to instantiate custom type: " + typeClass.getName(), e);
}
}
Aggregations