Skip to content

squedgy/query-construction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Query Constructor

Select

Examples are good things:

import com.dfaris.query.construction.Query;
import static com.dfaris.query.construction.Select.select;

Query q = select("t.name", "t.age")
        .from("People", "t")
            .fullJoin("Eggs", "e").on("personId", "t", "personId")
        .where()
            .column("t.age").greaterThan(18)
            .and()
            .column("t.name").like("D%")
            .and()
            .startParenthesizedGroup()
                .binding()
                .column("t.address").like("address")
                .or()
                .literal()
                .column("t.zipcode").in("53355", "53018", "00019")
            .endParenthesizedGroup()
        .build();
System.out.println(q);

the above outputs

SELECT t.name, t.age FROM (People t FULL JOIN Eggs e ON e.personId = t.personId) WHERE (t.address LIKE :address OR t.zipcode in ('53355','53018','00019'))

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages