Package javax.persistence.criteria

Examples of javax.persistence.criteria.Join


            } else if (jt.equals(JoinType.RIGHT)) {
                throw new UnsupportedOperationException(ExceptionLocalization.buildMessage("RIGHT_JOIN_NOT_SUPPORTED"));
            } else {
                node = this.currentNode.anyOfAllowingNone(((PluralAttribute) attribute).getName());
            }
            Join join;
            if (((PluralAttribute) attribute).getElementType().getPersistenceType().equals(PersistenceType.BASIC)) {
                if (((PluralAttribute) attribute).getCollectionType().equals(CollectionType.COLLECTION)) {
                    join = new BasicCollectionJoinImpl(this, this.metamodel, ((PluralAttribute) attribute).getBindableJavaType(), node, (Bindable) attribute);
                } else if (((PluralAttribute) attribute).getCollectionType().equals(CollectionType.LIST)) {
                    join = new BasicListJoinImpl(this, this.metamodel, ((PluralAttribute) attribute).getBindableJavaType(), node, (Bindable) attribute);
View Full Code Here


        String[] pathElements = entry.getKey().split("\\.");
        int pathSize = pathElements.length;
        if (pathSize > 1) {
          Path<?> path = root.get(pathElements[0]);
          for (int i = 1; i <= pathElements.length - 1; i++) {
            Join join = root.join(pathElements[i-1]);
            path = join.get(pathElements[i]);
          }
          expression = path;
        } else {
          expression = root.get(entry.getKey());
        }
View Full Code Here

        String key = (String) _key;

        String[] pathElements = key.split("\\.");

        boolean needJoin = false;
        Join join = null;
        if (pathElements.length > 1) {
            join = root.join(pathElements[0]);
            needJoin = true;
        }
        Path<?> path = root.get(pathElements[0]);
        for (int i = 1; i <= pathElements.length - 1; i++) {
            if (needJoin) {
                if (i == pathElements.length - 1) {
                    path = join.get(pathElements[i]);
                } else {
                    join = join.join(pathElements[i]);
                }
            } else {
                path = path.get(pathElements[i]);
            }
        }
View Full Code Here

        this.map = map;
    }

    @Override
    public List<Predicate> build(CriteriaBuilder builder, Path<P> path) {
        Join join = null;
        if (singular != null) {
            join = joinSingular((From) path);
        } else if (list != null) {
            join = joinList((From) path);
        } else if (collection != null) {
View Full Code Here

    }

    @Override
    @SuppressWarnings({ "rawtypes", "unchecked" })
    public List<Predicate> build(CriteriaBuilder builder, Path<P> path) {
        Join join = null;
        if (singular != null) {
            join = joinSingular((From) path);
        } else if (list != null) {
            join = joinList((From) path);
        } else if (collection != null) {
View Full Code Here

        this.isLeaf = false;
        if (att.getPersistentAttributeType().equals(PersistentAttributeType.BASIC)){
            return new PathImpl<Y>(this, this.metamodel, att.getBindableJavaType(),this.currentNode.get(att.getName()), att);
        }else{
            Class<Y> clazz = att.getBindableJavaType();
            Join join = new JoinImpl<X, Y>(this, this.metamodel.managedType(clazz), this.metamodel, clazz,this.currentNode.get(att.getName()), att);
            this.joins.add(join);
            return join;
        }
    }
View Full Code Here

   
    @Override
    public <Y> Path<Y> get(String attName) {
        this.isLeaf = false;
        Attribute attribute = this.managedType.getAttribute(attName);
        Join join;
        if (attribute.isCollection()) {
            if (!((PluralAttribute) attribute).getElementType().getPersistenceType().equals(PersistenceType.BASIC)) {
                if (((PluralAttribute) attribute).getCollectionType().equals(CollectionType.COLLECTION)) {
                    join = new CollectionJoinImpl<X, Y>(this, metamodel.managedType(((PluralAttribute) attribute).getBindableJavaType()), this.metamodel, ((PluralAttribute) attribute).getBindableJavaType(), this.currentNode.anyOf(attribute.getName()), (Bindable) attribute);
                } else if (((PluralAttribute) attribute).getCollectionType().equals(CollectionType.LIST)) {
View Full Code Here

            } else if (jt.equals(JoinType.RIGHT)) {
                throw new UnsupportedOperationException(ExceptionLocalization.buildMessage("RIGHT_JOIN_NOT_SUPPORTED"));
            } else {
                node = this.currentNode.anyOfAllowingNone(((PluralAttribute) attribute).getName());
            }
            Join join;
            if (((PluralAttribute) attribute).getElementType().getPersistenceType().equals(PersistenceType.BASIC)) {
                if (((PluralAttribute) attribute).getCollectionType().equals(CollectionType.COLLECTION)) {
                    join = new BasicCollectionJoinImpl(this, this.metamodel, ((PluralAttribute) attribute).getBindableJavaType(), node, (Bindable) attribute);
                } else if (((PluralAttribute) attribute).getCollectionType().equals(CollectionType.LIST)) {
                    join = new BasicListJoinImpl(this, this.metamodel, ((PluralAttribute) attribute).getBindableJavaType(), node, (Bindable) attribute);
View Full Code Here

    }

    @Override
    @SuppressWarnings({ "rawtypes", "unchecked" })
    public List<Predicate> build(CriteriaBuilder builder, Path<P> path) {
        Join join = null;
        if (singular != null) {
            join = joinSingular((From) path);
        } else if (list != null) {
            join = joinList((From) path);
        } else if (collection != null) {
View Full Code Here

        this.isLeaf = false;
        if (att.getPersistentAttributeType().equals(PersistentAttributeType.BASIC)){
            return new PathImpl<Y>(this, this.metamodel, att.getBindableJavaType(),this.currentNode.get(att.getName()), att);
        }else{
            Class<Y> clazz = att.getBindableJavaType();
            Join join = new JoinImpl<X, Y>(this, this.metamodel.managedType(clazz), this.metamodel, clazz,this.currentNode.get(att.getName()), att);
            this.joins.add(join);
            return join;
        }
    }
View Full Code Here

TOP

Related Classes of javax.persistence.criteria.Join

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.