Examples of createNamedQuery()


Examples of com.avaje.ebean.EbeanServer.createNamedQuery()

    r.setProductConfiguration(pc);
    r.setGroupConfiguration(gc);
    server.save(r);


    Query<CalculationResult> q = server.createNamedQuery(CalculationResult.class, "loadResult");
    q.setParameter("charge", charge);
   
    List<CalculationResult> results = q.findList();
   
    Assert.assertTrue(!results.isEmpty());
View Full Code Here

Examples of com.avaje.ebean.EbeanServer.createNamedQuery()

    r.setProductConfiguration(pc);
    r.setGroupConfiguration(null);
    server.save(r);


    Query<CalculationResult> q = server.createNamedQuery(CalculationResult.class, "loadResult");
    q.setParameter("charge", charge);
   
    List<CalculationResult> results = q.findList();
   
    Assert.assertTrue(!results.isEmpty());
View Full Code Here

Examples of javax.persistence.EntityManager.createNamedQuery()

 
  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());
View Full Code Here

Examples of javax.persistence.EntityManager.createNamedQuery()

 
  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());
View Full Code Here

Examples of javax.persistence.EntityManager.createNamedQuery()

        }

        logger.debug("Finding: className={0}, callbackEvent={1}", className, callbackEvent);

        EntityManager entityManager = entityManagerFactory.createEntityManager();
        Query query = entityManager.createNamedQuery("findLifecycleEvent");
        query.setParameter("className", className);
        query.setParameter("event", callbackEvent);


        List arFound = query.getResultList();
View Full Code Here

Examples of javax.persistence.EntityManager.createNamedQuery()

     */
    public List findCallbackEvent(final String className) {
        logger.debug("Finding: className={0}", className);

        EntityManager entityManager = entityManagerFactory.createEntityManager();
        Query query = entityManager.createNamedQuery("findLifecycleEventByClass");
        query.setParameter("className", className);
        return query.getResultList();
    }

    /**
 
View Full Code Here

Examples of javax.persistence.EntityManager.createNamedQuery()

     * @return the list of results.
     */
    public List findCallbackEventByCallbackMethod(final String className, final CallbackType callbackEvent,
            final String callbackClassName) {
        EntityManager entityManager = entityManagerFactory.createEntityManager();
        Query query = entityManager.createNamedQuery("findLifecycleEventByCallbackMethod");
        query.setParameter("className", className);
        query.setParameter("event", callbackEvent);
        query.setParameter("callbackClassName", callbackClassName);
        return query.getResultList();
    }
View Full Code Here

Examples of javax.persistence.EntityManager.createNamedQuery()

     * Finds all callback events.
     * @return events
     */
    public List findAll(){
        EntityManager entityManager = entityManagerFactory.createEntityManager();
        Query query = entityManager.createNamedQuery("findAll");
        return query.getResultList();
    }

    /**
     * Deletes all callback events from the database.
View Full Code Here

Examples of javax.persistence.EntityManager.createNamedQuery()

     */
    @ExcludeDefaultInterceptors
    @ExcludeClassInterceptors
    public void deleteAll() {
        EntityManager entityManager = entityManagerFactory.createEntityManager();
        Query query = entityManager.createNamedQuery("findAll");
        List lstEvent = query.getResultList();
        for (Object obj : lstEvent) {
            CallbackLogger callbackLogger = (CallbackLogger) obj;
            if (callbackLogger != null) {
                entityManager.remove(callbackLogger);
View Full Code Here

Examples of javax.persistence.EntityManager.createNamedQuery()

  public Query createNamedQuery(String sql)
  {
    EntityManager em = getCurrent();
   
    if (em != null) {
      return em.createNamedQuery(sql);
    }
   
    em = createEntityManager();
   
    try {
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.