Red Hat Application Migration Toolkit
package mx.com.bcm.banamex.ae.negocio.catalogo.bo.impl;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import mx.com.bcm.banamex.ae.negocio.catalogo.bo.CatalogoCuentaMayorBOBeanLocal;
import mx.com.bcm.banamex.ae.persistencia.assambler.CuentaMayorAssambler;
import mx.com.bcm.banamex.ae.persistencia.dao.CatalogoCuentaMayorDAOBeanLocal;
import mx.com.bcm.banamex.ae.persistencia.exception.EfectivoAplicacionBOException;
import mx.com.bcm.banamex.ae.persistencia.modelo.CuentasMayor;
import mx.com.bcm.banamex.ae.persistencia.vo.CuentaMayorVO;
@Stateless
public class CatalogoCuentaMayorBOImplBean implements CatalogoCuentaMayorBOBeanLocal {
@EJB
private CatalogoCuentaMayorDAOBeanLocal cuentaMayorDAO;
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public List consultaCuentaMayor() throws EfectivoAplicacionBOException {
ArrayList listaCuentaMayorVO = new ArrayList();
List listaCuentaMayor = this.cuentaMayorDAO.findAll();
Iterator var3 = listaCuentaMayor.iterator();
while(var3.hasNext()) {
CuentasMayor elemento = (CuentasMayor)var3.next();
CuentaMayorVO cuentaMayorVO = CuentaMayorAssambler.getCuentasMayorVO(elemento);
listaCuentaMayorVO.add(cuentaMayorVO);
}
return listaCuentaMayorVO;
}
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public void editCuentaMayor(CuentaMayorVO cuentaMayorVO) throws EfectivoAplicacionBOException {
CuentasMayor cuemay = CuentaMayorAssambler.getCuentasMayor(cuentaMayorVO);
this.cuentaMayorDAO.merge(cuemay);
}
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public CuentaMayorVO consultaCuentaMayorPorId(short cuentaMayorId) throws EfectivoAplicacionBOException {
CuentasMayor cuemay = (CuentasMayor)this.cuentaMayorDAO.findById(Short.valueOf(cuentaMayorId));
CuentaMayorVO cuentaMayorVO = new CuentaMayorVO();
cuentaMayorVO.setConceptoId(cuemay.getConceptoId());
cuentaMayorVO.setConceptoDescripcion(cuemay.getConceptoDescripcion());
cuentaMayorVO.setConceptoDoctoEfectivo(cuemay.getConceptoDoctoEfectivo());
cuentaMayorVO.setConceptoBillMon(cuemay.getConceptoBillMon());
cuentaMayorVO.setConceptoXdivisa(cuemay.getConceptoXdivisa());
cuentaMayorVO.setConceptoXtipoctto(cuemay.getConceptoXtipoctto());
cuentaMayorVO.setConceptoReferencia(cuemay.getConceptoReferencia());
cuentaMayorVO.setConceptoS018(cuemay.getConceptoS018());
cuentaMayorVO.setBajaLogica(cuemay.getConceptoBajaLogica());
return cuentaMayorVO;
}
}