Example usage for org.hibernate.criterion Projections property

List of usage examples for org.hibernate.criterion Projections property

Introduction

In this page you can find the example usage for org.hibernate.criterion Projections property.

Prototype

public static PropertyProjection property(String propertyName) 

Source Link

Document

A property value projection

Usage

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

License:Open Source License

public String getMailSender() {

    log.fine("[ " + userInfo.getLoggedUsername() + " ] getMailSender()");
    final Criteria mailFrom = session().createCriteria(Configurations.class);
    final ProjectionList proList = Projections.projectionList();
    proList.add(Projections.property("mailFrom"));
    mailFrom.setProjection(proList);/*from   w w  w.  ja va2 s.c o m*/
    return (String) mailFrom.uniqueResult();
}

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

License:Open Source License

public String getMailSenderNotLogged() {

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

    final Criteria mailFrom = session().createCriteria(Configurations.class);
    final ProjectionList proList = Projections.projectionList();
    proList.add(Projections.property("mailFrom"));
    mailFrom.setProjection(proList);/*  w  w w.  ja  v a2s . c  o  m*/
    return (String) mailFrom.uniqueResult();
}

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

License:Open Source License

public boolean sendNotification() {

    log.fine("Invoking sendNotification() database query,");

    final Criteria sendNotification = session().createCriteria(Configurations.class);
    final ProjectionList proList = Projections.projectionList();
    proList.add(Projections.property("sendNotification"));
    sendNotification.setProjection(proList);
    return (Boolean) sendNotification.uniqueResult();
}

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

License:Open Source License

public String getSubject() {

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

    final Criteria subject = session().createCriteria(Configurations.class);
    final ProjectionList proList = Projections.projectionList();
    proList.add(Projections.property("subject"));
    subject.setProjection(proList);/*from w  ww.jav a  2  s.c om*/
    return (String) subject.uniqueResult();
}

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

License:Open Source License

public String getSubjectNotLogged() {

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

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

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

License:Open Source License

public String getDests() {

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

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

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 www  .  j  a  va  2s  .  c  o 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 .jav  a 2s. com
    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 w w w .j a  va2 s  .  c  om
    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);//from w  ww  .ja  v  a2  s.c  o m
    final int value = (Integer) difference.uniqueResult();
    return value;
}