-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from darshnair/development
Entities Added
- Loading branch information
Showing
8 changed files
with
855 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
package com.nms.bo; | ||
|
||
import java.util.Date; | ||
import java.util.Set; | ||
|
||
import javax.persistence.CascadeType; | ||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.GenerationType; | ||
import javax.persistence.Id; | ||
import javax.persistence.JoinColumn; | ||
import javax.persistence.ManyToOne; | ||
import javax.persistence.OneToMany; | ||
import javax.persistence.Table; | ||
|
||
@Entity | ||
@Table(name = "MOVIE") | ||
public class Movie { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.AUTO) | ||
@Column(name = "MOVIE_ID") | ||
protected int movieID; | ||
|
||
@Column(name="MOVIE_NM") | ||
protected String movieName; | ||
|
||
protected String duration; | ||
|
||
@Column(name="DATE_OF_BOOKING") | ||
protected Date dateofbooking; | ||
|
||
protected String show; | ||
|
||
@Column(name="NUMBER_OF_TICKETS") | ||
protected int nooftickets; | ||
|
||
@OneToMany(mappedBy = "movie", cascade = CascadeType.ALL) | ||
protected Set<Screening> screening; | ||
|
||
@ManyToOne | ||
@JoinColumn(name="THEATER_ID", nullable = false) | ||
protected Theater theater; | ||
|
||
public Movie(int movieID, String movieName, String duration, Date dateofbooking, String show, int nooftickets, | ||
Set<Screening> screening, Theater theater) { | ||
super(); | ||
this.movieID = movieID; | ||
this.movieName = movieName; | ||
this.duration = duration; | ||
this.dateofbooking = dateofbooking; | ||
this.show = show; | ||
this.nooftickets = nooftickets; | ||
this.screening = screening; | ||
this.theater = theater; | ||
} | ||
|
||
public int getMovieID() { | ||
return movieID; | ||
} | ||
|
||
public void setMovieID(int movieID) { | ||
this.movieID = movieID; | ||
} | ||
|
||
public String getMovieName() { | ||
return movieName; | ||
} | ||
|
||
public void setMovieName(String movieName) { | ||
this.movieName = movieName; | ||
} | ||
|
||
public String getDuration() { | ||
return duration; | ||
} | ||
|
||
public void setDuration(String duration) { | ||
this.duration = duration; | ||
} | ||
|
||
public Date getDateofbooking() { | ||
return dateofbooking; | ||
} | ||
|
||
public void setDateofbooking(Date dateofbooking) { | ||
this.dateofbooking = dateofbooking; | ||
} | ||
|
||
public String getShow() { | ||
return show; | ||
} | ||
|
||
public void setShow(String show) { | ||
this.show = show; | ||
} | ||
|
||
public int getNooftickets() { | ||
return nooftickets; | ||
} | ||
|
||
public void setNooftickets(int nooftickets) { | ||
this.nooftickets = nooftickets; | ||
} | ||
|
||
public Set<Screening> getScreening() { | ||
return screening; | ||
} | ||
|
||
public void setScreening(Set<Screening> screening) { | ||
this.screening = screening; | ||
} | ||
|
||
public Theater getTheater() { | ||
return theater; | ||
} | ||
|
||
public void setTheater(Theater theater) { | ||
this.theater = theater; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Movie [movieID=" + movieID + ", movieName=" + movieName + ", duration=" + duration + ", dateofbooking=" | ||
+ dateofbooking + ", show=" + show + ", nooftickets=" + nooftickets + ", screening=" + screening | ||
+ ", theater=" + theater + "]"; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
package com.nms.bo; | ||
|
||
import java.time.LocalDate; | ||
|
||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.GenerationType; | ||
import javax.persistence.Id; | ||
import javax.persistence.JoinColumn; | ||
import javax.persistence.ManyToOne; | ||
import javax.persistence.Table; | ||
|
||
@Entity | ||
@Table(name="PAYMENT") | ||
public class Payment { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.AUTO) | ||
@Column(name = "PAYMENT_ID") | ||
protected int paymentid; | ||
|
||
@Column(name = "PAY_AMOUNT") | ||
protected float payamount; | ||
|
||
@Column(name = "PAY_DESC") | ||
protected String paydescription; | ||
|
||
@Column(name = "PAY_DATE") | ||
protected LocalDate paydate; | ||
|
||
@ManyToOne | ||
@JoinColumn(name="USER_ID", nullable = false) | ||
protected User user; | ||
|
||
public Payment(int paymentid, float payamount, String paydescription, LocalDate paydate, User user) { | ||
super(); | ||
this.paymentid = paymentid; | ||
this.payamount = payamount; | ||
this.paydescription = paydescription; | ||
this.paydate = paydate; | ||
this.user = user; | ||
} | ||
|
||
public int getPaymentid() { | ||
return paymentid; | ||
} | ||
|
||
public void setPaymentid(int paymentid) { | ||
this.paymentid = paymentid; | ||
} | ||
|
||
public float getPayamount() { | ||
return payamount; | ||
} | ||
|
||
public void setPayamount(float payamount) { | ||
this.payamount = payamount; | ||
} | ||
|
||
public String getPaydescription() { | ||
return paydescription; | ||
} | ||
|
||
public void setPaydescription(String paydescription) { | ||
this.paydescription = paydescription; | ||
} | ||
|
||
public LocalDate getPaydate() { | ||
return paydate; | ||
} | ||
|
||
public void setPaydate(LocalDate paydate) { | ||
this.paydate = paydate; | ||
} | ||
|
||
public User getUser() { | ||
return user; | ||
} | ||
|
||
public void setUser(User user) { | ||
this.user = user; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Payment [paymentid=" + paymentid + ", payamount=" + payamount + ", paydescription=" + paydescription | ||
+ ", paydate=" + paydate + ", user=" + user + "]"; | ||
} | ||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
package com.nms.bo; | ||
|
||
import java.time.LocalDate; | ||
import java.time.LocalTime; | ||
import java.util.Set; | ||
|
||
import javax.persistence.CascadeType; | ||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.GenerationType; | ||
import javax.persistence.Id; | ||
import javax.persistence.JoinColumn; | ||
import javax.persistence.ManyToOne; | ||
import javax.persistence.OneToMany; | ||
import javax.persistence.Table; | ||
|
||
@Entity | ||
@Table(name="SCREENING") | ||
public class Screening { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.AUTO) | ||
@Column(name = "SCREEN_ID") | ||
protected int screenid; | ||
|
||
protected LocalDate date; | ||
|
||
@Column(name = "SHOW_STARTTIME") | ||
protected LocalTime showstartTime; | ||
|
||
@Column(name="SHOW_ENDTIME") | ||
protected LocalTime showendtime; | ||
|
||
@Column(name="IS_FULL") | ||
protected boolean isfull; | ||
|
||
protected double price; | ||
|
||
@ManyToOne | ||
@JoinColumn(name="MOVIE_ID", nullable = false) | ||
protected Movie movie; | ||
|
||
@OneToMany(mappedBy = "screening", cascade = CascadeType.ALL) | ||
protected Set<TicketBooking> bookings; | ||
|
||
public Screening(int screenid, LocalDate date, LocalTime showstartTime, LocalTime showendtime, boolean isfull, | ||
double price, Movie movie, Set<TicketBooking> bookings) { | ||
super(); | ||
this.screenid = screenid; | ||
this.date = date; | ||
this.showstartTime = showstartTime; | ||
this.showendtime = showendtime; | ||
this.isfull = isfull; | ||
this.price = price; | ||
this.movie = movie; | ||
this.bookings = bookings; | ||
} | ||
|
||
public int getScreenid() { | ||
return screenid; | ||
} | ||
|
||
public void setScreenid(int screenid) { | ||
this.screenid = screenid; | ||
} | ||
|
||
public LocalDate getDate() { | ||
return date; | ||
} | ||
|
||
public void setDate(LocalDate date) { | ||
this.date = date; | ||
} | ||
|
||
public LocalTime getShowstartTime() { | ||
return showstartTime; | ||
} | ||
|
||
public void setShowstartTime(LocalTime showstartTime) { | ||
this.showstartTime = showstartTime; | ||
} | ||
|
||
public LocalTime getShowendtime() { | ||
return showendtime; | ||
} | ||
|
||
public void setShowendtime(LocalTime showendtime) { | ||
this.showendtime = showendtime; | ||
} | ||
|
||
public boolean isIsfull() { | ||
return isfull; | ||
} | ||
|
||
public void setIsfull(boolean isfull) { | ||
this.isfull = isfull; | ||
} | ||
|
||
public double getPrice() { | ||
return price; | ||
} | ||
|
||
public void setPrice(double price) { | ||
this.price = price; | ||
} | ||
|
||
public Movie getMovie() { | ||
return movie; | ||
} | ||
|
||
public void setMovie(Movie movie) { | ||
this.movie = movie; | ||
} | ||
|
||
public Set<TicketBooking> getBookings() { | ||
return bookings; | ||
} | ||
|
||
public void setBookings(Set<TicketBooking> bookings) { | ||
this.bookings = bookings; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Screening [screenid=" + screenid + ", date=" + date + ", showstartTime=" + showstartTime | ||
+ ", showendtime=" + showendtime + ", isfull=" + isfull + ", price=" + price + ", movie=" + movie | ||
+ ", bookings=" + bookings + "]"; | ||
} | ||
|
||
|
||
} |
Oops, something went wrong.