Examples of from()


Examples of br.com.caelum.vraptor.serialization.JSONSerialization.from()

        return serializerBuilder;
      }
    });

    when(result.use(JSONSerialization.class)).thenReturn(serialization);
    when(serialization.from(any())).thenReturn(serializerBuilder);

    try {
      factory.instanceFor(JSONSerialization.class, errors).from(new Object());
      factory.instanceFor(JSONSerialization.class, errors).from(new Object()).include("abc");
      factory.instanceFor(JSONSerialization.class, errors).from(new Object()).exclude("abc");
View Full Code Here

Examples of com.datastax.driver.core.querybuilder.Select.Selection.from()

        if (pm.structure().isCounter()) {
            throw new IllegalArgumentException(String.format("Cannot prepare statement for property '%s' of entity '%s' because it is a counter type",pm.getPropertyName(),entityMeta.getClassName()));
        } else {
            Selection select = pm.forStatementGeneration().prepareSelectField(select());
            final EntityMetaConfig metaConfig = entityMeta.config();
            Select from = select.from(metaConfig.getKeyspaceName(), metaConfig.getTableName());
            RegularStatement statement = idMeta.forStatementGeneration().generateWhereClauseForSelect(Optional.fromNullable(pm), from);
            return session.prepare(statement.getQueryString());
        }
    }
View Full Code Here

Examples of com.google.api.ads.common.lib.auth.GoogleClientSecretsBuilder.GoogleClientSecretsForApiBuilder.from()

    GoogleClientSecretsForApiBuilder builder = new GoogleClientSecretsForApiBuilder(
        configurationHelper, GoogleClientSecretsBuilder.Api.DFP);

    try {
      builder.from(config).build();
      fail("Validation exception should have been thrown");
    } catch (ValidationException e) {
      assertEquals("Client ID must be set."
          + "\nIf you do not have a client ID or secret, please create one in the API "
          + "console: https://code.google.com/apis/console#access", e.getMessage());
View Full Code Here

Examples of com.google.api.ads.common.lib.auth.OfflineCredentials.ForApiBuilder.from()

    ForApiBuilder builder = new OfflineCredentials.ForApiBuilder(
        configurationHelper, OfflineCredentials.Api.DFP, oAuth2Helper);

    try {
      OfflineCredentials offlineCredentials = builder.from(config).build();
      fail("Validation exception should have been thrown");
    } catch (ValidationException e) {
      assertEquals("A refresh token must be set."
          + "\nIt is required for offline credentials. If you need to create one, "
          + "see the GetRefreshToken example.", e.getMessage());
View Full Code Here

Examples of com.mysema.query.jpa.JPASubQuery.from()

    @SuppressWarnings("unchecked")
    @Test
    public void PackageLess_Path() {
        JPASubQuery query = new JPASubQuery();
        PathBuilder builder = new PathBuilder(PackagelessEntityTest.class,"entity");
        query.from(builder);
        assertEquals("select entity\nfrom PackagelessEntityTest entity", query.toString());
    }

}
View Full Code Here

Examples of com.mysema.query.jpa.JPQLQuery.from()

    @NoBatooJPA
    public void Enum_In2() {
        QEmployee employee = QEmployee.employee;

        JPQLQuery query = query();
        query.from(employee).where(employee.lastName.eq("Smith"), employee.jobFunctions
                .contains(JobFunction.CODER));
        assertEquals(1l, query.count());
    }

    @Test
View Full Code Here

Examples of com.mysema.query.jpa.hibernate.HibernateQuery.from()

    @Test
    public void InnerJoin() {
        HibernateQuery hqlQuery = new HibernateQuery();
        QEmployee employee = QEmployee.employee;
        hqlQuery.from(employee);
        hqlQuery.innerJoin(employee.user, QUser.user);
        assertEquals("select employee\nfrom Employee employee\n  inner join employee.user as user", hqlQuery.toString());
    }

}
View Full Code Here

Examples of com.mysema.query.jpa.impl.JPAQuery.from()

   
    @Test
    public void test() throws IOException, ClassNotFoundException{
        // create query
        JPAQuery query = new JPAQuery(entityManager);
        query.from(cat).where(cat.name.eq("Kate")).list(cat);
       
        // get metadata
        QueryMetadata metadata = query.getMetadata();
        assertFalse(metadata.getJoins().isEmpty());
        assertTrue(metadata.getWhere() != null);
View Full Code Here

Examples of com.mysema.query.sql.SQLQuery.from()

    @Test
    public void test() throws IOException, SecurityException,
            IllegalArgumentException, NoSuchMethodException,
            IllegalAccessException, InvocationTargetException {
        SQLQuery query = new SQLQuery(connection, new DerbyTemplates());
        query.from(survey);
        query.addListener(new TestLoggingListener());
        new QueryMutability(query).test(survey.id, survey.name);
    }

    @Test
View Full Code Here

Examples of com.mysema.query.sql.SQLSubQuery.from()

        QSurvey table = new QSurvey("SURVEY");
        RelationalFunctionCall<String> func = RelationalFunctionCall.create(String.class, "TableValuedFunction", "parameter");
        PathBuilder<String> funcAlias = new PathBuilder<String>(String.class, "tokFunc");
        SQLSubQuery sq = new SQLSubQuery();
        SubQueryExpression<?> expr = sq.from(table)
            .join(func, funcAlias).on(table.name.like(funcAlias.getString("prop")).not()).list(table.name);

        Configuration conf = new Configuration(new SQLServerTemplates());
        SQLSerializer serializer = new NativeSQLSerializer(conf, true);
        serializer.serialize(expr.getMetadata(), false);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.