Package org.apache.cayenne.map

Examples of org.apache.cayenne.map.Embeddable


                .getInstance()
                .getFrameController()
                .getProjectController()
                .getCurrentObjEntity();

        final Embeddable selectedEmbeddable = Application
                .getInstance()
                .getFrameController()
                .getProjectController()
                .getCurrentEmbeddable();

        // select a single entity
        if (selectedEntity != null) {
            final boolean hasProblem = getParentController().getProblem(
                    selectedEntity.getName()) != null;

            return new Predicate() {

                public boolean evaluate(Object object) {
                    return !hasProblem && object == selectedEntity;
                }
            };
        }
        // select a single embeddable
        else if (selectedEmbeddable != null) {
            final boolean hasProblem = getParentController().getProblem(
                    selectedEmbeddable.getClassName()) != null;

            return new Predicate() {

                public boolean evaluate(Object object) {
                    return !hasProblem && object == selectedEmbeddable;
View Full Code Here


            dataVector = createResultTable(objEntityNames, CellRenderers
                    .iconForObject(new ObjEntity()), dataVector, curentLineInTable);
           
            curentLineInTable = objEntityNames.size();           
            dataVector = createResultTable(embeddableNames, CellRenderers
                    .iconForObject(new Embeddable()), dataVector, curentLineInTable);

            curentLineInTable = curentLineInTable + embeddableNames.size();           
            dataVector = createResultTable(dbEntityNames, CellRenderers
                    .iconForObject(new DbEntity()), dataVector, curentLineInTable);
           
View Full Code Here

                    "Embeddable Attribute",
                    embAttrs[0].getName()))
                    || (embAttrs.length > 1 && dialog
                            .shouldDelete("selected EmbAttributes"))) {

                Embeddable embeddable = mediator.getCurrentEmbeddable();

                EmbeddableAttribute[] eAttrs = getProjectController()
                        .getCurrentEmbAttrs();

                application.getUndoManager().addEdit(
View Full Code Here

        this.stringToEmbeddables = new HashMap<String, Embeddable>();
        this.embeddableNames = new ArrayList<String>();

        Iterator<Embeddable> embs = mediator.getEmbeddableNamesInCurRentDataDomain().iterator();
        while (embs.hasNext()) {
            Embeddable emb = (Embeddable) embs.next();
            stringToEmbeddables.put(emb.getClassName(), emb);
            embeddableNames.add(emb.getClassName());
        }
        initController(model.getAttribute(row));
    }
View Full Code Here

    }

    public Map<String, String> getCurrentOverrideAttribute() {
        Map<String, String> currentEmbeddableOverrite = new HashMap<String, String>();
        Collection<EmbeddableAttribute> embList = embeddableModel.getEmbeddableList();
        Embeddable emb = stringToEmbeddables.get(attributeSaved.getType());
        Iterator<EmbeddableAttribute> it = embList.iterator();
        while (it.hasNext()) {
            EmbeddableAttribute e = it.next();
            if ((emb.getAttribute(e.getName()).getDbAttributeName() == null && e
                    .getDbAttributeName() != null)
                    || (emb.getAttribute(e.getName()).getDbAttributeName() != null && !emb
                            .getAttribute(e.getName())
                            .getDbAttributeName()
                            .equals(e.getDbAttributeName()))) {
                currentEmbeddableOverrite.put(e.getName(), e.getDbAttributeName());
            }
View Full Code Here

                String name = ((Embeddable) path).getClassName();
                embeddableNames.put(new Integer(index++), name);
            }

            else if (path instanceof EmbeddableAttribute) {
                Embeddable parentObject = ((EmbeddableAttribute) path).getEmbeddable();
                embeddableAttributeNames.put(new Integer(index++), parentObject
                        .getClassName()
                        + "."
                        + ((EmbeddableAttribute) path).getName());
            }
            else if (path instanceof Attribute) {
View Full Code Here

        if (parentObject instanceof DbEntity) {
            DbEntity dbEntity = (DbEntity) parentObject;
            nameParent = dbEntity.getName();
        }
        if (parentObject instanceof Embeddable) {
            Embeddable embeddable = (Embeddable) parentObject;
            nameParent = embeddable.getClassName();
        }
        return nameParent;
    }
View Full Code Here

    public JLabel getItemName(Object obj) {
        String className;
        Icon icon = null;
        if (obj instanceof Embeddable) {
            className = ((Embeddable) obj).getClassName();
            icon = CellRenderers.iconForObject(new Embeddable());
        } else {
            className = ((ObjEntity) obj).getName();
            icon = CellRenderers.iconForObject(new ObjEntity());
        }
        JLabel labelIcon = new JLabel();
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

                    continue;
                }

                // note that lookuo below will return the same embeddable due to the
                // shared namespace if not conflicts exist
                Embeddable conflictingEmbeddable = nextMap.getEmbeddable(name);
                if (conflictingEmbeddable != null && conflictingEmbeddable != embeddable) {
                    addFailure(
                            validationResult,
                            embeddable,
                            "Duplicate Embeddable name in another DataMap: %s",
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.