Search in sources :

Example 6 with ManyToOneType

use of org.hibernate.type.ManyToOneType 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());
}
Also used : EntityType(org.hibernate.type.EntityType) ManyToOneType(org.hibernate.type.ManyToOneType) ClassType(org.hibernate.type.ClassType) IType(org.jboss.tools.hibernate.runtime.spi.IType) Test(org.junit.Test)

Example 7 with ManyToOneType

use of org.hibernate.type.ManyToOneType 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());
}
Also used : EntityType(org.hibernate.type.EntityType) ManyToOneType(org.hibernate.type.ManyToOneType) ClassType(org.hibernate.type.ClassType) IType(org.jboss.tools.hibernate.runtime.spi.IType) Test(org.junit.Test)

Example 8 with ManyToOneType

use of org.hibernate.type.ManyToOneType 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, false, null, false, false, null, null);
    typeFacade = FACADE_FACTORY.createType(oneToOneType);
    Assert.assertTrue(oneToOneType.isOneToOne());
}
Also used : EntityType(org.hibernate.type.EntityType) ManyToOneType(org.hibernate.type.ManyToOneType) ClassType(org.hibernate.type.ClassType) IType(org.jboss.tools.hibernate.runtime.spi.IType) OneToOneType(org.hibernate.type.OneToOneType) Test(org.junit.Test)

Example 9 with ManyToOneType

use of org.hibernate.type.ManyToOneType 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());
}
Also used : EntityType(org.hibernate.type.EntityType) ManyToOneType(org.hibernate.type.ManyToOneType) ClassType(org.hibernate.type.ClassType) IType(org.jboss.tools.hibernate.runtime.spi.IType) Test(org.junit.Test)

Example 10 with ManyToOneType

use of org.hibernate.type.ManyToOneType 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((TypeScope) null, null);
    typeFacade = FACADE_FACTORY.createType(entityType);
    Assert.assertFalse(entityType.isOneToOne());
    OneToOneType oneToOneType = new OneToOneType(null, null, null, false, null, false, false, null, null);
    typeFacade = FACADE_FACTORY.createType(oneToOneType);
    Assert.assertTrue(oneToOneType.isOneToOne());
}
Also used : EntityType(org.hibernate.type.EntityType) ManyToOneType(org.hibernate.type.ManyToOneType) ClassType(org.hibernate.type.ClassType) IType(org.jboss.tools.hibernate.runtime.spi.IType) OneToOneType(org.hibernate.type.OneToOneType) Test(org.junit.Test)

Aggregations

ManyToOneType (org.hibernate.type.ManyToOneType)35 Test (org.junit.Test)28 ClassType (org.hibernate.type.ClassType)24 EntityType (org.hibernate.type.EntityType)24 IType (org.jboss.tools.hibernate.runtime.spi.IType)24 OneToOneType (org.hibernate.type.OneToOneType)11 Type (org.hibernate.type.Type)9 ComponentType (org.hibernate.type.ComponentType)7 HashMap (java.util.HashMap)4 Query (org.hibernate.Query)4 Session (org.hibernate.Session)4 Transaction (org.hibernate.Transaction)4 DiscriminatorType (org.hibernate.persister.entity.DiscriminatorType)4 TransactionUtil2.inTransaction (org.hibernate.testing.transaction.TransactionUtil2.inTransaction)4 ArrayList (java.util.ArrayList)2 List (java.util.List)2 PersistentClass (org.hibernate.mapping.PersistentClass)2 CollectionType (org.hibernate.type.CollectionType)2 SetType (org.hibernate.type.SetType)2 Element (org.dom4j.Element)1