Back to project page Android-Lib-Database.
The source code is released under:
Apache License
If you think the Android project Android-Lib-Database listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package android.lib.database.query; /*from w ww . java2 s.com*/ import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** * A SQL abstraction layer for building SQLite SQL queries via a object-oriented API. * <p>The end result of a {@link Query} object will produce a SQL statement that represents the * target query and can be directly executed against the database.</p> * <p>{@link Query} object provides fou primary types of queries, {@link Select}, {@link Update}, * {@link Insert} and {@link Delete}, that can be used to interacting or building queries.</p> * <p>For complex queries such as sub-<code>SELECT</code> queries, instantiate a {@link Query} * object with the specific raw SQL statement.</p> */ public class Query { private final List<Object> parameters; protected String rawSQL; public Query(final String rawSQL, final Object... parameters) { this.rawSQL = rawSQL; this.parameters = Arrays.asList(parameters); } public Query(final String rawSQL, final List<Object> parameters) { this.rawSQL = rawSQL; this.parameters = parameters; } protected Query() { this.parameters = new ArrayList<Object>(); } public String getRawSQL() { return this.rawSQL; } public List<Object> getParameters() { return this.parameters; } public static Select select() { return new Select(); } public static Update update() { return new Update(); } public static Insert insert() { return new Insert(); } public static Delete delete() { return new Delete(); } }