Package org.jrest4guice.dao.annotations

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


   * 检查是否有查询设置,有返回<code>true</code>,没有返回<code>false</code>
   * @return
   */
  private boolean hasQuerySetting() {
    Retrieve retrieve = getAnnotation();
    if (StringUtils.isNotBlank(retrieve.query()))
      return true;
    if (StringUtils.isNotBlank(retrieve.namedQuery()))
      return true;
    return false;
  }
View Full Code Here


    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
      return em.createQuery(retrieve.query());
  }
View Full Code Here

      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
      return em.createQuery(retrieve.query());
  }
 
  @Override
View Full Code Here

      if (retrieve.resultClass().equals(void.class))
        return em.createNativeQuery(retrieve.query());
      else
        return em.createNativeQuery(retrieve.query(), retrieve.resultClass());
    } else
      return em.createQuery(retrieve.query());
  }
 
  @Override
  protected void initialize() {
    annotationClass = Retrieve.class;
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.