All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.catools.etl.dao.CEtlStatusDao Maven / Gradle / Ivy

There is a newer version: 0.1.25
Show newest version
package org.catools.etl.dao;

import org.catools.etl.model.CEtlStatus;
import org.hibernate.annotations.QueryHints;
import org.slf4j.Logger;

public class CEtlStatusDao extends CEtlBaseDao {
    public static CEtlStatus getStatusById(Logger logger, String id) {
        return find(logger, CEtlStatus.class, id);
    }

    public static void mergeStatus(Logger logger, CEtlStatus status) {
        merge(logger, status);
    }

    public static CEtlStatus getStatusByName(Logger logger, String name) {
        return getTransactionResult(logger, session -> {
            return session.createNamedQuery("getStatusByName", CEtlStatus.class)
                    .setParameter("name", name)
                    .setHint(QueryHints.CACHEABLE, true)
                    .getResultStream()
                    .findFirst()
                    .orElse(null);
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy