Package org.apache.cayenne.map

Examples of org.apache.cayenne.map.ObjEntity.addAttribute()


            if (content instanceof ObjAttribute) {
                ObjAttribute attr = (ObjAttribute) content;
                attr.setName(getFreeName(checker, attr.getName()));

                objEntity.addAttribute(attr);
                CreateAttributeAction.fireObjAttributeEvent(this, mediator, mediator
                        .getCurrentDataMap(), objEntity, attr);
            }
            else if (content instanceof ObjRelationship) {
                ObjRelationship rel = (ObjRelationship) content;
View Full Code Here


        ObjEntity oe1 = new ObjEntity("oex" + counter++);
        map.addObjEntity(oe1);
        oe1.setDbEntity(e1);

        ObjAttribute oa1 = new ObjAttribute(name, "java.lang.Integer", oe1);
        oe1.addAttribute(oa1);
        oa1.setDbAttributePath(a1.getName());

        return oa1;
    }
}
View Full Code Here

        c1.add("attribute1");
        enhancedPropertyMap.put(MockSerializablePojo1.class.getName(), c1);

        ObjAttribute a1 = new ObjAttribute("attribute1");
        ObjEntity e = new ObjEntity("E1");
        e.addAttribute(a1);
        e.setClassName(MockSerializablePojo1.class.getName());

        ObjAttribute a2 = new ObjAttribute("attribute1");
        ObjEntity e2 = new ObjEntity("E2");
        e2.addAttribute(a2);
View Full Code Here

        e.addAttribute(a1);
        e.setClassName(MockSerializablePojo1.class.getName());

        ObjAttribute a2 = new ObjAttribute("attribute1");
        ObjEntity e2 = new ObjEntity("E2");
        e2.addAttribute(a2);
        e2.setClassName(MockSerializablePojo2.class.getName());

        DataMap map = new DataMap("x");
        map.addObjEntity(e);
        map.addObjEntity(e2);
View Full Code Here

        ObjAttribute a1 = new ObjAttribute("attribute1");
        ObjAttribute a2 = new ObjAttribute("attribute2");
        ObjAttribute a3 = new ObjAttribute("attribute3");
        ObjEntity e = new ObjEntity("E1");
        e.addAttribute(a1);
        e.addAttribute(a2);
        e.addAttribute(a3);
        e.setClassName(C1);
        DataMap map = new DataMap("x");
        map.addObjEntity(e);
View Full Code Here

        ObjAttribute a1 = new ObjAttribute("attribute1");
        ObjAttribute a2 = new ObjAttribute("attribute2");
        ObjAttribute a3 = new ObjAttribute("attribute3");
        ObjEntity e = new ObjEntity("E1");
        e.addAttribute(a1);
        e.addAttribute(a2);
        e.addAttribute(a3);
        e.setClassName(C1);
        DataMap map = new DataMap("x");
        map.addObjEntity(e);
View Full Code Here

        ObjAttribute a2 = new ObjAttribute("attribute2");
        ObjAttribute a3 = new ObjAttribute("attribute3");
        ObjEntity e = new ObjEntity("E1");
        e.addAttribute(a1);
        e.addAttribute(a2);
        e.addAttribute(a3);
        e.setClassName(C1);
        DataMap map = new DataMap("x");
        map.addObjEntity(e);

        EnhancerVisitorFactory factory = new CayenneEnhancerVisitorFactory(
View Full Code Here

                embedded.addAttributeOverride(override.getName(), override
                        .getColumn()
                        .getName());
            }

            entity.addAttribute(embedded);

            // for each embedded attribute, add all Embeddable attributes to DbEntity,
            // honoring @Column settings
            JpaEmbeddable jpaEmbeddable = path
                    .firstInstanceOf(JpaEntityMap.class)
View Full Code Here

            cayenneAttribute
                    .setType(getAttributeType(path, jpaBasic.getName()).getName());
            cayenneAttribute.setDbAttributePath(getAttributePath(path, entity, jpaBasic
                    .getColumn()));

            parentCayenneEntity.addAttribute(cayenneAttribute);
            return cayenneAttribute;
        }

        Class<?> getAttributeType(ProjectPath path, String name) {
            AccessType access = null;
View Full Code Here

            ObjAttribute cayenneAttribute = new ObjAttribute(version.getName());
            cayenneAttribute.setType(getAttributeType(path, version.getName()).getName());
            cayenneAttribute.setDbAttributePath(getAttributePath(path, entity, version
                    .getColumn()));

            parentCayenneEntity.addAttribute(cayenneAttribute);
            return cayenneAttribute;
        }
    }

    class JpaColumnVisitor extends BaseTreeVisitor {
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.