new Entity MemberShare

This commit is contained in:
Peter Hormanns 2017-04-09 13:19:46 +02:00
parent b7e2f0b905
commit fbc5fb03aa
2 changed files with 102 additions and 0 deletions

View File

@ -0,0 +1,94 @@
package de.hsadmin.bo.customer;
import static javax.persistence.FetchType.EAGER;
import java.io.Serializable;
import java.util.Date;
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;
import javax.persistence.Temporal;
@Entity
@Table(name = "member_share")
public class MemberShare implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "member_share_id", columnDefinition = "integer")
private long id;
@JoinColumn(name = "bp_id", columnDefinition = "integer", nullable = false)
@ManyToOne(fetch = EAGER)
private Customer customer;
@Column(name = "date", columnDefinition = "date", nullable = false)
@Temporal(javax.persistence.TemporalType.DATE)
private Date date;
@Column(name="action", nullable = false)
private ShareAction action;
@Column(name="quantity", nullable = false)
private int quantity;
@Column(name="comment", nullable = true)
private String comment;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public Customer getCustomer() {
return customer;
}
public void setCustomer(Customer customer) {
this.customer = customer;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
public ShareAction getAction() {
return action;
}
public void setAction(ShareAction action) {
this.action = action;
}
public int getQuantity() {
return quantity;
}
public void setQuantity(int quantity) {
this.quantity = quantity;
}
public String getComment() {
return comment;
}
public void setComment(String comment) {
this.comment = comment;
}
}

View File

@ -0,0 +1,8 @@
package de.hsadmin.bo.customer;
public enum ShareAction {
SUBSCRIPTION,
UNSUBSCRIPTION
}