Package org.hibernate

Examples of org.hibernate.Criteria.uniqueResult()


        try {
            Criteria criteria = _session.createCriteria(HProcess.class);
            criteria.add(Expression.eq("processId", processId.toString()));
            // For the moment we are expecting only one result.
            HProcess hprocess = (HProcess) criteria.uniqueResult();
            return hprocess == null ? null : new ProcessDaoImpl(_sm, hprocess);
        } catch (HibernateException e) {
            __log.error("DbError", e);
            throw e;
        }
View Full Code Here


      */
    @Override
    public Party getPartyByPartyKey(String partyKey) {
        Criteria criteria = this.session().createCriteria(this.persistClass);
        criteria.add(Restrictions.eq("partyKey", partyKey));
        return (Party) criteria.uniqueResult();
    }

    /*
      * (non-Javadoc)
      *
 
View Full Code Here

      */
    @Override
    public Party getPartyByUsrNameAndEmail(String firstName, String lastName, String email) {
        Criteria criteria = this.session().createCriteria(this.persistClass);
        criteria.add(Restrictions.eq("personGivenName", firstName)).add(Restrictions.eq("personFamilyName", lastName)).add(Restrictions.eq("email", email));
        return (Party) criteria.uniqueResult();
    }

    /*
      * (non-Javadoc)
      *
 
View Full Code Here

      */
    @Override
    public Activity getActivityByActKey(String activityKey) {
        Criteria criteria = this.session().createCriteria(this.persistClass);
        criteria.add(Restrictions.eq("activityKey", activityKey));
        return (Activity) criteria.uniqueResult();
    }

    /*
      * (non-Javadoc)
      *
 
View Full Code Here

public class RegMetadataDAO extends HibernateGenericDAO<RegMetadata> implements IRegMetadataRepository {
    @Override
    public RegMetadata getRegMetadatadByDatasetId(long dsId) {
        Criteria criteria = this.session().createCriteria(this.persistClass);
        criteria.add(Restrictions.eq("datasetId", dsId));
        return (RegMetadata) criteria.uniqueResult();
    }
}
View Full Code Here

  private final Logger logger = LoggerFactory.getLogger(getClass());

  public UserConnectionLog getUserConnectionLogById(final Long userConnectionLogId, Object... params) {
        Criteria criteria = createDefaultCriteria(UserConnectionLog.class);
        criteria.add(Restrictions.eq("id", userConnectionLogId));
        UserConnectionLog userConnectionLog = (UserConnectionLog) criteria.uniqueResult();
        return userConnectionLog;
  }

  public List<UserConnectionLog> findUserConnectionLogsByUserId(final Long userId, Object... params) {
        Criteria criteria = createDefaultCriteria(UserConnectionLog.class);
View Full Code Here

        Criteria criteria = createDefaultCriteria(Cart.class);
       
        FetchPlan fetchPlan = handleSpecificFetchMode(criteria);
       
        criteria.add(Restrictions.eq("id", cartId));
        Cart cart = (Cart) criteria.uniqueResult();
        if(cart != null){
            cart.setFetchPlan(fetchPlan);
        }
        return cart;
  }
View Full Code Here

        FetchPlan fetchPlan = handleSpecificFetchMode(criteria);
       
        criteria.add(Restrictions.eq("marketAreaId", marketAreaId));
        criteria.add(Restrictions.eq("customerId", customerId));

        Cart cart = (Cart) criteria.uniqueResult();
        if(cart != null){
            cart.setFetchPlan(fetchPlan);
        }
        return cart;
    }
View Full Code Here

    public EngineBoSession getEngineBoSessionById(final Long engineSessionId, Object... params) {
        Criteria criteria = createDefaultCriteria(EngineBoSession.class);

        criteria.add(Restrictions.eq("id", engineSessionId));
        EngineBoSession engineSession = (EngineBoSession) criteria.uniqueResult();
        return engineSession;
    }
   
    public EngineBoSession getEngineBoSessionByEngineSessionGuid(final String engineSessionGuid, Object... params) {
        Criteria criteria = createDefaultCriteria(EngineBoSession.class);
View Full Code Here

   
    public EngineBoSession getEngineBoSessionByEngineSessionGuid(final String engineSessionGuid, Object... params) {
        Criteria criteria = createDefaultCriteria(EngineBoSession.class);

        criteria.add(Restrictions.eq("engineSessionGuid", engineSessionGuid));
        EngineBoSession engineSession = (EngineBoSession) criteria.uniqueResult();
        return engineSession;
    }

    public EngineBoSession saveOrUpdateEngineBoSession(EngineBoSession engineSession) {
        if (engineSession.getEngineSessionGuid() == null) {
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.