Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package py.com.personal.bc.falcon.ool.business;
- import java.util.ArrayList;
- import java.util.List;
- import java.util.Random;
- import javax.enterprise.context.ApplicationScoped;
- import javax.inject.Inject;
- import org.slf4j.Logger;
- import py.com.personal.bc.common.exceptions.BusinessException;
- import py.com.personal.bc.common.transactions.TransactionModes;
- import py.com.personal.bc.common.transactions.Transactional;
- import py.com.personal.bc.common.transactions.voltdb.util.loader.LoadSettings;
- import py.com.personal.bc.falcon.ool.dao.OfertasCursorDAO;
- import py.com.personal.bc.falcon.ool.model.OfertasCursor;
- import py.com.personal.bc.voltdb.utils.mapper.MapConfig;
- import py.com.personal.bc.voltdb.utils.mapper.views.DefaultView;
- @ApplicationScoped
- public class OfertasCursorBusiness {
- @Inject
- OfertasCursorDAO dao;
- @Inject
- Logger logger;
- private static final String QUERY = "LoadCursorOferta";//"LoadOfertasCursor";
- public List<OfertasCursor> LoadOfertasCursor(OfertasCursor ofertas) throws BusinessException {
- logger.debug("LoadOfertasCursor: IN[OfertasCursor:{}]",ofertas);
- MapConfig mapConfig = new MapConfig(OfertasCursor.class, DefaultView.class, true);
- mapConfig.setLock(false);
- LoadSettings settings = new LoadSettings();
- settings.setQueryStatement(QUERY);
- settings.setColumns(OfertasCursor.Columnas.AGRUPADOR_PERFIL, OfertasCursor.Columnas.CANAL, OfertasCursor.Columnas.TIPO_EVENTO);
- List<OfertasCursor> enviar = new ArrayList<OfertasCursor>();
- try {
- enviar = dao.singlePartitionedLoadList(ofertas, mapConfig,new Random().toString(), settings);
- } catch (Exception e) {
- throw new BusinessException(e.getMessage());
- }
- logger.debug("LoadOfertasCursor: OUT[{}]",ofertas);
- return enviar;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement