Package org.qzerver.model.dao.job.impl

Source Code of org.qzerver.model.dao.job.impl.ScheduleActionJpaDao

package org.qzerver.model.dao.job.impl;

import org.qzerver.model.dao.job.ScheduleActionDao;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

@Transactional(propagation = Propagation.MANDATORY)
public class ScheduleActionJpaDao implements ScheduleActionDao {

    private EntityManager entityManager;

    @Override
    public int deleteOrphaned() {
        Query query = entityManager.createNamedQuery("ScheduleAction.removeOrphaned");

        return query.executeUpdate();
    }

    @PersistenceContext
    public void setEntityManager(EntityManager entityManager) {
        this.entityManager = entityManager;
    }
}
TOP

Related Classes of org.qzerver.model.dao.job.impl.ScheduleActionJpaDao

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.