use of org.hibernate.type.ClassType in project jbosstools-hibernate by jbosstools.
the class TypeFacadeTest method testIsInstanceOfPrimitiveType.
@Test
public void testIsInstanceOfPrimitiveType() {
IType typeFacade = null;
ClassType classType = new ClassType();
typeFacade = FACADE_FACTORY.createType(classType);
Assert.assertFalse(typeFacade.isInstanceOfPrimitiveType());
StringType stringType = new StringType();
typeFacade = FACADE_FACTORY.createType(stringType);
Assert.assertFalse(typeFacade.isInstanceOfPrimitiveType());
IntegerType integerType = new IntegerType();
typeFacade = FACADE_FACTORY.createType(integerType);
Assert.assertTrue(typeFacade.isInstanceOfPrimitiveType());
}
use of org.hibernate.type.ClassType in project jbosstools-hibernate by jbosstools.
the class TypeFacadeTest method testIsComponentType.
@Test
public void testIsComponentType() {
IType typeFacade = null;
ClassType classType = new ClassType();
typeFacade = FACADE_FACTORY.createType(classType);
Assert.assertFalse(typeFacade.isComponentType());
MetadataBuildingOptions mdbo = new MetadataBuilderImpl.MetadataBuildingOptionsImpl(new StandardServiceRegistryBuilder().build());
MetadataImplementor mdi = (MetadataImplementor) new MetadataBuilderImpl(new MetadataSources()).build();
ComponentType componentType = new ComponentType(null, new ComponentMetamodel(new Component(mdi, new RootClass(null)), mdbo));
typeFacade = FACADE_FACTORY.createType(componentType);
Assert.assertTrue(typeFacade.isComponentType());
}
use of org.hibernate.type.ClassType in project jbosstools-hibernate by jbosstools.
the class TypeFacadeTest method testFromStringValue.
@Test
public void testFromStringValue() {
IType typeFacade = null;
ClassType classType = new ClassType();
typeFacade = FACADE_FACTORY.createType(classType);
Assert.assertEquals(TypeFacadeTest.class, typeFacade.fromStringValue(TypeFacadeTest.class.getName()));
ArrayType arrayType = new ArrayType(null, "foo", "bar", String.class);
typeFacade = FACADE_FACTORY.createType(arrayType);
Assert.assertNull(typeFacade.fromStringValue("just a random string"));
}
use of org.hibernate.type.ClassType in project jbosstools-hibernate by jbosstools.
the class TypeFacadeTest method testGetRole.
@Test
public void testGetRole() {
IType typeFacade = null;
ClassType classType = new ClassType();
typeFacade = FACADE_FACTORY.createType(classType);
Assert.assertNull(typeFacade.getRole());
ArrayType arrayType = new ArrayType(null, "foo", null, String.class);
typeFacade = FACADE_FACTORY.createType(arrayType);
Assert.assertEquals("foo", typeFacade.getRole());
}
use of org.hibernate.type.ClassType in project jbosstools-hibernate by jbosstools.
the class TypeFacadeTest method testGetAssociatedEntityName.
@Test
public void testGetAssociatedEntityName() {
IType typeFacade = null;
ClassType classType = new ClassType();
typeFacade = FACADE_FACTORY.createType(classType);
Assert.assertNull(typeFacade.getAssociatedEntityName());
EntityType entityType = new ManyToOneType(null, "foo");
typeFacade = FACADE_FACTORY.createType(entityType);
Assert.assertEquals("foo", typeFacade.getAssociatedEntityName());
}
Aggregations