|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.api.ads.dfp.axis.utils.v201201.StatementBuilder
public final class StatementBuilder
StatementBuilder allows for statements to be constructed in parts.
Typical usage is:
StatementBuilder statementBuilder = new StatementBuilder()
.where("lastModifiedDateTime > :yesterday AND type = :type")
.orderBy("name DESC")
.limit(200)
.offset(20)
.withBindVariableValue("yesterday",
DateTimes.fromDate(new org.joda.time.DateTime().minusDays(1).toDate()))
.withBindVariableValue("type", "Type")
Statement statement = statementBuilder.toStatement();
//...
statementBuilder.increaseOffsetBy(20);
statement = statementBuilder.toStatement();
| Field Summary | |
|---|---|
static int |
SUGGESTED_PAGE_LIMIT
|
| Constructor Summary | |
|---|---|
StatementBuilder()
Constructs a statement builder. |
|
| Method Summary | |
|---|---|
String |
buildQuery()
|
StatementBuilder |
from(String table)
|
Map<String,Value> |
getBindVariableMap()
|
Integer |
getOffset()
|
StatementBuilder |
increaseOffsetBy(Integer amount)
|
StatementBuilder |
limit(Integer count)
|
StatementBuilder |
offset(Integer count)
|
StatementBuilder |
orderBy(String orderBy)
|
StatementBuilder |
removeLimitAndOffset()
|
StatementBuilder |
select(String columns)
|
Statement |
toStatement()
Gets the Statement representing the state of this statement
builder. |
StatementBuilder |
where(String conditions)
|
StatementBuilder |
withBindVariableValue(String key,
Object value)
Adds a bind variable value to the statement. |
StatementBuilder |
withBindVariableValue(String key,
Value value)
Adds a bind variable value to the statement. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int SUGGESTED_PAGE_LIMIT
| Constructor Detail |
|---|
public StatementBuilder()
| Method Detail |
|---|
public StatementBuilder withBindVariableValue(String key,
Object value)
Pql.createValue(Object). If the value is of type
Value, no conversion will be done.
key - the value keyvalue - the bind variable value
public StatementBuilder withBindVariableValue(String key,
Value value)
withBindVariableValue in interface QueryBuilderInterface<Value>key - the value keyvalue - the bind variable value
public Statement toStatement()
Statement representing the state of this statement
builder.
Statementpublic StatementBuilder select(String columns)
select in interface QueryBuilderInterface<Value>public StatementBuilder from(String table)
from in interface QueryBuilderInterface<Value>public StatementBuilder where(String conditions)
where in interface QueryBuilderInterface<Value>public StatementBuilder limit(Integer count)
limit in interface QueryBuilderInterface<Value>public StatementBuilder offset(Integer count)
offset in interface QueryBuilderInterface<Value>public StatementBuilder increaseOffsetBy(Integer amount)
increaseOffsetBy in interface QueryBuilderInterface<Value>public Integer getOffset()
getOffset in interface QueryBuilderInterface<Value>public StatementBuilder removeLimitAndOffset()
removeLimitAndOffset in interface QueryBuilderInterface<Value>public StatementBuilder orderBy(String orderBy)
orderBy in interface QueryBuilderInterface<Value>public Map<String,Value> getBindVariableMap()
getBindVariableMap in interface QueryBuilderInterface<Value>public String buildQuery()
buildQuery in interface QueryBuilderInterface<Value>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||