/** * Returns a Collection of all attributes that belong to this ObjEntity, * excluding inherited attributes. * * @since 1.1 */ @SuppressWarnings("unchecked") public Collection<ObjAttribute> getDeclaredAttributes() { return (Collection<ObjAttribute>) super.getAttributes(); }
/** * Returns a Collection of all attributes that either belong to this * DbEntity or inherited. */ @SuppressWarnings("unchecked") @Override public Collection<DbAttribute> getAttributes() { return (Collection<DbAttribute>) super.getAttributes(); }
/** * Returns a Collection of all attributes that belong to this ObjEntity, excluding * inherited attributes. * * @since 1.1 */ public Collection getDeclaredAttributes() { return super.getAttributes(); }
/** * Returns a Collection of all attributes that either belong to this ObjEntity or * inherited. */ public Collection getAttributes() { if (superEntityName == null) { return super.getAttributes(); } return getAttributeMap().values(); }
/** * Creates label for this cell */ String createLabel() { Entity entity = fetchEntity(); StringBuilder label = new StringBuilder("<html><center><u><b>"). append(entity.getName()).append("</b></u></center>"); for (Attribute attr : entity.getAttributes()) { if (isPrimary(attr)) { label.append("<br><i>").append(attr.getName()).append("</i>"); } } for (Attribute attr : entity.getAttributes()) { if (!isPrimary(attr)) { label.append("<br>").append(attr.getName()); } } return label.toString(); }
private Object[] sortedChildren(Object node) { Entity entity = entityForNonLeafNode(node); // may happen in incomplete relationships if (entity == null) { return new Object[0]; } Object key = node; Object[] sortedForNode = sortedChildren.get(key); if (sortedForNode == null) { Collection<? extends Attribute> attributes = entity.getAttributes(); Collection<? extends Relationship> relationships = entity.getRelationships(); List<Object> nodes = new Vector<Object>(); // combine two collections in an array for (Attribute attr : attributes) { if (filter == null || filter.attributeMatch(node, attr)) { nodes.add(attr); } } for (Relationship rel : relationships) { if (filter == null || filter.relationshipMatch(node, rel)) { nodes.add(rel); } } sortedForNode = nodes.toArray(); Arrays.sort(sortedForNode, Comparators.getEntityChildrenComparator()); sortedChildren.put(key, sortedForNode); } return sortedForNode; }
public void traverseEntities(Iterator entities, ProjectPath path) { if (sort) { entities = Util .sortedIterator(entities, ProjectTraversal.mapObjectComparator); } while (entities.hasNext()) { Entity ent = (Entity) entities.next(); ProjectPath entPath = path.appendToPath(ent); handler.projectNode(entPath); if (handler.shouldReadChildren(ent, path)) { this.traverseAttributes(ent.getAttributes().iterator(), entPath); this.traverseRelationships(ent.getRelationships().iterator(), entPath); } } }
Iterator targetObjAttrs = targetRel .getTargetEntity() .getAttributes() .iterator(); .getAttributes() .iterator(); while (targetAttributes.hasNext()) {