view src/main/java/de/intevation/lada/manage/LProbeManager.java @ 112:094e4c344c08

Removed unused imports.
author Raimund Renkert <rrenkert@intevation.de>
date Wed, 12 Jun 2013 14:39:29 +0200
parents 9db50ea77eb4
children
line wrap: on
line source
package de.intevation.lada.manage;

import java.util.logging.Logger;

import javax.ejb.EJBTransactionRolledbackException;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import javax.inject.Inject;
import javax.persistence.EntityExistsException;
import javax.persistence.EntityManager;
import javax.persistence.TransactionRequiredException;

import de.intevation.lada.model.LProbe;

/**
 * This Manager provides databse operations for LProbe objects.
 *
 * @author <a href="mailto:rrenkert@intevation.de">Raimund Renkert</a>
 */
@Stateless
public class LProbeManager {

    @Inject
    private Logger log;

    @Inject
    private EntityManager em;

    /**
     * Delete a LProbe object by id.
     *
     * @param id
     * @throws Exception
     */
    @TransactionAttribute(TransactionAttributeType.REQUIRED)
    public void delete(String id) throws Exception {
        LProbe probe = em.find(LProbe.class, id);
        log.info("Deleting " + probe.getProbeId());
        em.remove(probe);
    }

    /**
     * Persist a new LProbe object in the database using the LProbeValidator.
     *
     * @param probe The new LProbe object.
     *
     * @throws EntityExistsException
     * @throws IllegalArgumentException
     * @throws TransactionRequiredException
     */
    @TransactionAttribute(TransactionAttributeType.REQUIRED)
    public void create(LProbe probe)
    throws EntityExistsException,
        IllegalArgumentException,
        EJBTransactionRolledbackException,
        TransactionRequiredException {
        em.persist(probe);
    }

    /**
     * Updates a LProbe object in the database.
     *
     * @param probe The new LProbe object.
     *
     * @throws EntityExistsException
     * @throws IllegalArgumentException
     * @throws TransactionRequiredException
     */
    @TransactionAttribute(TransactionAttributeType.REQUIRED)
    public void update(LProbe probe)
    throws EntityExistsException,
        IllegalArgumentException,
        EJBTransactionRolledbackException,
        TransactionRequiredException {
        em.merge(probe);
    }
}
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)