Package org.caffinitas.mapper.core

Examples of org.caffinitas.mapper.core.MappedSchemaObject


    }

    @Test(dependsOnMethods = "createSchema")
    public void userTypeCompEntity() throws Exception {

        MappedSchemaObject entity = persistenceManager.getEntity(UserTypeCompEntity.class);
        MappedSchemaObject composite = persistenceManager.getComposite(UserTypeComposite.class);
        MappedSchemaObject compositeNext = persistenceManager.getComposite(NextUserTypeComposite.class);
        createIfNecessary(entity, composite, compositeNext);
        Assert.assertEquals(entity.getAttributeNames().size(), 2);

        UserTypeCompEntity inst = new UserTypeCompEntity();
        inst.setId(11);
View Full Code Here


        } finally {session.close();}
    }

    @SuppressWarnings("unchecked") @Test(dependsOnMethods = "createSchema")
    public void userTypeComposites_list() throws Exception {
        MappedSchemaObject entity = persistenceManager.getEntity(UserTypeCompInListEntity.class);
        MappedSchemaObject composite = persistenceManager.getComposite(UserTypeComposite.class);
        MappedSchemaObject compositeNext = persistenceManager.getComposite(NextUserTypeComposite.class);
        createIfNecessary(entity, composite, compositeNext);

        Assert.assertNotNull(entity);

        Assert.assertNotNull(entity.getAttributeByPath("id"));
View Full Code Here

        } finally {session.close();}
    }

    @SuppressWarnings("unchecked") @Test(dependsOnMethods = "createSchema")
    public void userTypeComposites_set() throws Exception {
        MappedSchemaObject entity = persistenceManager.getEntity(UserTypeCompInSetEntity.class);
        MappedSchemaObject composite = persistenceManager.getComposite(UserTypeComposite.class);
        MappedSchemaObject compositeNext = persistenceManager.getComposite(NextUserTypeComposite.class);
        createIfNecessary(entity, composite, compositeNext);

        Assert.assertNotNull(entity);

        Assert.assertNotNull(entity.getAttributeByPath("id"));
View Full Code Here

        } finally {session.close();}
    }

    @SuppressWarnings("unchecked") @Test(dependsOnMethods = "createSchema")
    public void userTypeComposites_mapKey() throws Exception {
        MappedSchemaObject entity = persistenceManager.getEntity(UserTypeCompInMapKeyEntity.class);
        MappedSchemaObject composite = persistenceManager.getComposite(UserTypeComposite.class);
        MappedSchemaObject compositeNext = persistenceManager.getComposite(NextUserTypeComposite.class);
        createIfNecessary(entity, composite, compositeNext);

        Assert.assertNotNull(entity);

        Assert.assertNotNull(entity.getAttributeByPath("id"));
View Full Code Here

        } finally {session.close();}
    }

    @SuppressWarnings("unchecked") @Test(dependsOnMethods = "createSchema")
    public void userTypeComposites_mapValue() throws Exception {
        MappedSchemaObject entity = persistenceManager.getEntity(UserTypeCompInMapValueEntity.class);
        MappedSchemaObject composite = persistenceManager.getComposite(UserTypeComposite.class);
        MappedSchemaObject compositeNext = persistenceManager.getComposite(NextUserTypeComposite.class);
        createIfNecessary(entity, composite, compositeNext);

        Assert.assertNotNull(entity);

        Assert.assertNotNull(entity.getAttributeByPath("id"));
View Full Code Here

        } finally {session.close();}
    }

    @SuppressWarnings("unchecked") @Test(dependsOnMethods = "createSchema")
    public void userTypeComposites_map() throws Exception {
        MappedSchemaObject entity = persistenceManager.getEntity(UserTypeCompInMapEntity.class);
        MappedSchemaObject composite = persistenceManager.getComposite(UserTypeComposite.class);
        MappedSchemaObject compositeNext = persistenceManager.getComposite(NextUserTypeComposite.class);
        createIfNecessary(entity, composite, compositeNext);

        Assert.assertNotNull(entity);

        Assert.assertNotNull(entity.getAttributeByPath("id"));
View Full Code Here

    }

    protected static void createSchemaDo(List<Class<?>> entityClasses) {
        List<MappedSchemaObject> mappedClassObjects = new ArrayList<MappedSchemaObject>();
        for (Class<?> cls : entityClasses) {
            MappedSchemaObject e = persistenceManager.getEntity(cls);
            if (e != null) {
                mappedClassObjects.add(e);
            }
            MappedSchemaObject c = persistenceManager.getComposite(cls);
            if (c != null) {
                mappedClassObjects.add(c);
            }
        }
        for (MappedSchemaObject entity : mappedClassObjects) {
View Full Code Here

    }

    @Test(dependsOnMethods = "createSchema")
    public void inheritanceSingleTable() throws Exception {

        MappedSchemaObject entityBase = persistenceManager.getEntity(StBaseEntity.class);
        MappedSchemaObject entityA = persistenceManager.getEntity(StInheritA.class);
        MappedSchemaObject entityB = persistenceManager.getEntity(StInheritB.class);
        MappedSchemaObject entityB2 = persistenceManager.getEntity(StInheritB2.class);
        MappedSchemaObject entityC = persistenceManager.getEntity(StInheritC.class);
        Assert.assertEquals(entityBase.getAttributeNames().size(), 3);
        Assert.assertEquals(entityA.getAttributeNames().size(), 4);
        Assert.assertEquals(entityB.getAttributeNames().size(), 4);
        Assert.assertEquals(entityB2.getAttributeNames().size(), 5);
        Assert.assertEquals(entityC.getAttributeNames().size(), 4);
        Assert.assertEquals(entityBase.getAllColumns().length, 8);
        Assert.assertEquals(entityA.getAllColumns().length, 8);
        Assert.assertEquals(entityB.getAllColumns().length, 8);
        Assert.assertEquals(entityB2.getAllColumns().length, 8);
        Assert.assertEquals(entityC.getAllColumns().length, 8);

        waitEntityAvailable(entityBase);

        PersistenceSession session = persistenceManager.createSession();
        try {
View Full Code Here

    }

    @Test(dependsOnMethods = "createSchema")
    public void inheritanceTablePerClass() throws Exception {

        MappedSchemaObject entityBase = persistenceManager.getEntity(TpcBaseEntity.class);
        MappedSchemaObject entityA = persistenceManager.getEntity(TpcInheritA.class);
        MappedSchemaObject entityB = persistenceManager.getEntity(TpcInheritB.class);
        MappedSchemaObject entityB2 = persistenceManager.getEntity(TpcInheritB2.class);
        MappedSchemaObject entityC = persistenceManager.getEntity(TpcInheritC.class);
        Assert.assertEquals(entityBase.getAttributeNames().size(), 3);
        Assert.assertEquals(entityBase.getAllColumns().length, 3);
        Assert.assertEquals(entityA.getAttributeNames().size(), 4);
        Assert.assertEquals(entityA.getAllColumns().length, 4);
        Assert.assertEquals(entityB.getAttributeNames().size(), 4);
        Assert.assertEquals(entityB.getAllColumns().length, 4);
        Assert.assertEquals(entityB2.getAttributeNames().size(), 5);
        Assert.assertEquals(entityB2.getAllColumns().length, 5);
        Assert.assertEquals(entityC.getAttributeNames().size(), 4);
        Assert.assertEquals(entityC.getAllColumns().length, 4);

        waitEntityAvailable(entityBase);
        waitEntityAvailable(entityA);
        waitEntityAvailable(entityB);
        waitEntityAvailable(entityB2);
View Full Code Here

    }

    @Test(dependsOnMethods = "createSchema")
    public void inheritanceAbstractTablePerClass() throws Exception {

        MappedSchemaObject entityBase = persistenceManager.getEntity(Tpc2BaseEntity.class);
        MappedSchemaObject entityA = persistenceManager.getEntity(Tpc2InheritA.class);
        MappedSchemaObject entityB = persistenceManager.getEntity(Tpc2InheritB.class);
        MappedSchemaObject entityB2 = persistenceManager.getEntity(Tpc2InheritB2.class);
        MappedSchemaObject entityB3 = persistenceManager.getEntity(Tpc2InheritB3.class);
        MappedSchemaObject entityC = persistenceManager.getEntity(Tpc2InheritC.class);
        Assert.assertEquals(entityBase.getAttributeNames().size(), 3);
        Assert.assertEquals(entityBase.getAllColumns().length, 3);
        Assert.assertEquals(entityA.getAttributeNames().size(), 4);
        Assert.assertEquals(entityA.getAllColumns().length, 4);
        Assert.assertEquals(entityB.getAttributeNames().size(), 4);
        Assert.assertEquals(entityB.getAllColumns().length, 4);
        Assert.assertEquals(entityB2.getAttributeNames().size(), 5);
        Assert.assertEquals(entityB2.getAllColumns().length, 5);
        Assert.assertEquals(entityC.getAttributeNames().size(), 4);
        Assert.assertEquals(entityC.getAllColumns().length, 4);

        waitEntityAvailable(entityBase);
        waitEntityAvailable(entityA);
        waitEntityAvailable(entityB);
        waitEntityAvailable(entityB2);
View Full Code Here

TOP

Related Classes of org.caffinitas.mapper.core.MappedSchemaObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.