Package org.apache.cayenne.lifecycle.db

Examples of org.apache.cayenne.lifecycle.db.E1


    public void testRelate_Existing() throws Exception {

        e1Table.insert(1);

        ObjectContext context = runtime.getContext();
        E1 e1 = (E1) Cayenne.objectForQuery(context, new SelectQuery(E1.class));

        UuidRoot1 r1 = context.newObject(UuidRoot1.class);

        ReferenceableHandler refHandler = new ReferenceableHandler(context
                .getEntityResolver());
View Full Code Here


    }

    public void testRelate_New() throws Exception {

        ObjectContext context = runtime.getContext();
        E1 e1 = context.newObject(E1.class);

        UuidRoot1 r1 = context.newObject(UuidRoot1.class);

        ReferenceableHandler refHandler = new ReferenceableHandler(context
                .getEntityResolver());
View Full Code Here

        ObjectContext context = runtime.getContext();

        UuidRoot1 r1 = Cayenne.objectForPK(context, UuidRoot1.class, 1);
        assertEquals("E1:1", r1.getUuid());

        E1 e1 = context.newObject(E1.class);

        ReferenceableHandler refHandler = new ReferenceableHandler(context
                .getEntityResolver());
        UuidRelationshipHandler handler = new UuidRelationshipHandler(refHandler);
        handler.relate(r1, e1);
View Full Code Here

    public void testGetUuid() {
        ReferenceableHandler handler = new ReferenceableHandler(runtime
                .getChannel()
                .getEntityResolver());

        E1 e1 = new E1();
        e1.setObjectId(new ObjectId("E1", "ID", 5));
        assertEquals("E1:5", handler.getUuid(e1));
    }
View Full Code Here

    public void testGetUuid_TempException() {
        ReferenceableHandler handler = new ReferenceableHandler(runtime
                .getChannel()
                .getEntityResolver());

        E1 e1 = new E1();
        e1.setObjectId(new ObjectId("E1"));

        try {
            handler.getUuid(e1);
        }
        catch (IllegalArgumentException e) {
View Full Code Here

    public void testGetUuid_TempWithReplacement() {
        ReferenceableHandler handler = new ReferenceableHandler(runtime
                .getChannel()
                .getEntityResolver());

        E1 e1 = new E1();
        e1.setObjectId(new ObjectId("E1"));
        e1.getObjectId().getReplacementIdMap().put("ID", 6);

        assertEquals("E1:6", handler.getUuid(e1));
    }
View Full Code Here

    }

    public void testGetStringId() {
        IdCoder handler = new IdCoder(runtime.getChannel().getEntityResolver());

        E1 e1 = new E1();
        e1.setObjectId(new ObjectId("E1", "ID", 5));
        assertEquals("E1:5", handler.getStringId(e1));
    }
View Full Code Here

    public void testGetStringId_Temp() {
        IdCoder handler = new IdCoder(runtime.getChannel().getEntityResolver());

        byte[] key = new byte[] { 1, 2, 10, 100 };

        E1 e1 = new E1();
        e1.setObjectId(new ObjectId("E1", key));

        assertEquals(".E1:01020A64", handler.getStringId(e1));
    }
View Full Code Here

        byte[] key = new byte[] { 5, 2, 11, 99 };
        ObjectId id = new ObjectId("E1", key);
        id.getReplacementIdMap().put("ID", 6);

        E1 e1 = new E1();
        e1.setObjectId(id);

        assertEquals("E1:6", handler.getStringId(e1));
    }
View Full Code Here

    public void testRelate_Existing() throws Exception {

        e1Table.insert(1);

        ObjectContext context = runtime.newContext();
        E1 e1 = (E1) Cayenne.objectForQuery(context, new SelectQuery(E1.class));

        UuidRoot1 r1 = context.newObject(UuidRoot1.class);

        IdCoder refHandler = new IdCoder(context
                .getEntityResolver());
View Full Code Here

TOP

Related Classes of org.apache.cayenne.lifecycle.db.E1

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.