Examples of EmbeddableAttribute


Examples of org.apache.cayenne.map.EmbeddableAttribute

                    return embeddable.getAttribute(name) == null;
                }
            };

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

                embeddable.addAttribute(attr);
                CreateAttributeAction.fireEmbeddableAttributeEvent(
                        this,
                        mediator,
View Full Code Here

Examples of org.apache.cayenne.map.EmbeddableAttribute

            Collection<EmbeddableAttribute> embAttrTemp = ((Embeddable) stringToEmbeddables
                    .get(typeName)).getAttributes();
            Iterator<EmbeddableAttribute> it = embAttrTemp.iterator();

            while (it.hasNext()) {
                EmbeddableAttribute temp = (EmbeddableAttribute) it.next();
                EmbeddableAttribute at = new EmbeddableAttribute();
                at.setDbAttributeName(temp.getDbAttributeName());
                at.setName(temp.getName());
                at.setType(temp.getType());
                at.setEmbeddable(temp.getEmbeddable());
                embAttrTempCopy.add(at);
            }
        }

        embeddableModel = new OverrideEmbeddableAttributeTableModel(
View Full Code Here

Examples of org.apache.cayenne.map.EmbeddableAttribute

        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());
            }
        }
        return currentEmbeddableOverrite;
    }
View Full Code Here

Examples of org.apache.cayenne.map.EmbeddableAttribute

        }

        Iterator<EmbeddableAttribute> it = embeddableList.iterator();

        while (it.hasNext()) {
            EmbeddableAttribute emb = it.next();
            if (overrideAttr != null) {
                if (overrideAttr.get(emb.getName()) != null) {
                    emb.setDbAttributeName(overrideAttr.get(emb.getName()));
                }
            }
        }
    }
View Full Code Here

Examples of org.apache.cayenne.map.EmbeddableAttribute

    }

    @Override
    public void setUpdatedValueAt(Object value, int row, int col) {

        EmbeddableAttribute attribute = getEmbeddableAttribute(row);

        if (col == DB_ATTRIBUTE) {

            attribute.setDbAttributeName(value != null ? value.toString() : null);
            fireTableCellUpdated(row, col);
            this.isAttributeOverrideChange = true;
            ((ObjAttributeInfoDialogView) ((ObjAttributeInfoDialog) eventSource)
                    .getView()).getSaveButton().setEnabled(true);
View Full Code Here

Examples of org.apache.cayenne.map.EmbeddableAttribute

    public int getColumnCount() {
        return 4;
    }

    public Object getValueAt(int row, int column) {
        EmbeddableAttribute attribute = getEmbeddableAttribute(row);

        if (column == OBJ_ATTRIBUTE) {
            return attribute.getName();
        }
        else if (column == OBJ_ATTRIBUTE_TYPE) {
            return attribute.getType();
        }
        else {
            String dbAttributeName = attribute.getDbAttributeName();
            if (column == DB_ATTRIBUTE) {
                return dbAttributeName;
            }
            else if (column == DB_ATTRIBUTE_TYPE) {
View Full Code Here

Examples of org.apache.cayenne.map.EmbeddableAttribute

    public void setComboBoxes(Collection<String> nameAttr, int column) {

        int count = getRowCount();
        for (int i = 0; i < count; i++) {
            EmbeddableAttribute embAt = getEmbeddableAttribute(i);
            if (!nameAttr.contains(embAt.getDbAttributeName())
                    && embAt.getDbAttributeName() != null) {
                Collection<String> attributeComboForRow = new ArrayList<String>();
                attributeComboForRow.addAll(nameAttr);
                attributeComboForRow.add(embAt.getDbAttributeName());
                JComboBox comboBoxForRow = CayenneWidgetFactory.createComboBox(
                        attributeComboForRow,
                        true);

                cellEditor.setEditorAt(new Integer(i), new DefaultCellEditor(
View Full Code Here

Examples of org.apache.cayenne.map.EmbeddableAttribute

        ProjectController mediator = getProjectController();

        if (getProjectController().getCurrentEmbeddable() != null) {
            Embeddable embeddable = mediator.getCurrentEmbeddable();

            EmbeddableAttribute attr = (EmbeddableAttribute) NamedObjectFactory
                    .createObject(EmbeddableAttribute.class, embeddable);

            createEmbAttribute(embeddable, attr);

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

Examples of org.apache.cayenne.map.EmbeddableAttribute

        return EmbeddableAttribute.class;
    }

    @Override
    public void setUpdatedValueAt(Object value, int row, int col) {
        EmbeddableAttribute attribute = getEmbeddableAttribute(row);
        EmbeddableAttributeEvent event = new EmbeddableAttributeEvent(eventSource, embeddable, attribute);
        String path = null;
        Collection<String> nameAttr = null;
       
        if (col == OBJ_ATTRIBUTE) {
            event.setOldName(attribute.getName());
            ProjectUtil.setEmbeddableAttributeName(attribute, value != null ? value
             .toString()
             .trim() : null);

            fireTableCellUpdated(row, col);
        }
        else if (col == OBJ_ATTRIBUTE_TYPE) {
            attribute.setType(value != null ? value.toString() : null);
            fireTableCellUpdated(row, col);
        }
        else if (col == DB_ATTRIBUTE) {
            attribute.setDbAttributeName(value != null ? value.toString() : null);
            fireTableCellUpdated(row, col);
        }
       
        mediator.fireEmbeddableAttributeEvent(event);
    }
View Full Code Here

Examples of org.apache.cayenne.map.EmbeddableAttribute

                return "";
        }
    }

    public Object getValueAt(int row, int column) {
        EmbeddableAttribute attribute = getEmbeddableAttribute(row);

        if (column == OBJ_ATTRIBUTE) {
            return attribute.getName();
        }
        else if (column == OBJ_ATTRIBUTE_TYPE) {
            return attribute.getType();
        }
        else if (column == DB_ATTRIBUTE) {
            return attribute.getDbAttributeName();
        }
        else {
            return null;
        }
    }
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.