Package com.mysema.query.types.path

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


                                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


                                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

                QCat.cat.kittens.any().kittens.any().name.accept(ToStringVisitor.DEFAULT, templates));
    }

    @Test
    public void Complex() {
        BooleanPath a = Expressions.booleanPath("a");
        BooleanPath b = Expressions.booleanPath("d");
        BooleanPath c = Expressions.booleanPath("c");
        BooleanPath d = Expressions.booleanPath("d");
        Predicate complex = a.or(b).and(c.or(d));
        assertEquals("(a || d) && (c || d)", complex.accept(ToStringVisitor.DEFAULT, templates));


    }
View Full Code Here

public class DateExtensions {
       
    @QueryDelegate(Date.class)
    public static Predicate extension(DateExpression<Date> date) {
        return new BooleanPath("b");
    }
View Full Code Here

public class EntityExtensions {
   
    @QueryDelegate(EntityWithExtensions.class)
    public static Predicate extension(QEntityWithExtensions entity) {
        return new BooleanPath("b");
    }
View Full Code Here

    @Test
    public void ToString() {
        BooleanBuilder builder = new BooleanBuilder().and(first);
        assertEquals("true", builder.toString());
        builder.or(new BooleanPath("condition"));
        assertEquals("true || condition", builder.toString());
    }
View Full Code Here

    @Test
    public void Accept() {
        BooleanBuilder builder = new BooleanBuilder();
        builder.and(first);
        builder.or(new BooleanPath("condition"));
        assertEquals("true || condition", builder.accept(ToStringVisitor.DEFAULT, Templates.DEFAULT));
    }
View Full Code Here

     *
     * @param variable
     * @return
     */
    public static BooleanPath booleanPath(String variable) {
        return new BooleanPath(PathMetadataFactory.forVariable(variable));
    }
View Full Code Here

     * @param parent
     * @param property
     * @return
     */
    public static BooleanPath booleanPath(Path<?> parent, String property) {
        return new BooleanPath(PathMetadataFactory.forProperty(parent, property));
    }
View Full Code Here

        return new ArrayPath<T[], T>(arrayType, metadata);
    }

    @Override
    public Path<Boolean> createBooleanPath(PathMetadata<?> metadata) {
        return new BooleanPath(metadata);
    }
View Full Code Here

TOP

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

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.