Package com.mysema.query.types.path

Examples of com.mysema.query.types.path.ListPath


                        } else if (key.contains("list-")) {
                            // CHECKSTYLE:OFF
                            // if searching elements from list
                            String parsedKey = key.substring(5);
                            // CHECKSTYLE:ON
                            ListPath path = entityPath.getList(parsedKey, filter.getClass());
                            predicate = and(predicate, path.contains(filter));
                        } else { // if not ranged search
                            if (filter instanceof String) {
                                StringPath path = entityPath.getString(key);
                                String filterString = (String) filter;
                                predicate = and(predicate, path.startsWithIgnoreCase(filterString));
                            } else if (filter instanceof Date) {
                                DatePath path = entityPath.getDate(key, Date.class);
                                predicate = and(predicate, path.eq(filter));
                            } else if (filter instanceof Number) {
                                NumberPath path = createNumberPath(entityPath, key, filter);
                                predicate = and(predicate, path.eq(filter));
                            } else if (filter instanceof Boolean) {
                                BooleanPath path = entityPath.getBoolean(key);
                                predicate = and(predicate, path.eq((Boolean) filter));
                            } else if (filter instanceof Enum) {
                                EnumPath path = entityPath.getEnum(key, Enum.class);
                                predicate = and(predicate, path.eq(filter));
                            } else if (BaseEntity.class.isAssignableFrom(filter.getClass())) {
                                PathBuilder path = entityPath.get(key);
                                predicate = and(predicate, path.eq(filter));
                            }
                        }

                    }
                }
View Full Code Here


                        } else if (key.contains("list-")) {
                            // CHECKSTYLE:OFF
                            // if searching elements from list
                            String parsedKey = key.substring(5);
                            // CHECKSTYLE:ON
                            ListPath path = entityPath.getList(parsedKey, filter.getClass());
                            predicate = and(predicate, path.contains(filter));
                        } else { // if not ranged search
                            if (filter instanceof String) {
                                StringPath path = entityPath.getString(key);
                                String filterString = (String) filter;
                                predicate = and(predicate, path.startsWithIgnoreCase(filterString));
                            } else if (filter instanceof Date) {
                                DatePath path = entityPath.getDate(key, Date.class);
                                predicate = and(predicate, path.eq(filter));
                            } else if (filter instanceof Number) {
                                NumberPath path = createNumberPath(entityPath, key, filter);
                                predicate = and(predicate, path.eq(filter));
                            } else if (filter instanceof Boolean) {
                                BooleanPath path = entityPath.getBoolean(key);
                                predicate = and(predicate, path.eq((Boolean) filter));
                            } else if (filter instanceof Enum) {
                                EnumPath path = entityPath.getEnum(key, Enum.class);
                                predicate = and(predicate, path.eq(filter));
                            } else if (BaseEntity.class.isAssignableFrom(filter.getClass())) {
                                PathBuilder path = entityPath.get(key);
                                predicate = and(predicate, path.eq(filter));
                            }
                        }

                    }
                }
View Full Code Here

        JPASubQuery query = new JPASubQuery();
        for (int i = 0; i < c.paths.size(); i++) {
            Path<?> child = c.paths.get(i).getMetadata().getParent();
            EntityPath<Object> replacement = (EntityPath<Object>) c.replacements.get(i);
            if (c.paths.get(i).getType().isAnnotationPresent(Entity.class)) {
                query.from(new ListPath(c.paths.get(i).getType(), SimplePath.class, child.getMetadata()), replacement);
            } else {
                // join via parent
                Path<?> parent = child.getMetadata().getParent();
                String prefix = parent.accept(ToStringVisitor.DEFAULT, TEMPLATES).replace('.', '_');
                String suffix = UUID.randomUUID().toString().replace("-", "").substring(0,5);
View Full Code Here

    private static <T> Path<T> replaceParent(Path<T> path, Path<?> parent) {
        PathMetadata<?> metadata = new PathMetadata<Object>(parent, path.getMetadata().getElement(),
                path.getMetadata().getPathType());
        if (path instanceof CollectionExpression) {
            CollectionExpression<?,?> col = (CollectionExpression<?,?>)path;
            return new ListPath(col.getParameter(0), SimplePath.class, metadata);
        } else {
            return new PathImpl<T>(path.getType(), metadata);
        }
    }
View Full Code Here

        paths.add(new CollectionPath(String.class, StringPath.class, "p"));
        paths.add(new ComparablePath(String.class,"p"));
        paths.add(new DatePath(Date.class,"p"));
        paths.add(new DateTimePath(Date.class,"p"));
        paths.add(new EnumPath(ExampleEnum.class,"p"));
        paths.add(new ListPath(String.class, StringPath.class, "p"));
        paths.add(new MapPath(String.class, String.class, StringPath.class, "p"));
        paths.add(new NumberPath(Integer.class,"p"));
        paths.add(new SetPath(String.class, StringPath.class, "p"));
        paths.add(new SimplePath(String.class,"p"));
        paths.add(new StringPath("p"));
View Full Code Here

TOP

Related Classes of com.mysema.query.types.path.ListPath

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.