Examples of createQuery()


Examples of org.restsql.core.sqlresource.ObjectFactory.createQuery()

   */
  protected int createDefs(final File subDirObj, final String databaseName, final String exclusionPattern) throws GenerationException {
    // Create definition object
    final ObjectFactory objectFactory = new ObjectFactory();
    final SqlResourceDefinition def = objectFactory.createSqlResourceDefinition();
    final Query query = objectFactory.createQuery();
    def.setQuery(query);
    final MetaData metaData = objectFactory.createMetaData();
    final Database database = objectFactory.createDatabase();
    database.setDefault(databaseName);
    metaData.setDatabase(database);
View Full Code Here

Examples of org.skife.jdbi.v2.Handle.createQuery()

                .bind("column_one", 7)
                .bind("column_two", "Rebecca")
                .execute();
        assertEquals(1, count);

        final String name = h.createQuery("select name from something where id = 7")
                .map(StringMapper.FIRST)
                .first();
        assertEquals(name, "Rebecca");
    }
View Full Code Here

Examples of org.sonar.api.database.DatabaseSession.createQuery()

  }

  protected final Rule doFindById(int ruleId) {
    DatabaseSession session = sessionFactory.getSession();
    return session.getSingleResult(
      session.createQuery("FROM " + Rule.class.getSimpleName() + " r WHERE r.id=:id and r.status<>:status")
        .setParameter("id", ruleId)
        .setParameter("status", Rule.STATUS_REMOVED
        ),
      null);
  }
View Full Code Here

Examples of org.springframework.data.cassandra.repository.query.StringBasedCassandraQuery.createQuery()

    Method method = SampleRepository.class.getMethod("findByLastname", String.class);
    CassandraQueryMethod queryMethod = new CassandraQueryMethod(method, metadata, converter.getMappingContext());
    StringBasedCassandraQuery cassandraQuery = new StringBasedCassandraQuery(queryMethod, operations);
    CassandraParametersParameterAccessor accesor = new CassandraParametersParameterAccessor(queryMethod, "Matthews");

    String stringQuery = cassandraQuery.createQuery(accesor);
    SimpleStatement actual = new SimpleStatement(stringQuery);

    String table = Person.class.getSimpleName().toLowerCase();
    Select expected = QueryBuilder.select().all().from(table);
    expected.setForceNoValues(true);
View Full Code Here

Examples of org.springframework.data.neo4j.repository.query.GraphQueryMethod.createQuery()

    protected QueryLookupStrategy getQueryLookupStrategy(QueryLookupStrategy.Key key) {
        return new QueryLookupStrategy() {
            @Override
            public RepositoryQuery resolveQuery(Method method, RepositoryMetadata repositoryMetadata, NamedQueries namedQueries) {
                final GraphQueryMethod queryMethod = new GraphQueryMethod(method,repositoryMetadata,namedQueries,mappingContext);
                return queryMethod.createQuery(GraphRepositoryFactory.this.template);
            }
        };
    }

View Full Code Here

Examples of org.sql.generation.api.grammar.factories.QueryFactory.createQuery()

            this.createTypeCondition( resultType, vendor ), variables, values, valueSQLTypes );

        QuerySpecificationBuilder mainQuery = q.querySpecificationBuilder();
        mainQuery.getSelect().addUnnamedColumns( mainColumn );
        mainQuery.getFrom().addTableReferences(
            t.tableBuilder( t.table( q.createQuery( innerBuilder.createExpression() ),
                                     t.tableAlias( TABLE_NAME_PREFIX + "0" ) ) ) );

        this.processOrderBySegments( orderBySegments, vendor, mainQuery );

        QueryExpression finalMainQuery = this.finalizeQuery(
View Full Code Here

Examples of org.sql2o.Connection.createQuery()

        boolean failed = false;

        Connection connection = sql2o.beginTransaction();

        try{
            connection.createQuery("insert into issue3table(val) values(:val)")
                .addParameter("val", "abcde").addToBatch()
                .addParameter("val", "abcdefg").addToBatch() // should fail
                .addParameter("val", "hello").addToBatch()
                .executeBatch().commit();
        }
View Full Code Here

Examples of org.sql2o.Sql2o.createQuery()

     * The priority was wrong. Sql2o would try to set the field first, and afterwards the setter. The priority should be
     * the setter first and the field after.
     */
    @Test public void testSetterPriority(){
        Sql2o sql2o = new Sql2o(url, user, pass);
        Issue1Pojo pojo = sql2o.createQuery("select 1 val from (values(0))").executeAndFetchFirst(Issue1Pojo.class);

        assertEquals(2, pojo.val);

    }

View Full Code Here

Examples of org.topbraid.spin.arq.ARQ2SPIN.createQuery()

    public static QueryBuilder fromQuery(Query query, String uri, Model model)
    {
  if (query == null) throw new IllegalArgumentException("Query cannot be null");
 
  ARQ2SPIN arq2spin = new ARQ2SPIN(model);
  return fromQuery(arq2spin.createQuery(query, uri));
    }

    public static QueryBuilder fromQuery(Query query, Model model)
    {
  return fromQuery(query, null, model);
View Full Code Here

Examples of siena.remote.RemotePersistenceManager.createQuery()

   
    remote.get(TESLA);
    assertEquals("get", mock.action);
    assertEquals(expected, mock.object);
   
    remote.createQuery(Person.class).fetch();
    assertEquals(0, mock.lastQuery.filters.size());
    assertEquals(0, mock.lastQuery.orders.size());
   
    remote.createQuery(Person.class).order("firstName").order("lastName").fetch();
    assertEquals(0, mock.lastQuery.filters.size());
View Full Code Here
TOP
Copyright © 2015 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.