Examples of Query


Examples of org.simpleframework.http.Query

    * query and the form post are merge together in a single query.
    *
    * @return the query associated with the HTTP target URI
    */  
   public Query build() {;
      Query query = header.getQuery();
     
      if(!isFormPost()) {
         return query;
      }
      return getQuery(query);
View Full Code Here

Examples of org.skife.jdbi.v2.Query

        ParameterizedType returnType = (ParameterizedType) t;
        final Type[] h = returnType.getActualTypeArguments();
        assert(h.length == 1);
        assert(h[0] instanceof Class);
        Class c = (Class) h[0];
        Query q = handle.createQuery(s.value()).map(c);
        if (args != null) bindArguments(method.isAnnotationPresent(BindBy.class) ?
                                        method.getAnnotation(BindBy.class).value() :
                                        BindType.Position, q, args);
        return f.doit(q);
    }
View Full Code Here

Examples of org.springframework.data.gemfire.repository.Query

   *
   * @return the annotated query or {@literal null} in case it's empty or none available.
   */
  String getAnnotatedQuery() {

    Query query = method.getAnnotation(Query.class);
    String queryString = query == null ? null : (String) AnnotationUtils.getValue(query);

    return StringUtils.hasText(queryString) ? queryString : null;
  }
View Full Code Here

Examples of org.springframework.data.jpa.repository.Query

   * @param defaultValue
   * @return
   */
  private <T> T getAnnotationValue(String attribute, Class<T> type) {

    Query annotation = method.getAnnotation(Query.class);
    Object value = annotation == null ? AnnotationUtils.getDefaultValue(Query.class, attribute) : AnnotationUtils
        .getValue(annotation, attribute);

    return type.cast(value);
  }
View Full Code Here

Examples of org.springframework.data.mongodb.core.query.Query

    @Test
    public void getDefaultPage_Valid(){
        PageType pageType = PageType.get("user");
        MongoDbPageTemplate found = new MongoDbPageTemplate();
        expect(template.findOne(new Query(where("pageType").is(pageType.getPageType().toUpperCase()).andOperator(where("defaultTemplate").is(true))), MongoDbPageTemplate.class, CollectionNames.PAGE_TEMPLATE_COLLECTION)).andReturn(found);
        converter.hydrate(found, PageTemplate.class);
        expectLastCall();
        replay(converter, template);

        PageTemplate returned = templateRepository.getDefaultPage(pageType);
View Full Code Here

Examples of org.springframework.data.neo4j.annotation.Query

import static org.springframework.data.neo4j.support.DoReturn.doReturn;

public class QueryFieldAccessorFactory implements FieldAccessorFactory<NodeBacked> {
  @Override
    public boolean accept(final Neo4JPersistentProperty f) {
        final Query query = f.getAnnotation(Query.class);
        return query != null
                && !query.value().isEmpty();
    }
View Full Code Here

Examples of org.springframework.data.simpledb.annotation.Query

   * @param type
   * @return
   */
  private <T> T getAnnotationValue(String attribute, Class<T> type) {

    Query annotation = method.getAnnotation(Query.class);
    Object value = annotation == null ? AnnotationUtils.getDefaultValue(Query.class, attribute) : AnnotationUtils
        .getValue(annotation, attribute);

    return type.cast(value);
  }
View Full Code Here

Examples of org.springframework.data.solr.core.query.Query

@NoRepositoryBean
public class SolrProductRepository extends SimpleSolrRepository<Product, String> implements ProductRepository {

  @Override
  public Page<Product> findByPopularity(Integer popularity) {
    Query query = new SimpleQuery(new Criteria(SolrSearchableFields.POPULARITY).is(popularity));
    return getSolrOperations().queryForPage(query, Product.class);
  }
View Full Code Here

Examples of org.sql2o.Query

        assertTrue(failed);

        assertTrue("Assert that connection is correctly closed (with transaction)", connection.getJdbcConnection().isClosed() );
       
        // same test, but not in a transaction
        Query query = sql2o.createQuery("insert into issue3table(val) values(:val)")
            .addParameter("val", "abcde").addToBatch()
            .addParameter("val", "abcdefg").addToBatch() // should fail
            .addParameter("val", "hello").addToBatch();
       
        boolean failed2 = false;
        try{
            query.executeBatch();
        }
        catch(Sql2oException ex){
            failed2 = true;
            System.out.println("expected error: " + ex.toString());
        }

        assertTrue(failed2);

        assertTrue("Assert that connection is correctly closed (no transaction)", query.getConnection().getJdbcConnection().isClosed());
           
    }
View Full Code Here

Examples of org.structr.core.app.Query

    if (uuid.length() > 0) {

      logger.log(Level.FINE, "Requested id: {0}", uuid);

      final Query query = StructrApp.getInstance(securityContext).nodeQuery();

      query.and(GraphObject.id, uuid);
      query.and().orType(Page.class).orTypes(File.class);

      // Searching for pages needs super user context anyway
      Result results = query.getResult();

      logger.log(Level.FINE, "{0} results", results.size());
      request.setAttribute(POSSIBLE_ENTRY_POINTS, results.getResults());

      return (List<Linkable>) results.getResults();
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.