use of org.hibernate.type.spi.TypeConfiguration in project hibernate-orm by hibernate.
the class JavaTypeDescriptorRegistryTest method testAddDirectlyToJavaTypeDescriptorRegistry.
@Test
public void testAddDirectlyToJavaTypeDescriptorRegistry() {
TypeConfiguration typeConfiguration = new TypeConfiguration();
org.hibernate.type.descriptor.java.JavaTypeDescriptorRegistry.INSTANCE.addDescriptor(new CustomJavaTypeDescriptor());
JavaTypeDescriptor descriptor = typeConfiguration.getJavaTypeDescriptorRegistry().getDescriptor(CustomType.class);
assertThat(descriptor, instanceOf(CustomJavaTypeDescriptor.class));
}
use of org.hibernate.type.spi.TypeConfiguration in project hibernate-orm by hibernate.
the class StandardBasicTypeTemplateTest method testContributedBasicType.
@Test
public void testContributedBasicType() {
TypeConfiguration typeConfiguration = new TypeConfiguration();
typeConfiguration.getJavaTypeDescriptorRegistry().addDescriptor(ValidatingUrlJavaTypeDescriptor.INSTANCE);
typeConfiguration.getBasicTypeRegistry().register(new StandardBasicTypeTemplate<>(VarcharTypeDescriptor.INSTANCE, ValidatingUrlJavaTypeDescriptor.INSTANCE, REG_KEY));
final BasicType registeredType = typeConfiguration.getBasicTypeRegistry().getRegisteredType(REG_KEY);
assertThat(registeredType, notNullValue());
assertTyping(StandardBasicTypeTemplate.class, registeredType);
}
Aggregations