Information

0
Story Points

Technologies

Decompiled Java File
package com.mpdmal.cloudental.entities;

import com.mpdmal.cloudental.entities.Dentist;
import com.mpdmal.cloudental.entities.Patienthistory;
import com.mpdmal.cloudental.entities.Prescriptionrow;
import com.mpdmal.cloudental.entities.base.DBEntity;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
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 = "prescriptions"
)
public class Prescription extends DBEntity implements Serializable {
   private static final long serialVersionUID = 1L;
   @Id
   @GeneratedValue(
      strategy = GenerationType.IDENTITY
   )
   private Integer id;
   private Timestamp created;
   @OneToMany(
      cascade = {CascadeType.ALL},
      mappedBy = "prescription",
      fetch = FetchType.LAZY
   )
   private Collection prescriptionrows;
   @ManyToOne
   @JoinColumn(
      name = "dentistid"
   )
   private Dentist dentist;
   @ManyToOne
   @JoinColumn(
      name = "patienthistid"
   )
   private Patienthistory patienthistory;

   public Integer getId() {
      return this.id;
   }

   public Dentist getDentist() {
      return this.dentist;
   }

   public Timestamp getCreated() {
      return this.created;
   }

   public Collection getPrescriptionrows() {
      return this.prescriptionrows;
   }

   public Patienthistory getPatienthistory() {
      return this.patienthistory;
   }

   public void setId(Integer id) {
      this.id = id;
   }

   public void setCreated(Timestamp created) {
      this.created = created;
   }

   public void setDentist(Dentist dentist) {
      this.dentist = dentist;
   }

   public void setPatienthistory(Patienthistory patienthistory) {
      this.patienthistory = patienthistory;
   }

   public void setPrescriptionrows(Collection prescriptionrows) {
      if(this.prescriptionrows == null) {
         this.prescriptionrows = new ArrayList();
      }

      Iterator var2 = prescriptionrows.iterator();

      while(var2.hasNext()) {
         Prescriptionrow prescriptionrow = (Prescriptionrow)var2.next();
         this.addPrescriptionRow(prescriptionrow);
      }

   }

   public void addPrescriptionRow(Prescriptionrow row) {
      row.setPrescription(this);
      this.prescriptionrows.add(row);
   }

   public String getXML() {
      return null;
   }
}
Page generated: Oct 19, 2017 2:35:22 PM