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 testGetReturnedClass.
@Test
public void testGetReturnedClass() {
IType typeFacade = null;
ClassType classType = new ClassType();
typeFacade = FACADE_FACTORY.createType(classType);
Assert.assertEquals(Class.class, typeFacade.getReturnedClass());
ArrayType arrayType = new ArrayType(null, null, null, String.class);
typeFacade = FACADE_FACTORY.createType(arrayType);
Assert.assertEquals(String[].class, typeFacade.getReturnedClass());
}
use of org.hibernate.type.ClassType in project jbosstools-hibernate by jbosstools.
the class TypeFacadeTest method testIsEntityType.
@Test
public void testIsEntityType() {
IType typeFacade = null;
ClassType classType = new ClassType();
typeFacade = FACADE_FACTORY.createType(classType);
Assert.assertFalse(typeFacade.isEntityType());
EntityType entityType = new ManyToOneType(null, null);
typeFacade = FACADE_FACTORY.createType(entityType);
Assert.assertTrue(entityType.isEntityType());
}
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 testIsOneToOne.
@Test
public void testIsOneToOne() {
IType typeFacade = null;
ClassType classType = new ClassType();
typeFacade = FACADE_FACTORY.createType(classType);
Assert.assertFalse(typeFacade.isOneToOne());
EntityType entityType = new ManyToOneType(null, null);
typeFacade = FACADE_FACTORY.createType(entityType);
Assert.assertFalse(entityType.isOneToOne());
OneToOneType oneToOneType = new OneToOneType(null, null, null, null, false, false, false, null, null);
typeFacade = FACADE_FACTORY.createType(oneToOneType);
Assert.assertTrue(oneToOneType.isOneToOne());
}
Aggregations