Package org.apache.cayenne.jpa.itest.ch2

Examples of org.apache.cayenne.jpa.itest.ch2._2_1_8_1_BidiOneToOneRelationshipsTest


        assertEquals("p1", getDbHelper().getObject("IdClassEntity", "property1"));
    }

    // TODO: andrus 8/10/2006 - fails
    public void _testEmbeddedIdPk() throws Exception {
        EmbeddedIdEntity o1 = new EmbeddedIdEntity();
        o1.setProperty1("p1");
        getEntityManager().persist(o1);
        getEntityManager().getTransaction().commit();

        assertEquals("p1", getDbHelper().getObject("EmbeddedIdEntity", "property1"));
    }
View Full Code Here


    // TODO: andrus 8/10/2006 - fails
    public void _testEmbeddedDefault() throws Exception {
        getDbHelper().deleteAll("EmbeddedImpliedEntity");

        EmbeddedImpliedEntity o1 = new EmbeddedImpliedEntity();
        Embeddable1 o2 = new Embeddable1();
        o2.setProperty1("p1");
        o1.setEmbeddable(o2);

        getEntityManager().persist(o1);
        getEntityManager().getTransaction().commit();

        assertEquals("p1", getDbHelper().getObject("EmbeddedImpliedEntity", "property1"));
View Full Code Here

    public void testFieldBasedPersistence() throws Exception {

        getDbHelper().deleteAll("FieldPersistenceEntity");

        FieldPersistenceEntity o1 = new FieldPersistenceEntity();
        getEntityManager().persist(o1);
        getEntityManager().getTransaction().commit();

        assertEquals(FieldPersistenceEntity.INITIAL_VALUE, getDbHelper().getObject(
                "FieldPersistenceEntity",
View Full Code Here

    }

    public void testSimplePk() throws Exception {
        getDbHelper().deleteAll("FieldPersistenceEntity");

        FieldPersistenceEntity o1 = new FieldPersistenceEntity();
        getEntityManager().persist(o1);

        assertEquals(0, o1.idField());
        getEntityManager().getTransaction().commit();
        assertTrue(o1.idField() > 0);
        assertEquals(o1.idField(), getDbHelper().getInt("FieldPersistenceEntity", "id"));
    }
View Full Code Here

    }

    // TODO: andrus 8/30/2006 - fails
    public void _testCollectionTypesProperties() {
        CollectionFieldPersistenceEntity o1 = new CollectionFieldPersistenceEntity();
        o1.setCollection(Collections.singleton(new HelperEntity1()));
        o1.setSet(Collections.singleton(new HelperEntity2()));
        o1.setList(Collections.singletonList(new HelperEntity3()));

        getEntityManager().persist(o1);
        getEntityManager().getTransaction().commit();
View Full Code Here

    // TODO: andrus 8/30/2006 - fails
    public void _testCollectionTypesProperties() {
        CollectionFieldPersistenceEntity o1 = new CollectionFieldPersistenceEntity();
        o1.setCollection(Collections.singleton(new HelperEntity1()));
        o1.setSet(Collections.singleton(new HelperEntity2()));
        o1.setList(Collections.singletonList(new HelperEntity3()));

        getEntityManager().persist(o1);
        getEntityManager().getTransaction().commit();
    }
View Full Code Here

    // TODO: andrus 8/30/2006 - fails
    public void _testCollectionTypesProperties() {
        CollectionFieldPersistenceEntity o1 = new CollectionFieldPersistenceEntity();
        o1.setCollection(Collections.singleton(new HelperEntity1()));
        o1.setSet(Collections.singleton(new HelperEntity2()));
        o1.setList(Collections.singletonList(new HelperEntity3()));

        getEntityManager().persist(o1);
        getEntityManager().getTransaction().commit();
    }
View Full Code Here

        getEntityManager().getTransaction().commit();
    }

    public void testMapProperties() {
        MapFieldPersistenceEntity o1 = new MapFieldPersistenceEntity();
        o1.setMap(Collections.singletonMap(new Object(), new HelperEntity4()));

        getEntityManager().persist(o1);
        getEntityManager().getTransaction().commit();
    }
View Full Code Here

        assertEquals(o1.idField(), getDbHelper().getInt("FieldPersistenceEntity", "id"));
    }

    // TODO: andrus 8/10/2006 - fails
    public void _testIdClassPk() throws Exception {
        IdClassEntity o1 = new IdClassEntity();
        o1.setProperty1("p1");
        getEntityManager().persist(o1);
        getEntityManager().getTransaction().commit();

        assertEquals("p1", getDbHelper().getObject("IdClassEntity", "property1"));
    }
View Full Code Here

        getEntityManager().persist(o1);
        getEntityManager().getTransaction().commit();
    }

    public void testMapProperties() {
        MapFieldPersistenceEntity o1 = new MapFieldPersistenceEntity();
        o1.setMap(Collections.singletonMap(new Object(), new HelperEntity4()));

        getEntityManager().persist(o1);
        getEntityManager().getTransaction().commit();
    }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.jpa.itest.ch2._2_1_8_1_BidiOneToOneRelationshipsTest

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.