Skip to content

Commit

Permalink
Merge pull request #27 from darshnair/development
Browse files Browse the repository at this point in the history
Entities Added
  • Loading branch information
darshnair authored Aug 8, 2022
2 parents 297efad + 78dfcf0 commit 1a85df1
Show file tree
Hide file tree
Showing 8 changed files with 855 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>
<groupId>com.nms</groupId>
<artifactId>nms</artifactId>
<version>2022.08.06</version>
<version>2022.08.07</version>
<name>nms</name>
<description>nms</description>
<properties>
Expand Down
130 changes: 130 additions & 0 deletions src/main/java/com/nms/bo/Movie.java
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 + "]";
}

}
93 changes: 93 additions & 0 deletions src/main/java/com/nms/bo/Payment.java
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 + "]";
}



}
132 changes: 132 additions & 0 deletions src/main/java/com/nms/bo/Screening.java
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 + "]";
}


}
Loading

0 comments on commit 1a85df1

Please sign in to comment.