Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- What is a good way to implement Reservation database EJB 3.0
- @Entity
- public class Reservation implements Serializable {
- ...
- private long startTime;
- private long endTime;
- private int status;
- @ManyToOne
- private Customer theCustomer; // record who made this reservation
- @ManyToOne
- private ReservableUnit theUnit; // record what this reservation is for
- ...
- }
- @Entity
- public class ReservableUnit implements Serializable {
- private int numOfAvailableUnits;
- ...
- private int[][][] firstMonth = new int[31][24][2];
- ...
- private int[][][] fourthMonth = new int[31][24][2];
- }
- //status
- public static final int AVAILABLE = 0;
- public static final int BLOCKED = 1;
- public static final int RESERVED = 2;
Add Comment
Please, Sign In to add comment