Advertisement
Guest User

Untitled

a guest
Mar 28th, 2015
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. private List<EstabelecimentoORM> getListEstabelecimentoORM(){
  2.  
  3. List<EstabelecimentoORM> listEstabelecimentoORM = null;
  4.  
  5. try {
  6.  
  7. final EstabelecimentoDAO estabelecimentoDAO = new EstabelecimentoDAO(dbHelper.getConnectionSource());
  8.  
  9. listEstabelecimentoORM = new ArrayList<EstabelecimentoORM>();
  10. final List<Integer> listIds = new ArrayList<Integer>();
  11.  
  12. GenericRawResults<EstabelecimentoORM> list = estabelecimentoDAO.queryRaw(
  13. "SELECT * FROM responsavel WHERE status = " + Constants.TypeObject.ENVIAR_SERVIDOR,
  14. new RawRowMapper<EstabelecimentoORM>() {
  15. @Override
  16. public EstabelecimentoORM mapRow(String[] columnNames, String[] resp) throws SQLException {
  17. for(int i = 0 ; i<resp.length ; i++){
  18. listIds.add(Integer.parseInt(resp[0]));
  19. }
  20.  
  21. return null;
  22. }
  23. });
  24.  
  25. for(int a: listIds){
  26. listEstabelecimentoORM.add(estabelecimentoDAO.queryForId(a));
  27. }
  28.  
  29. } catch (Exception e) {
  30. e.printStackTrace();
  31. }
  32. return listEstabelecimentoORM;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement