Package com.mysema.query.types.path

Examples of com.mysema.query.types.path.StringPath.eq()


    @Test
    public void Multiple_Field_Search_From_Movies() throws Exception {
        StringPath movie = new StringPath("movie");
        testQuery(movie.in("Interview with the Vampire"), "movie:Interview with the Vampire", 1);
        testQuery(movie.eq("Up in the Air"), "movie:Up in the Air", 1);
    }
}
View Full Code Here


    }

    @Test
    public void Eq_with_deep_path() throws Exception{
        StringPath deepPath = entityPath.get("property1", Object.class).getString("property2");
        testQuery(deepPath.eq("good"), "property1.property2:good", 0);
    }

    @Test
    public void FuzzyLike() throws Exception{
        testQuery(LuceneExpressions.fuzzyLike(rating, "Good"), "rating:Good~2", 1);
View Full Code Here

    }

    @Test
    public void Eq_with_deep_path() throws Exception{
        StringPath deepPath = entityPath.get("property1", Object.class).getString("property2");
        testQuery(deepPath.eq("good"), "property1.property2:good", 0);
    }

    @Test
    public void FuzzyLike() throws Exception{
        testQuery(LuceneExpressions.fuzzyLike(rating, "Good"), "rating:Good~0.5", 1);
View Full Code Here

    @Test
    public void test() {
        StringPath title = new StringPath("title");
        LuceneSerializer serializer = new LuceneSerializer(false,true);
        QueryMetadata metadata = new DefaultQueryMetadata();
        assertEquals("title:\"Hello World\"", serializer.toQuery(title.eq("Hello World"), metadata).toString());
        assertEquals("title:Hello World", serializer.toQuery(title.eq(new TermElement("Hello World")), metadata).toString());
    }

    @Test
    public void testEqualsAndHashCode() {
View Full Code Here

    public void test() {
        StringPath title = new StringPath("title");
        LuceneSerializer serializer = new LuceneSerializer(false,true);
        QueryMetadata metadata = new DefaultQueryMetadata();
        assertEquals("title:\"Hello World\"", serializer.toQuery(title.eq("Hello World"), metadata).toString());
        assertEquals("title:Hello World", serializer.toQuery(title.eq(new TermElement("Hello World")), metadata).toString());
    }

    @Test
    public void testEqualsAndHashCode() {
    TermElement el1 = new TermElement("x"), el2 = new TermElement("x"), el3 = new TermElement("y");
View Full Code Here

    @Test
    public void test() {
        StringPath title = new StringPath("title");
        LuceneSerializer serializer = new LuceneSerializer(false,false);
        QueryMetadata metadata = new DefaultQueryMetadata();
        assertEquals("title:Hello World", serializer.toQuery(title.eq("Hello World"), metadata).toString());
        assertEquals("title:\"Hello World\"", serializer.toQuery(title.eq(new PhraseElement("Hello World")), metadata).toString());
    }

    @Test
    public void Equals() {
View Full Code Here

    public void test() {
        StringPath title = new StringPath("title");
        LuceneSerializer serializer = new LuceneSerializer(false,false);
        QueryMetadata metadata = new DefaultQueryMetadata();
        assertEquals("title:Hello World", serializer.toQuery(title.eq("Hello World"), metadata).toString());
        assertEquals("title:\"Hello World\"", serializer.toQuery(title.eq(new PhraseElement("Hello World")), metadata).toString());
    }

    @Test
    public void Equals() {
        PhraseElement el1 = new PhraseElement("x"), el2 = new PhraseElement("x"), el3 = new PhraseElement("y");
View Full Code Here

    @Test
    public void Precedence() {
        StringPath fn = employee.firstname;
        StringPath ln = employee.lastname;
        Predicate where = fn.eq("Mike").and(ln.eq("Smith")).or(fn.eq("Joe").and(ln.eq("Divis")));
        assertEquals(2l, query().from(employee).where(where).count());
    }

    @Test
    public void Precedence2() {
View Full Code Here

    @Test
    public void Precedence() {
        StringPath fn = employee.firstname;
        StringPath ln = employee.lastname;
        Predicate where = fn.eq("Mike").and(ln.eq("Smith")).or(fn.eq("Joe").and(ln.eq("Divis")));
        assertEquals(2l, query().from(employee).where(where).count());
    }

    @Test
    public void Precedence2() {
View Full Code Here

    @Test
    public void Precedence2() {
        StringPath fn = employee.firstname;
        StringPath ln = employee.lastname;
        Predicate where = fn.eq("Mike").and(ln.eq("Smith").or(fn.eq("Joe")).and(ln.eq("Divis")));
        assertEquals(0l, query().from(employee).where(where).count());
    }

    @Test
    public void Projection() throws IOException{
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.