×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Jonathan Vila López
Added: Jun 18, 2014 12:07 PM
Views: 16
Tags: no tags
bean
  1. public class UploadARIImpl extends ServiceImpl implements UploadARI {
  2.   private static final Logger log = org.slf4j.LoggerFactory.getLogger(UploadARIImpl.class);
  3.  
  4.   @Override
  5.   public String getRegimenes() {
  6.     Regimenes regimen = entityManager.find(Regimenes.class, "AD");
  7.     String salida = "REgimen : " + regimen.toString();
  8.     return salida;
  9.   }
  10.  
  11.   @Override
  12.   public List<EventoPrecio> getEventosPrecio() {
  13.     log.info("querying");
  14.     Query consulta = entityManager.createQuery("SELECT OBJ FROM EventoPrecio obj WHERE obj.fechaenvio IS NULL AND obj.obsoleto IS NULL AND obj.numintentos < 5");
  15.     consulta.setMaxResults(10);
  16.     log.info("pre executing query");
  17.     List<EventoPrecio> lista = consulta.getResultList();
  18.     log.info("Eventos recuperados : " + lista.size());
  19.    
  20.     for (EventoPrecio item : lista) {
  21.       log.info("Eventos : " + item.getCodigohot() + "--" + item.getCodigocp() + "--" + item.getCodtarifa() + " ---" + item.getFechaevento());
  22.     }
  23.     return lista;
  24.   }