Examples of EmbeddableAttribute


Examples of org.apache.cayenne.map.EmbeddableAttribute

    }

    final class EmbeddableAttributeComparator implements Comparator {

        public int compare(Object o1, Object o2) {
            EmbeddableAttribute a1 = (EmbeddableAttribute) o1;
            EmbeddableAttribute a2 = (EmbeddableAttribute) o2;

            int delta = getWeight(a1) - getWeight(a2);

            return (delta != 0) ? delta : Util.nullSafeCompare(true, a1.getName(), a2
                    .getName());
        }
View Full Code Here

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

        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

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

        public ValidationResult visitEmbeddable(Embeddable embeddable) {
            embeddableValidator.validate(embeddable, validationResult);
            Iterator<EmbeddableAttribute> it = embeddable.getAttributes().iterator();
            while (it.hasNext()) {
                EmbeddableAttribute attr = it.next();
                visitEmbeddableAttribute(attr);
            }
            return validationResult;
        }
View Full Code Here

Examples of org.apache.cayenne.map.EmbeddableAttribute

                      }
                     
                      Iterator<EmbeddableAttribute> attrIterator = emb.getAttributes().iterator();
                     
                      while(attrIterator.hasNext()) {
                          EmbeddableAttribute attr = attrIterator.next();
                          if(matchFound(attr.getName(), pattern)){
                              paths.add(attr);
                          }
                      }
                  }
                 
                 
                  Iterator<DbEntity> dbEntIterator = dm.getDbEntities().iterator();
                 
                  while(dbEntIterator.hasNext()) {
                      DbEntity ent = dbEntIterator.next();
                      if(matchFound(ent.getName(), pattern)){
                          paths.add(ent);
                      }
                     
                      Iterator<DbAttribute> attrIterator = ent.getAttributes().iterator();
                     
                      while(attrIterator.hasNext()) {
                          DbAttribute attr = attrIterator.next();
                          if(matchFound(attr.getName(), pattern)){
                              paths.add(attr);
                          }
                      }
                     
                      Iterator<DbRelationship> relIterator = ent.getRelationships().iterator();
                     
                      while(relIterator.hasNext()) {
                          DbRelationship rel = relIterator.next();
                          if(matchFound(rel.getName(), pattern)){
                              paths.add(rel);
                          }
                      }
                  }
                 
                  Iterator<ObjEntity> entIterator = dm.getObjEntities().iterator();
                 
                  while(entIterator.hasNext()) {
                      ObjEntity ent = entIterator.next();
                      if(matchFound(ent.getName(), pattern)){
                          paths.add(ent);
                      }
                     
                      Iterator<ObjAttribute> attrIterator = ent.getAttributes().iterator();
                     
                      while(attrIterator.hasNext()) {
                          ObjAttribute attr = attrIterator.next();
                          if(matchFound(attr.getName(), pattern)){
                              paths.add(attr);
                          }
                      }
                     
                      Iterator<ObjRelationship> relIterator = ent.getRelationships().iterator();
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
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.