Package org.apache.cayenne.map

Examples of org.apache.cayenne.map.Embeddable


        // filter out excluded entities...
        Iterator<Embeddable> it = embeddables.iterator();

        while (it.hasNext()) {
            Embeddable e = it.next();

            // note that unlike entity, embeddable is matched by class name as it doesn't
            // have a symbolic name...
            if (!nameFilter.isIncluded(e.getClassName())) {
                it.remove();
            }
        }

        return embeddables;
View Full Code Here


        @Override
        protected Object create(String name, Object namingContext) {
            DataMap map = (DataMap) namingContext;
            if (map.getDefaultPackage() != null) {
                return new Embeddable(map.getDefaultPackage() + "." + name);
            }
            return new Embeddable(name);
        }
View Full Code Here

            return new EmbeddableAttribute(name);
        }

        @Override
        protected boolean isNameInUse(String name, Object namingContext) {
            Embeddable emb = (Embeddable) namingContext;
            return emb.getAttribute(name) != null;
        }
View Full Code Here

        }

        @Override
        Object createObject(ProjectPath path) {
            JpaEmbeddable jpaEmbeddable = (JpaEmbeddable) path.getObject();
            Embeddable embeddable = new Embeddable(jpaEmbeddable.getClassName());
            ((DataMap) targetPath.getObject()).addEmbeddable(embeddable);
            return embeddable;
        }
View Full Code Here

        @Override
        Object createObject(ProjectPath path) {
            JpaBasic jpaBasic = (JpaBasic) path.getObject();

            Embeddable embeddable = (Embeddable) targetPath.getObject();

            EmbeddableAttribute attribute = new EmbeddableAttribute(jpaBasic.getName());
            attribute.setType(getAttributeType(path, jpaBasic.getName()).getName());
            attribute.setDbAttributeName(jpaBasic.getColumn().getName());

            embeddable.addAttribute(attribute);
            return attribute;
        }
View Full Code Here

        @Override
        Object createObject(ProjectPath path) {
            JpaBasic jpaBasic = (JpaBasic) path.getObject();

            Embeddable embeddable = (Embeddable) targetPath.getObject();

            EmbeddableAttribute attribute = new EmbeddableAttribute(jpaBasic.getName());
            attribute.setType(getAttributeType(path, jpaBasic.getName()).getName());
            attribute.setDbAttributeName(jpaBasic.getColumn().getName());

            embeddable.addAttribute(attribute);
            return attribute;
        }
View Full Code Here

        }

        @Override
        Object createObject(ProjectPath path) {
            JpaEmbeddable jpaEmbeddable = (JpaEmbeddable) path.getObject();
            Embeddable embeddable = new Embeddable(jpaEmbeddable.getClassName());
            ((DataMap) targetPath.getObject()).addEmbeddable(embeddable);
            return embeddable;
        }
View Full Code Here

        }
        else if (attribute instanceof EmbeddedAttribute) {
            Map<String, String> attrOverrides = ((EmbeddedAttribute) attribute)
                    .getAttributeOverrides();

            Embeddable embeddable = ((EmbeddedAttribute) attribute).getEmbeddable();
            if (embeddable == null && ((EmbeddedAttribute) attribute).getType() != null) {

                addFailure(
                        validationResult,
                        attribute,
                        "EmbeddedAttribute '%s' has incorrect Embeddable",
                        attribute.getName());
            }
            else if (embeddable == null
                    && ((EmbeddedAttribute) attribute).getType() == null) {
                addFailure(
                        validationResult,
                        attribute,
                        "EmbeddedAttribute '%s' has no Embeddable",
                        attribute.getName());
            }

            if (embeddable != null) {

                for (EmbeddableAttribute embeddableAttribute : embeddable.getAttributes()) {
                    String dbAttributeName;
                    if (attrOverrides.size() > 0
                            && attrOverrides.containsKey(embeddableAttribute.getName())) {
                        dbAttributeName = attrOverrides
                                .get(embeddableAttribute.getName());
View Full Code Here

        @Override
        protected Object create(String name, Object namingContext) {
            DataMap map = (DataMap) namingContext;
            if (map.getDefaultPackage() != null) {
                return new Embeddable(map.getDefaultPackage() + "." + name);
            }
            return new Embeddable(name);
        }
View Full Code Here

            return new EmbeddableAttribute(name);
        }

        @Override
        protected boolean isNameInUse(String name, Object namingContext) {
            Embeddable emb = (Embeddable) namingContext;
            return emb.getAttribute(name) != null;
        }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.map.Embeddable

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.