Examples of CayenneMapEntry


Examples of org.apache.cayenne.util.CayenneMapEntry

    protected void appendDbPath(StringBuffer buf, Expression pathExp) {
        Iterator<CayenneMapEntry> it = getDbEntity().resolvePathComponents(pathExp);

        while (it.hasNext()) {
            CayenneMapEntry pathComp = it.next();
            if (pathComp instanceof DbRelationship) {
                DbRelationship rel = (DbRelationship) pathComp;

                // if this is a last relationship in the path,
                // it needs special handling
View Full Code Here

Examples of org.apache.cayenne.util.CayenneMapEntry

            return items;
        }

        Iterator<?> it = items.iterator();
        while (it.hasNext()) {
            CayenneMapEntry entity = (CayenneMapEntry) it.next();

            if (!passedIncludeFilter(entity)) {
                it.remove();
                continue;
            }
View Full Code Here

Examples of org.apache.cayenne.util.CayenneMapEntry

    /**
     * Helper method to evaluate path expression with Cayenne Entity.
     */
    protected CayenneMapEntry evaluateEntityNode(Entity entity) {
        Iterator<CayenneMapEntry> path = entity.resolvePathComponents(this);
        CayenneMapEntry next = null;
        while (path.hasNext()) {
            next = path.next();
        }

        return next;
View Full Code Here

Examples of org.apache.cayenne.util.CayenneMapEntry

     * @param obj Object to be converted
     * @param namespace the current namespace
     */
    public static String asString(Object obj, MappingNamespace namespace) {
        if (obj instanceof CayenneMapEntry) {
            CayenneMapEntry mapObject = (CayenneMapEntry) obj;
            String label = mapObject.getName();

            if (mapObject instanceof Entity) {
                Entity entity = (Entity) mapObject;

                // for different namespace display its name
View Full Code Here

Examples of org.apache.cayenne.util.CayenneMapEntry

            while (relationshipIt.hasNext() && pathIt.hasNext()) {
                // relationship path components must be DbRelationships
                DbRelationship nextDBR = (DbRelationship) relationshipIt.next();

                // expression components may be attributes or relationships
                CayenneMapEntry next = (CayenneMapEntry) pathIt.next();

                if (nextDBR != next) {
                    // found split point
                    // consume the last iteration components,
                    // then break out to finish the iterators independenly
                    prependReversedPath(finalPath, nextDBR);
                    appendPath(finalPath, next);
                    break;
                }

                break;
            }

            // append remainder of the relationship, reversing it
            while (relationshipIt.hasNext()) {
                DbRelationship nextDBR = (DbRelationship) relationshipIt.next();
                prependReversedPath(finalPath, nextDBR);
            }

            while (pathIt.hasNext()) {
                // components may be attributes or relationships
                CayenneMapEntry next = (CayenneMapEntry) pathIt.next();
                appendPath(finalPath, next);
            }

            return convertToPath(finalPath);
        }
View Full Code Here

Examples of org.apache.cayenne.util.CayenneMapEntry

                    throw new CayenneRuntimeException("Unknown path component: "
                            + component);
                }

                while (dbSubpath.hasNext()) {
                    CayenneMapEntry subComponent = (CayenneMapEntry) dbSubpath.next();
                    if (buf.length() > 0) {
                        buf.append(Entity.PATH_SEPARATOR);
                    }

                    buf.append(subComponent.getName());
                }
            }

            return buf.toString();
        }
View Full Code Here

Examples of org.apache.cayenne.util.CayenneMapEntry

                    throw new CayenneRuntimeException("Unknown path component: "
                            + component);
                }

                while (dbSubpath.hasNext()) {
                    CayenneMapEntry subComponent = (CayenneMapEntry) dbSubpath.next();
                    if (buf.length() > 0) {
                        buf.append(Entity.PATH_SEPARATOR);
                    }

                    buf.append(subComponent.getName());
                }
            }

            return buf.toString();
        }
View Full Code Here

Examples of org.apache.cayenne.util.CayenneMapEntry

            while (relationshipIt.hasNext() && pathIt.hasNext()) {
                // relationship path components must be DbRelationships
                DbRelationship nextDBR = (DbRelationship) relationshipIt.next();

                // expression components may be attributes or relationships
                CayenneMapEntry next = (CayenneMapEntry) pathIt.next();

                if (nextDBR != next) {
                    // found split point
                    // consume the last iteration components,
                    // then break out to finish the iterators independenly
                    prependReversedPath(finalPath, nextDBR);
                    appendPath(finalPath, next);
                    break;
                }

                break;
            }

            // append remainder of the relationship, reversing it
            while (relationshipIt.hasNext()) {
                DbRelationship nextDBR = (DbRelationship) relationshipIt.next();
                prependReversedPath(finalPath, nextDBR);
            }

            while (pathIt.hasNext()) {
                // components may be attributes or relationships
                CayenneMapEntry next = (CayenneMapEntry) pathIt.next();
                appendPath(finalPath, next);
            }

            return convertToPath(finalPath);
        }
View Full Code Here

Examples of org.apache.cayenne.util.CayenneMapEntry

            return items;
        }

        Iterator it = items.iterator();
        while (it.hasNext()) {
            CayenneMapEntry entity = (CayenneMapEntry) it.next();

            if (!passedIncludeFilter(entity)) {
                it.remove();
                continue;
            }
View Full Code Here

Examples of org.apache.cayenne.util.CayenneMapEntry

            return items;
        }

        Iterator it = items.iterator();
        while (it.hasNext()) {
            CayenneMapEntry entity = (CayenneMapEntry) it.next();

            if (!passedIncludeFilter(entity)) {
                it.remove();
                continue;
            }
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.