Search in sources :

Example 86 with Statement

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

the class StatementBuilderTest method testOrderBy_stripsOrderBy.

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

Example 87 with Statement

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

the class StatementBuilderTest method testSelect_stripsSelect.

@Test
public void testSelect_stripsSelect() {
    StatementBuilder statementBuilder = new StatementBuilder();
    Statement statement = statementBuilder.select("SELECT id, name").toStatement();
    assertEquals("SELECT id, name", statement.getQuery());
}
Also used : Statement(com.google.api.ads.admanager.axis.v202205.Statement) Test(org.junit.Test)

Example 88 with Statement

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

the class StatementBuilderTest method testBindVariables_bool.

@Test
public void testBindVariables_bool() {
    StatementBuilder statementBuilder = new StatementBuilder();
    Statement statement = statementBuilder.where("bool = :bool").withBindVariableValue("bool", true).toStatement();
    String_ValueMapEntry entry = statement.getValues(0);
    assertEquals("bool", entry.getKey());
    assertEquals(BooleanValue.class, entry.getValue().getClass());
    assertEquals(true, ((BooleanValue) entry.getValue()).getValue());
}
Also used : String_ValueMapEntry(com.google.api.ads.admanager.axis.v202205.String_ValueMapEntry) Statement(com.google.api.ads.admanager.axis.v202205.Statement) Test(org.junit.Test)

Example 89 with Statement

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

the class StatementBuilderTest method testBindVariables_number.

@Test
public void testBindVariables_number() {
    StatementBuilder statementBuilder = new StatementBuilder();
    Statement statement = statementBuilder.where("number = :number").withBindVariableValue("number", 1).toStatement();
    String_ValueMapEntry entry = statement.getValues(0);
    assertEquals("number", entry.getKey());
    assertEquals(NumberValue.class, entry.getValue().getClass());
    assertEquals("1", ((NumberValue) entry.getValue()).getValue());
}
Also used : String_ValueMapEntry(com.google.api.ads.admanager.axis.v202205.String_ValueMapEntry) Statement(com.google.api.ads.admanager.axis.v202205.Statement) Test(org.junit.Test)

Example 90 with Statement

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

the class StatementBuilderTest method testRemoveLimitAndOffset.

@Test
public void testRemoveLimitAndOffset() {
    StatementBuilder statementBuilder = new StatementBuilder();
    Statement initialOffset = statementBuilder.where("id = 1").limit(100).offset(100).toStatement();
    assertEquals("WHERE id = 1 LIMIT 100 OFFSET 100", initialOffset.getQuery());
    Statement removed = statementBuilder.removeLimitAndOffset().toStatement();
    assertEquals("WHERE id = 1", removed.getQuery());
}
Also used : Statement(com.google.api.ads.admanager.axis.v202205.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