Examples of uniqueResult()


Examples of org.hibernate.Query.uniqueResult()

  public Job getFirstAcquirableJob() {
    Query query = hibernateSession.getSession().getNamedQuery("getFirstAcquirableJob");
    query.setTimestamp("now", Clock.getCurrentTime());
    query.setMaxResults(1);
    return (Job) query.uniqueResult();
  }

  @SuppressWarnings("unchecked")
  public List<Job> findExclusiveJobs(Execution processInstance) {
    Query query = hibernateSession.getSession().getNamedQuery("findExclusiveJobs");
View Full Code Here

Examples of org.hibernate.Query.uniqueResult()

  public Job getFirstDueJob() {
    Query query = hibernateSession.getSession().getNamedQuery("getFirstDueJob");
    query.setTimestamp("now", Clock.getCurrentTime());
    query.setMaxResults(1);
    return (Job) query.uniqueResult();
  }

  public void delete(Job job) {
    hibernateSession.delete(job);
  }
View Full Code Here

Examples of org.hibernate.Query.uniqueResult()

      LOG.info(post.toString());
        }
    }
      }*/

      userDetails = (UserDetails) query.uniqueResult();
  }
  catch (Exception e) {
      LOG.error("Excpetion occurred : " + e);
  }
  finally {
View Full Code Here

Examples of org.hibernate.Query.uniqueResult()

  try {
      session = getSessionFactory().getCurrentSession();
      query = session.getNamedQuery(GET_USER_DETAILS_BY_ID);
      query.setParameter(OBJ_ID, objId);

      userDetails = (UserDetails) query.uniqueResult();
  }
  catch (Exception e) {
      LOG.debug("Exception occurred : " + e);
  }
  finally {
View Full Code Here

Examples of org.hibernate.Query.uniqueResult()

  Map<String, Object> parameterMap = getParameterMap();
  parameterMap.put(OBJ_ID, objId);
  try {
      LOG.debug("Entering getPostByPostId >> UserPostsDAOImpl");
      query = getNamedQuery(GET_POST_BY_POST_ID, parameterMap);
      post = (Posts) query.uniqueResult();

  }
  catch (Exception e) {
      LOG.error("Error occured while retrieving Post : " + e);
  }
View Full Code Here

Examples of org.hibernate.SQLQuery.uniqueResult()

    try {
      String nativeQuery = "MATCH ( n:" + TABLE_NAME + " { name:{name}, author:'Oscar Wilde' } ) RETURN n";
      SQLQuery query = session.createNativeQuery( nativeQuery ).addEntity( OscarWildePoem.class );
      query.setParameter( "name", "Portia" );

      OscarWildePoem uniqueResult = (OscarWildePoem) query.uniqueResult();
      assertThat( uniqueResult ).isEqualTo( portia );
      transaction.commit();
    }
    finally {
      session.clear();
View Full Code Here

Examples of org.hibernate.impl.CriteriaImpl.uniqueResult()

          criteria.setMaxResults(Integer.MAX_VALUE);
        }
        if (criteria.getFirstResult() != null) {
          criteria.setFirstResult(0);
        }
        return (Long)criteria.uniqueResult();
      }
    });
  }
 
  /**
 
View Full Code Here

Examples of org.hibernate.search.FullTextQuery.uniqueResult()

    luceneQuery = parser.parse( "component.componentProperty:noise" );
    query = s.createFullTextQuery( luceneQuery, MyEntity.class );
    assertEquals( 1, query.getResultSize() );

    s.delete( query.uniqueResult() );
    tx.commit();

    s.close();
  }
View Full Code Here

Examples of org.jbpm.api.ProcessInstanceQuery.uniqueResult()

    try
    {
      ExecutionService execService = this.processEngine.getExecutionService();
      ProcessInstanceQuery query = execService.createProcessInstanceQuery();
      query.processInstanceId(instanceId);
      ProcessInstance processInstance = query.uniqueResult();
      return ModelAdaptor.adoptExecution( (ExecutionImpl)processInstance);
    }
    finally
    {
      env.close();
View Full Code Here

Examples of org.jbpm.api.history.HistoryProcessInstanceQuery.uniqueResult()

      HistoryService histService = this.processEngine.getHistoryService();
      for(ProcessInstanceRef inst : results)
      {
        HistoryProcessInstanceQuery hQuery = histService.createHistoryProcessInstanceQuery();
        hQuery.processInstanceId(inst.getId());
        HistoryProcessInstance entry = hQuery.uniqueResult();
        inst.setStartDate(entry.getStartTime());
      }

      return results;
    }
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.