Information

0
Story Points

Technologies

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

import com.mpdmal.cloudental.entities.Patient;
import com.mpdmal.cloudental.entities.PatienttoothPK;
import com.mpdmal.cloudental.entities.Tooth;
import com.mpdmal.cloudental.entities.base.DBEntity;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

@Entity
public class Patienttooth extends DBEntity implements Serializable {
   private static final long serialVersionUID = 1L;
   @EmbeddedId
   private PatienttoothPK id;
   private String comments;
   @Basic(
      fetch = FetchType.LAZY,
      optional = false
   )
   private byte[] image;
   @ManyToOne
   @JoinColumn(
      name = "patientid",
      insertable = false,
      updatable = false
   )
   private Patient patient;
   @ManyToOne
   @JoinColumn(
      name = "toothid",
      insertable = false,
      updatable = false
   )
   private Tooth tooth;

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

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

   public String getComments() {
      return this.comments;
   }

   public void setComments(String comments) {
      this.comments = comments;
   }

   public byte[] getImage() {
      return this.image;
   }

   public void setImage(byte[] image) {
      this.image = image;
   }

   public Patient getPatient() {
      return this.patient;
   }

   public void setPatient(Patient patient) {
      this.patient = patient;
   }

   public Tooth getTooth() {
      return this.tooth;
   }

   public void setTooth(Tooth tooth) {
      this.tooth = tooth;
   }

   public String getXML() {
      StringBuilder ans = new StringBuilder("<tooth></tooth>");
      ans.insert(ans.indexOf("</tooth"), "<position>" + this.tooth.getPosition() + "</position>");
      ans.insert(ans.indexOf("</tooth"), "<name>" + this.tooth.getName() + "</name>");
      ans.insert(ans.indexOf("</tooth"), "<comments>" + this.comments + "</comments>");
      return ans.toString();
   }
}
Page generated: Oct 19, 2017 2:34:23 PM