Examples of nativeQuery()


Examples of info.archinnov.achilles.persistence.PersistenceManager.nativeQuery()

        final PersistenceManager manager = resource.getPersistenceManager();
        RegularStatement regularStatement = select().countAll().from("system","schema_keyspaces")
                .where(eq("keyspace_name","test_keyspace"));

        //When
        final Map<String,Object> map = manager.nativeQuery(regularStatement).first();

        //Then
        assertThat(map.get("count")).isEqualTo(1L);

    }
View Full Code Here

Examples of org.jrest4guice.dao.annotations.Find.nativeQuery()

  private Query getQuery() {
    Find find = getAnnotation();
    if (StringUtils.isNotBlank(find.namedQuery()))
      return getSession().getNamedQuery(find.namedQuery());
    if (find.nativeQuery())
      return getSession().createSQLQuery(find.query());
    else
      return getSession().createQuery(find.query());
  }
View Full Code Here

Examples of org.jrest4guice.dao.annotations.Find.nativeQuery()

  public Object execute(Object[] parameters) {
    Query query = getQuery();
    QueryParameter queryPara = new QueryParameter(parameters, method.getParameterAnnotations());
    fittingQuery(query, queryPara);
    Find find = getAnnotation();
    if (!find.resultClass().equals(void.class) && !find.nativeQuery())
      return toProjectionalList(find.resultClass(), query.getResultList());
    return query.getResultList();
  }
 
  @SuppressWarnings("unchecked")
View Full Code Here

Examples of org.jrest4guice.dao.annotations.Find.nativeQuery()

  private Query getQuery() {
    Find find = getAnnotation();
    EntityManager em = getContext().getEntityManager();
    if (StringUtils.isNotBlank(find.namedQuery()))
      return em.createNamedQuery(find.namedQuery());
    if (find.nativeQuery()) {
      if (find.resultClass().equals(void.class))
        return em.createNativeQuery(find.query());
      else
        return em.createNativeQuery(find.query(), find.resultClass());
    } else
View Full Code Here

Examples of org.jrest4guice.dao.annotations.Retrieve.nativeQuery()

  private Object queryResult(Object[] parameters) {
    Retrieve retrieve = getAnnotation();
    Query query = getQuery();
    QueryParameter queryPara = new QueryParameter(parameters, method.getParameterAnnotations());
    QueryUtils.fittingQuery(query, queryPara);
    if (!retrieve.resultClass().equals(void.class) && !retrieve.nativeQuery())
      return toProjectionalObject(retrieve.resultClass(), query.getSingleResult());
    else
      return query.getSingleResult();
  }
 
View Full Code Here

Examples of org.jrest4guice.dao.annotations.Retrieve.nativeQuery()

  private Query getQuery() {
    Retrieve retrieve = getAnnotation();
    EntityManager em = getContext().getEntityManager();
    if (StringUtils.isNotBlank(retrieve.namedQuery()))
      return em.createNamedQuery(retrieve.namedQuery());
    if (retrieve.nativeQuery()) {
      if (retrieve.resultClass().equals(void.class))
        return em.createNativeQuery(retrieve.query());
      else
        return em.createNativeQuery(retrieve.query(), retrieve.resultClass());
    } else
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.