This repository has been archived on 2020-08-02. You can view files and clone it, but cannot push or open issues or pull requests.
e-commerce/prototype/src/main/java/org/hso/ecommerce/entities/booking/BookingReason.java

43 lines
1000 B
Java

package org.hso.ecommerce.entities.booking;
import org.hso.ecommerce.entities.shop.CustomerOrder;
import org.hso.ecommerce.entities.supplier.SupplierOrder;
import javax.persistence.*;
@Entity
@Table(name = "booking_reasons")
public class BookingReason {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic
public long id;
public boolean isManuel;
public boolean isStartBooking;
public String comment;
@ManyToOne(optional = true)
public CustomerOrder customerOrder;
@OneToOne(optional = true, cascade = CascadeType.ALL)
public CustomerPayment customerPayment;
@ManyToOne(optional = true)
public SupplierOrder supplierOrder;
// Default Constructor is needed for construction by ORM
public BookingReason() {
}
public BookingReason(CustomerOrder order) {
this.customerOrder = order;
}
public BookingReason(CustomerPayment customerPayment) {
this.customerPayment = customerPayment;
}
}