Guest User

Untitled

a guest
Aug 21st, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. What is a good way to implement Reservation database EJB 3.0
  2. @Entity
  3. public class Reservation implements Serializable {
  4. ...
  5. private long startTime;
  6. private long endTime;
  7. private int status;
  8. @ManyToOne
  9. private Customer theCustomer; // record who made this reservation
  10. @ManyToOne
  11. private ReservableUnit theUnit; // record what this reservation is for
  12. ...
  13. }
  14.  
  15. @Entity
  16. public class ReservableUnit implements Serializable {
  17.  
  18. private int numOfAvailableUnits;
  19. ...
  20. private int[][][] firstMonth = new int[31][24][2];
  21. ...
  22. private int[][][] fourthMonth = new int[31][24][2];
  23. }
  24.  
  25. //status
  26. public static final int AVAILABLE = 0;
  27. public static final int BLOCKED = 1;
  28. public static final int RESERVED = 2;
Add Comment
Please, Sign In to add comment