Example usage for org.hibernate.criterion ProjectionList add

List of usage examples for org.hibernate.criterion ProjectionList add

Introduction

In this page you can find the example usage for org.hibernate.criterion ProjectionList add.

Prototype

public ProjectionList add(Projection projection) 

Source Link

Document

Add a projection to this list of projections

Usage

From source file:br.com.hrstatus.dao.impl.ConfigurationDAO.java

License:Open Source License

public String getDestsNotLogged() {

    log.fine("[ System ] getDestsNotLogged()");

    final Criteria subject = session().createCriteria(Configurations.class);
    final ProjectionList proList = Projections.projectionList();
    proList.add(Projections.property("dests"));
    subject.setProjection(proList);/*from   w w w. j a  v a  2s . co  m*/
    return (String) subject.uniqueResult();
}

From source file:br.com.hrstatus.dao.impl.ConfigurationDAO.java

License:Open Source License

public String getJndiMail() {

    log.fine("[ " + userInfo.getLoggedUsername() + " ] getJndiMail()");

    final Criteria subject = session().createCriteria(Configurations.class);
    final ProjectionList proList = Projections.projectionList();
    proList.add(Projections.property("jndiMail"));
    subject.setProjection(proList);//from w w  w  .j av  a 2  s  . c o m
    return (String) subject.uniqueResult();
}

From source file:br.com.hrstatus.dao.impl.ConfigurationDAO.java

License:Open Source License

public String getJndiMailNotLogged() {

    log.fine("[ System ] getJndiMail()");

    final Criteria subject = session().createCriteria(Configurations.class);
    final ProjectionList proList = Projections.projectionList();
    proList.add(Projections.property("jndiMail"));
    subject.setProjection(proList);/*from   ww  w  .  j  a v a2s . c o  m*/
    return (String) subject.uniqueResult();
}

From source file:br.com.hrstatus.dao.impl.ConfigurationDAO.java

License:Open Source License

public int getDiffirenceSecs() {

    log.fine("[ " + userInfo.getLoggedUsername() + " ] getDiffirenceSecs()");

    final Criteria difference = session().createCriteria(Configurations.class);
    final ProjectionList proList = Projections.projectionList();
    proList.add(Projections.property("difference"));
    difference.setProjection(proList);/*  w w  w  .ja  v a2 s .c  o  m*/
    final int value = (Integer) difference.uniqueResult();
    return value;
}

From source file:br.com.hrstatus.dao.impl.ConfigurationDAO.java

License:Open Source License

public int getDiffirenceSecsScheduler(String schedulerName) {

    log.fine("[ " + schedulerName + " ] getDiffirenceSecsScheduler()");

    final Criteria difference = session().createCriteria(Configurations.class);
    final ProjectionList proList = Projections.projectionList();
    proList.add(Projections.property("difference"));
    difference.setProjection(proList);//from ww  w  . java  2s . c  om
    final int value = (Integer) difference.uniqueResult();
    return value;
}

From source file:br.com.hrstatus.dao.impl.ConfigurationDAO.java

License:Open Source License

public String getNtpServerAddress() {

    log.fine("[ " + userInfo.getLoggedUsername() + " ] getNtpServerAddress()");

    final Criteria ntpServer = session().createCriteria(Configurations.class);
    final ProjectionList proList = Projections.projectionList();
    proList.add(Projections.property("ntpServer"));
    ntpServer.setProjection(proList);//from  w w w  . j av  a2s.  c o  m
    return (String) ntpServer.uniqueResult();
}

From source file:br.com.hrstatus.dao.impl.ConfigurationDAO.java

License:Open Source License

public String getNtpServerAddressNotLogged() {

    log.fine("[ System ] getNtpServerAddress()");

    final Criteria ntpServer = session().createCriteria(Configurations.class);
    final ProjectionList proList = Projections.projectionList();
    proList.add(Projections.property("ntpServer"));
    ntpServer.setProjection(proList);/*from  ww w  .  j a va 2s .  co  m*/
    return (String) ntpServer.uniqueResult();
}

From source file:br.com.hrstatus.dao.impl.InstallProcessDAO.java

License:Open Source License

public boolean freshInstall() {

    log.fine("[ System ] invoking freshInstall()");

    final Criteria freshInstall = session().createCriteria(InstallationProcess.class);
    final ProjectionList proList = Projections.projectionList();
    proList.add(Projections.property("freshInstall"));
    freshInstall.setProjection(proList);

    boolean result = false;

    try {/*from   ww w.j av  a  2 s  .c o  m*/
        final String temp = freshInstall.uniqueResult().toString();

        if (new Boolean(temp)) {
            result = true;
        } else if (!new Boolean(temp)) {
            result = false;
        }
    } catch (java.lang.NullPointerException NPE) {
        result = true;
    }
    return result;
}

From source file:br.com.hrstatus.dao.impl.InstallProcessDAO.java

License:Open Source License

public String getInstallationDate() {

    log.fine("[ System ] invoking getInstallationDate()");
    final Criteria installDate = session().createCriteria(InstallationProcess.class);
    final ProjectionList proList = Projections.projectionList();
    proList.add(Projections.property("installDate"));
    installDate.setProjection(proList);// w w  w .ja v  a2s.c o  m
    return installDate.uniqueResult().toString();
}

From source file:br.com.hrstatus.dao.impl.ServersDAO.java

License:Open Source License

@SuppressWarnings("unchecked")
public List<Servidores> getHostnames() {

    log.fine("[ " + userInfo.getLoggedUsername() + " ] getHostnames()");

    try {/*from   w w  w  .  java  2  s.  c  om*/

        final Criteria criteriaHostname = session().createCriteria(Servidores.class);
        final ProjectionList proList = Projections.projectionList();
        proList.add(Projections.property("id"));
        proList.add(Projections.property("hostname"));
        criteriaHostname.setProjection(proList);
        return criteriaHostname.list();

    } catch (Exception e) {
        log.severe("Error: " + e);
        return new ArrayList<Servidores>();
    }
}