Search in sources :

Example 1 with CfQuartz

use of io.clownfish.clownfish.dbentities.CfQuartz in project Clownfish by rawdog71.

the class CfQuartzDAOImpl method findByName.

@Override
public CfQuartz findByName(String name) {
    Session session = this.sessionFactory.getCurrentSession();
    TypedQuery query = (TypedQuery) session.getNamedQuery("CfQuartz.findByName");
    query.setParameter("name", name);
    CfQuartz cfquartz = (CfQuartz) query.getSingleResult();
    return cfquartz;
}
Also used : TypedQuery(javax.persistence.TypedQuery) Session(org.hibernate.Session) CfQuartz(io.clownfish.clownfish.dbentities.CfQuartz)

Example 2 with CfQuartz

use of io.clownfish.clownfish.dbentities.CfQuartz in project Clownfish by rawdog71.

the class CfQuartzDAOImpl method findAll.

@Override
public List<CfQuartz> findAll() {
    Session session = this.sessionFactory.getCurrentSession();
    TypedQuery query = (TypedQuery) session.getNamedQuery("CfQuartz.findAll");
    List<CfQuartz> cfquartzlist = query.getResultList();
    return cfquartzlist;
}
Also used : TypedQuery(javax.persistence.TypedQuery) Session(org.hibernate.Session) CfQuartz(io.clownfish.clownfish.dbentities.CfQuartz)

Example 3 with CfQuartz

use of io.clownfish.clownfish.dbentities.CfQuartz in project Clownfish by rawdog71.

the class CfQuartzDAOImpl method findById.

@Override
public CfQuartz findById(Long id) {
    Session session = this.sessionFactory.getCurrentSession();
    TypedQuery query = (TypedQuery) session.getNamedQuery("CfQuartz.findById");
    query.setParameter("id", id);
    CfQuartz cfquartz = (CfQuartz) query.getSingleResult();
    return cfquartz;
}
Also used : TypedQuery(javax.persistence.TypedQuery) Session(org.hibernate.Session) CfQuartz(io.clownfish.clownfish.dbentities.CfQuartz)

Example 4 with CfQuartz

use of io.clownfish.clownfish.dbentities.CfQuartz in project Clownfish by rawdog71.

the class QuartzList method onCreateJob.

public void onCreateJob(ActionEvent actionEvent) {
    try {
        CfQuartz newquartz = new CfQuartz();
        newquartz.setName(jobname);
        newquartz.setSchedule(jobvalue);
        newquartz.setActive(active);
        newquartz.setSiteRef(BigInteger.valueOf(siteref.getId()));
        cfquartzService.create(newquartz);
        quartzlist = cfquartzService.findAll();
        clownfish.setInitmessage(false);
        clownfish.init();
    // fillPropertyMap();
    } catch (ConstraintViolationException ex) {
        LOGGER.error(ex.getMessage());
    }
}
Also used : ConstraintViolationException(jakarta.validation.ConstraintViolationException) CfQuartz(io.clownfish.clownfish.dbentities.CfQuartz)

Aggregations

CfQuartz (io.clownfish.clownfish.dbentities.CfQuartz)4 TypedQuery (javax.persistence.TypedQuery)3 Session (org.hibernate.Session)3 ConstraintViolationException (jakarta.validation.ConstraintViolationException)1