Search in sources :

Example 56 with Statement

use of com.google.api.ads.admanager.jaxws.v202205.Statement in project googleads-java-lib by googleads.

the class StatementBuilderTest method testIncreaseOffset.

@Test
public void testIncreaseOffset() {
    StatementBuilder statementBuilder = new StatementBuilder();
    Statement initialOffset = statementBuilder.limit(100).offset(100).toStatement();
    assertEquals("LIMIT 100 OFFSET 100", initialOffset.getQuery());
    Statement increasedOffset = statementBuilder.increaseOffsetBy(100).toStatement();
    assertEquals("LIMIT 100 OFFSET 200", increasedOffset.getQuery());
}
Also used : Statement(com.google.api.ads.admanager.axis.v202105.Statement) Test(org.junit.Test)

Example 57 with Statement

use of com.google.api.ads.admanager.jaxws.v202205.Statement in project googleads-java-lib by googleads.

the class StatementBuilderTest method testLimit.

@Test
public void testLimit() {
    StatementBuilder statementBuilder = new StatementBuilder();
    Statement statement = statementBuilder.limit(500).toStatement();
    assertEquals("LIMIT 500", statement.getQuery());
}
Also used : Statement(com.google.api.ads.admanager.axis.v202105.Statement) Test(org.junit.Test)

Example 58 with Statement

use of com.google.api.ads.admanager.jaxws.v202205.Statement in project googleads-java-lib by googleads.

the class StatementBuilder method toStatement.

/**
 * Gets the {@link Statement} representing the state of this statement builder.
 *
 * @return the {@link Statement}
 */
public Statement toStatement() {
    Statement statement = new Statement();
    statement.setQuery(queryBuilder.buildQuery());
    statement.getValues().addAll(Maps.toList(queryBuilder.getBindVariableMap(), StringValueMapEntry.class));
    return statement;
}
Also used : Statement(com.google.api.ads.admanager.jaxws.v202105.Statement) StringValueMapEntry(com.google.api.ads.admanager.jaxws.v202105.StringValueMapEntry)

Example 59 with Statement

use of com.google.api.ads.admanager.jaxws.v202205.Statement in project googleads-java-lib by googleads.

the class StatementBuilder method toStatement.

/**
 * Gets the {@link Statement} representing the state of this statement builder.
 *
 * @return the {@link Statement}
 */
public Statement toStatement() {
    Statement statement = new Statement();
    statement.setQuery(queryBuilder.buildQuery());
    statement.setValues(Maps.toList(queryBuilder.getBindVariableMap(), String_ValueMapEntry.class).toArray(new String_ValueMapEntry[] {}));
    return statement;
}
Also used : String_ValueMapEntry(com.google.api.ads.admanager.axis.v202205.String_ValueMapEntry) Statement(com.google.api.ads.admanager.axis.v202205.Statement)

Example 60 with Statement

use of com.google.api.ads.admanager.jaxws.v202205.Statement in project googleads-java-lib by googleads.

the class StatementBuilderTest method testOrderBy.

@Test
public void testOrderBy() {
    StatementBuilder statementBuilder = new StatementBuilder();
    Statement statement = statementBuilder.orderBy("id ASC").toStatement();
    assertEquals("ORDER BY id ASC", statement.getQuery());
}
Also used : Statement(com.google.api.ads.admanager.axis.v202108.Statement) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)77 Statement (com.google.api.ads.admanager.axis.v202105.Statement)16 Statement (com.google.api.ads.admanager.axis.v202108.Statement)16 Statement (com.google.api.ads.admanager.axis.v202111.Statement)16 Statement (com.google.api.ads.admanager.axis.v202202.Statement)16 Statement (com.google.api.ads.admanager.axis.v202205.Statement)16 Statement (org.neo4j.driver.v1.Statement)5 String_ValueMapEntry (com.google.api.ads.admanager.axis.v202105.String_ValueMapEntry)4 String_ValueMapEntry (com.google.api.ads.admanager.axis.v202108.String_ValueMapEntry)4 String_ValueMapEntry (com.google.api.ads.admanager.axis.v202111.String_ValueMapEntry)4 String_ValueMapEntry (com.google.api.ads.admanager.axis.v202202.String_ValueMapEntry)4 String_ValueMapEntry (com.google.api.ads.admanager.axis.v202205.String_ValueMapEntry)4 Session (org.neo4j.driver.v1.Session)3 StatementResult (org.neo4j.driver.v1.StatementResult)3 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2 Neo4JGraph (com.steelbridgelabs.oss.neo4j.structure.Neo4JGraph)2 IOException (java.io.IOException)2 Collections (java.util.Collections)2 TreeMap (java.util.TreeMap)2 CypherQuery (org.eol.globi.util.CypherQuery)2