Advertisement
Guest User

Untitled

a guest
Nov 16th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. package py.com.personal.bc.falcon.ool.business;
  2.  
  3. import java.util.ArrayList;
  4. import java.util.List;
  5. import java.util.Random;
  6.  
  7. import javax.enterprise.context.ApplicationScoped;
  8. import javax.inject.Inject;
  9.  
  10. import org.slf4j.Logger;
  11.  
  12. import py.com.personal.bc.common.exceptions.BusinessException;
  13. import py.com.personal.bc.common.transactions.TransactionModes;
  14. import py.com.personal.bc.common.transactions.Transactional;
  15. import py.com.personal.bc.common.transactions.voltdb.util.loader.LoadSettings;
  16. import py.com.personal.bc.falcon.ool.dao.OfertasCursorDAO;
  17. import py.com.personal.bc.falcon.ool.model.OfertasCursor;
  18. import py.com.personal.bc.voltdb.utils.mapper.MapConfig;
  19. import py.com.personal.bc.voltdb.utils.mapper.views.DefaultView;
  20.  
  21. @ApplicationScoped
  22. public class OfertasCursorBusiness {
  23.  
  24. @Inject
  25. OfertasCursorDAO dao;
  26.  
  27. @Inject
  28. Logger logger;
  29.  
  30. private static final String QUERY = "LoadCursorOferta";//"LoadOfertasCursor";
  31.  
  32. public List<OfertasCursor> LoadOfertasCursor(OfertasCursor ofertas) throws BusinessException {
  33. logger.debug("LoadOfertasCursor: IN[OfertasCursor:{}]",ofertas);
  34. MapConfig mapConfig = new MapConfig(OfertasCursor.class, DefaultView.class, true);
  35. mapConfig.setLock(false);
  36.  
  37. LoadSettings settings = new LoadSettings();
  38. settings.setQueryStatement(QUERY);
  39. settings.setColumns(OfertasCursor.Columnas.AGRUPADOR_PERFIL, OfertasCursor.Columnas.CANAL, OfertasCursor.Columnas.TIPO_EVENTO);
  40.  
  41. List<OfertasCursor> enviar = new ArrayList<OfertasCursor>();
  42.  
  43. try {
  44. enviar = dao.singlePartitionedLoadList(ofertas, mapConfig,new Random().toString(), settings);
  45. } catch (Exception e) {
  46. throw new BusinessException(e.getMessage());
  47. }
  48. logger.debug("LoadOfertasCursor: OUT[{}]",ofertas);
  49. return enviar;
  50.  
  51. }
  52.  
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement