Examples of AuditableChildUuid


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

        // prerequisite for BaseAuditableProcessor use
        ChangeSetFilter changeSetFilter = new ChangeSetFilter();
        domain.addFilter(changeSetFilter);

        ObjectContext context = runtime.newContext();
        AuditableChildUuid ac = Cayenne.objectForPK(context, AuditableChildUuid.class, 1);
        Auditable1 a1 = Cayenne.objectForPK(context, Auditable1.class, 1);
        IdCoder refHandler = new IdCoder(domain.getEntityResolver());
        ObjectIdRelationshipHandler handler = new ObjectIdRelationshipHandler(refHandler);
        handler.relate(ac, a1);

        ac.setCharProperty1("xxxx");
        context.commitChanges();
        assertEquals(1, processor.size);
        Collection<Object> auditables = processor.audited.get(AuditableOperation.UPDATE);
        assertSame(a1, auditables.toArray()[0]);

        ac.setCharProperty2("yyyy");
        context.commitChanges();
        assertEquals(2, processor.size);
        assertSame(a1, auditables.toArray()[1]);
    }
View Full Code Here

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

    public void testUpdateAuditChildByObjectIdRelationship() {

        ObjectContext context = runtime.newContext();
        Auditable1 auditedParent = context.newObject(Auditable1.class);
        AuditableChildUuid audited = context.newObject(AuditableChildUuid.class);

        IdCoder refHandler = new IdCoder(context.getEntityResolver());
        ObjectIdRelationshipHandler handler = new ObjectIdRelationshipHandler(refHandler);
        handler.relate(audited, auditedParent);
        context.commitChanges();
View Full Code Here

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

        ChangeSetFilter changeSetFilter = new ChangeSetFilter();
        domain.addFilter(changeSetFilter);
        domain.getEntityResolver().getCallbackRegistry().addListener(changeSetFilter);

        ObjectContext context = runtime.getContext();
        AuditableChildUuid ac = Cayenne.objectForPK(context, AuditableChildUuid.class, 1);
        Auditable1 a1 = Cayenne.objectForPK(context, Auditable1.class, 1);
        IdCoder refHandler = new IdCoder(domain.getEntityResolver());
        ObjectIdRelationshipHandler handler = new ObjectIdRelationshipHandler(refHandler);
        handler.relate(ac, a1);

        ac.setCharProperty1("xxxx");
        context.commitChanges();
        assertEquals(1, processor.size);
        Collection<Object> auditables = processor.audited.get(AuditableOperation.UPDATE);
        assertSame(a1, auditables.toArray()[0]);

        ac.setCharProperty2("yyyy");
        context.commitChanges();
        assertEquals(2, processor.size);
        assertSame(a1, auditables.toArray()[1]);
    }
View Full Code Here

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

    public void testUpdateAuditChildByObjectIdRelationship() {

        ObjectContext context = runtime.getContext();
        Auditable1 auditedParent = context.newObject(Auditable1.class);
        AuditableChildUuid audited = context.newObject(AuditableChildUuid.class);

        IdCoder refHandler = new IdCoder(context.getEntityResolver());
        ObjectIdRelationshipHandler handler = new ObjectIdRelationshipHandler(refHandler);
        handler.relate(audited, auditedParent);
        context.commitChanges();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.