Example usage for org.hibernate Criteria list

List of usage examples for org.hibernate Criteria list

Introduction

In this page you can find the example usage for org.hibernate Criteria list.

Prototype

public List list() throws HibernateException;

Source Link

Document

Get the results.

Usage

From source file:au.org.theark.core.dao.StudyDao.java

License:Open Source License

public Collection<FileFormat> getFileFormats() {
    Criteria criteria = getSession().createCriteria(FileFormat.class);
    java.util.Collection<FileFormat> fileFormatCollection = criteria.list();
    return fileFormatCollection;
}

From source file:au.org.theark.core.dao.StudyDao.java

License:Open Source License

public Collection<DelimiterType> getDelimiterTypes() {
    Criteria criteria = getSession().createCriteria(DelimiterType.class);
    java.util.Collection<DelimiterType> delimiterTypeCollection = criteria.list();
    return delimiterTypeCollection;
}

From source file:au.org.theark.core.dao.StudyDao.java

License:Open Source License

public Collection<UploadType> getUploadTypes() {
    Criteria criteria = getSession().createCriteria(UploadType.class);
    java.util.Collection<UploadType> delimiterTypeCollection = criteria.list();
    return delimiterTypeCollection;
}

From source file:au.org.theark.core.dao.StudyDao.java

License:Open Source License

public List<Upload> searchUploads(Upload uploadCriteria) {
    Criteria criteria = getSession().createCriteria(Upload.class);
    // Must be constrained on the arkFunction
    criteria.add(Restrictions.eq("arkFunction", uploadCriteria.getArkFunction()));

    if (uploadCriteria.getId() != null) {
        criteria.add(Restrictions.eq("id", uploadCriteria.getId()));
    }/*  w  ww.j  av a2  s.co m*/

    if (uploadCriteria.getStudy() != null) {
        criteria.add(Restrictions.eq("study", uploadCriteria.getStudy()));
    }

    if (uploadCriteria.getFileFormat() != null) {
        criteria.add(Restrictions.ilike("fileFormat", uploadCriteria.getFileFormat()));
    }

    if (uploadCriteria.getDelimiterType() != null) {
        criteria.add(Restrictions.ilike("delimiterType", uploadCriteria.getDelimiterType()));
    }

    if (uploadCriteria.getFilename() != null) {
        criteria.add(Restrictions.ilike("filename", uploadCriteria.getFilename()));
    }

    criteria.addOrder(Order.desc("id"));
    List<Upload> resultsList = criteria.list();

    return resultsList;
}

From source file:au.org.theark.core.dao.StudyDao.java

License:Open Source License

public List<Upload> searchUploadsForBio(Upload uploadCriteria) {
    Criteria criteria = getSession().createCriteria(Upload.class);
    // - due to nature of table design...we need to specify it like this
    // ideally we might want to just have arkmodule in the upload table?
    // criteria.add(Restrictions.eq("arkFunction",
    // uploadCriteria.getArkFunction()));

    ArkFunction biospecArkFunction = getArkFunctionByName(Constants.FUNCTION_KEY_VALUE_BIOSPECIMEN);
    //ArkFunction biocollArkFunction = getArkFunctionByName(Constants.FUNCTION_KEY_VALUE_LIMS_COLLECTION);
    ArkFunction biocollArkFunction = getArkFunctionByName(Constants.FUNCTION_KEY_VALUE_LIMS_CUSTOM_FIELD);

    List<ArkFunction> arkFunctionsForBio = new ArrayList<ArkFunction>();
    arkFunctionsForBio.add(biospecArkFunction);
    arkFunctionsForBio.add(biocollArkFunction);

    criteria.add(Restrictions.in("arkFunction", arkFunctionsForBio));

    if (uploadCriteria.getId() != null) {
        criteria.add(Restrictions.eq("id", uploadCriteria.getId()));
    }/*www .  java2  s.co  m*/

    if (uploadCriteria.getStudy() != null) {
        criteria.add(Restrictions.eq("study", uploadCriteria.getStudy()));
    }

    if (uploadCriteria.getFileFormat() != null) {
        criteria.add(Restrictions.ilike("fileFormat", uploadCriteria.getFileFormat()));
    }

    if (uploadCriteria.getDelimiterType() != null) {
        criteria.add(Restrictions.ilike("delimiterType", uploadCriteria.getDelimiterType()));
    }

    if (uploadCriteria.getFilename() != null) {
        criteria.add(Restrictions.ilike("filename", uploadCriteria.getFilename()));
    }

    criteria.addOrder(Order.desc("id"));
    List<Upload> resultsList = criteria.list();

    return resultsList;
}

From source file:au.org.theark.core.dao.StudyDao.java

License:Open Source License

public List<Upload> searchUploadsForBiospecimen(Upload uploadCriteria, List studyListForUser) {
    Criteria criteria = getSession().createCriteria(Upload.class);
    // - due to nature of table design...we need to specify it like this
    // ideally we might want to just have arkmodule in the upload table?
    // criteria.add(Restrictions.eq("arkFunction",
    // uploadCriteria.getArkFunction()));

    ArkFunction biospecArkFunction = getArkFunctionByName(Constants.FUNCTION_KEY_VALUE_BIOSPECIMEN);

    List<ArkFunction> arkFunctionsForBio = new ArrayList<ArkFunction>();
    arkFunctionsForBio.add(biospecArkFunction);

    criteria.add(Restrictions.eq("arkFunction", uploadCriteria.getArkFunction()));

    if (uploadCriteria.getId() != null) {
        criteria.add(Restrictions.eq("id", uploadCriteria.getId()));
    }/*from  w ww.  j  ava  2s.  c o m*/

    if (!studyListForUser.isEmpty()) {
        criteria.add(Restrictions.in("study", studyListForUser));
    }

    if (uploadCriteria.getFileFormat() != null) {
        criteria.add(Restrictions.ilike("fileFormat", uploadCriteria.getFileFormat()));
    }

    if (uploadCriteria.getDelimiterType() != null) {
        criteria.add(Restrictions.ilike("delimiterType", uploadCriteria.getDelimiterType()));
    }

    if (uploadCriteria.getFilename() != null) {
        criteria.add(Restrictions.ilike("filename", uploadCriteria.getFilename()));
    }

    criteria.addOrder(Order.desc("id"));
    List<Upload> resultsList = criteria.list();

    return resultsList;
}

From source file:au.org.theark.core.dao.StudyDao.java

License:Open Source License

public List<BiospecimenUidToken> getBiospecimenUidTokens() {
    Criteria criteria = getSession().createCriteria(BiospecimenUidToken.class);
    return criteria.list();
}

From source file:au.org.theark.core.dao.StudyDao.java

License:Open Source License

public List<BiospecimenUidPadChar> getBiospecimenUidPadChars() {
    Criteria criteria = getSession().createCriteria(BiospecimenUidPadChar.class);
    return criteria.list();
}

From source file:au.org.theark.core.dao.StudyDao.java

License:Open Source License

public List<Study> getStudyListAssignedToBiospecimenUidTemplate() {
    Criteria criteria = getSession().createCriteria(BiospecimenUidTemplate.class);
    criteria.setProjection(Projections.projectionList().add(Projections.groupProperty("study")));
    return criteria.list();
}

From source file:au.org.theark.core.dao.StudyDao.java

License:Open Source License

public List<BioCollectionUidToken> getBioCollectionUidToken() {
    Example token = Example.create(new BioCollectionUidToken());
    Criteria criteria = getSession().createCriteria(BioCollectionUidToken.class).add(token);
    return criteria.list();
}