Guest User

Untitled

a guest
Apr 19th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.68 KB | None | 0 0
  1. mám dataTable svázaný s vector proměnnou, takže do ní tahám data přes  public Vector
  2. managed bean:
  3. <Room> getAllRooms() {
  4.         if(allRooms == null){
  5.             allRooms = roomSBLocal.GetAllRooms();
  6.         }
  7.         return allRooms;
  8.     }
  9. session bean:
  10.  @Override
  11.     public Vector<Customer> GetAllCustomers() {
  12.          Vector<Customer> customers = getCustomerDAO().GetAllCustomers();
  13.         return customers;
  14.     }
  15.  
  16. DAO:
  17. public static String QUERY_SELECT_ALL_CUSTOMERS = "SELECT c FROM Customer c";
  18.  
  19. @Override
  20.     public Vector<Customer> GetAllCustomers() {
  21.         return (Vector<Customer>)em.createQuery(QUERY_SELECT_ALL_CUSTOMERS).getResultList();
  22.     }
Add Comment
Please, Sign In to add comment