Red Hat Application Migration Toolkit
package com.mpdmal.cloudental.entities;
import com.mpdmal.cloudental.entities.Dentist;
import com.mpdmal.cloudental.entities.base.DBEntity;
import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Column;
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.validation.constraints.NotNull;
@Entity
public class Discount extends DBEntity implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(
strategy = GenerationType.IDENTITY
)
@Column(
unique = true
)
private Integer id;
@Column(
length = 256
)
private String description;
@NotNull
@Column(
length = 80
)
private String title;
@NotNull
@Column(
updatable = false,
precision = 131089
)
private BigDecimal discount;
@NotNull
@ManyToOne(
fetch = FetchType.LAZY
)
@JoinColumn(
name = "dentistid",
insertable = true,
updatable = false
)
private Dentist dentist;
public Integer getId() {
return this.id;
}
public String getTitle() {
return this.title;
}
public BigDecimal getDiscount() {
return this.discount;
}
public String getDescription() {
return this.description;
}
public Dentist getDentist() {
return this.dentist;
}
public void setId(Integer id) {
this.id = id;
}
public void setTitle(String title) {
this.title = title;
}
public void setDiscount(BigDecimal discount) {
this.discount = discount;
}
public void setDescription(String description) {
this.description = description;
}
public void setDentist(Dentist dentist) {
this.dentist = dentist;
}
public String getXML() {
StringBuilder ans = new StringBuilder("<discount></discount>");
ans.insert(ans.indexOf("</discount"), "<title>" + this.title + "</title>");
ans.insert(ans.indexOf("</discount"), "<description>" + this.description + "</description>");
ans.insert(ans.indexOf("</discount"), "<value>" + this.discount + "</value>");
return ans.toString();
}
}