Přidána bázová třída pro požadavky. Třída LimitVM přesunuta do package
info.bukova.isspst.ui.requirement. Změněno načítání ownedBy a modifiedBy ve Workgroup na lazy. refs #100multitenant
parent
51a0de2d53
commit
6716842df2
@ -0,0 +1,63 @@
|
||||
package info.bukova.isspst.data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.FetchType;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "AUTHITEM")
|
||||
public class AuthItem {
|
||||
|
||||
@Id
|
||||
@Column(name = "ID")
|
||||
@GeneratedValue
|
||||
private int id;
|
||||
@ManyToOne(fetch = FetchType.EAGER)
|
||||
@JoinColumn(name = "ROLE_ID")
|
||||
private Role role;
|
||||
@ManyToOne(fetch = FetchType.EAGER)
|
||||
@JoinColumn(name = "APPROVER_USER_ID")
|
||||
private User approver;
|
||||
@Column(name = "AUTH_DATE")
|
||||
private Date authDate;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Role getRole() {
|
||||
return role;
|
||||
}
|
||||
|
||||
public void setRole(Role role) {
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
public User getApprover() {
|
||||
return approver;
|
||||
}
|
||||
|
||||
public void setApprover(User approver) {
|
||||
this.approver = approver;
|
||||
}
|
||||
|
||||
public Date getAuthDate() {
|
||||
return authDate;
|
||||
}
|
||||
|
||||
public void setAuthDate(Date authDate) {
|
||||
this.authDate = authDate;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,92 @@
|
||||
package info.bukova.isspst.data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.EnumType;
|
||||
import javax.persistence.Enumerated;
|
||||
import javax.persistence.FetchType;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.MappedSuperclass;
|
||||
import javax.persistence.OneToMany;
|
||||
|
||||
import org.hibernate.annotations.LazyCollection;
|
||||
import org.hibernate.annotations.LazyCollectionOption;
|
||||
|
||||
@MappedSuperclass
|
||||
public class RequirementBase extends BaseData {
|
||||
|
||||
@ManyToOne(fetch = FetchType.EAGER)
|
||||
@JoinColumn(name = "TYPE_ID")
|
||||
private RequirementType type;
|
||||
@Column(name = "NUMSER", unique = true)
|
||||
private String numser;
|
||||
@Column(name = "REQ_DATE")
|
||||
private Date reqDate;
|
||||
@ManyToOne(fetch = FetchType.EAGER)
|
||||
@JoinColumn(name = "WORKGROUP_ID")
|
||||
private Workgroup workgroup;
|
||||
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
|
||||
@LazyCollection(LazyCollectionOption.FALSE)
|
||||
private List<AuthItem> authorization;
|
||||
@Column(name = "STATE")
|
||||
@Enumerated(EnumType.ORDINAL)
|
||||
private RequirementState state;
|
||||
|
||||
public RequirementBase() {
|
||||
authorization = new ArrayList<AuthItem>();
|
||||
}
|
||||
|
||||
public RequirementType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(RequirementType type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getNumser() {
|
||||
return numser;
|
||||
}
|
||||
|
||||
public void setNumser(String number) {
|
||||
this.numser = number;
|
||||
}
|
||||
|
||||
public Date getReqDate() {
|
||||
return reqDate;
|
||||
}
|
||||
|
||||
public void setReqDate(Date reqDate) {
|
||||
this.reqDate = reqDate;
|
||||
}
|
||||
|
||||
public Workgroup getWorkgroup() {
|
||||
return workgroup;
|
||||
}
|
||||
|
||||
public void setWorkgroup(Workgroup workgroup) {
|
||||
this.workgroup = workgroup;
|
||||
}
|
||||
|
||||
public List<AuthItem> getAuthorization() {
|
||||
return authorization;
|
||||
}
|
||||
|
||||
public void setAuthorization(List<AuthItem> authorization) {
|
||||
this.authorization = authorization;
|
||||
}
|
||||
|
||||
public RequirementState getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(RequirementState state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package info.bukova.isspst.data;
|
||||
|
||||
public enum RequirementState {
|
||||
|
||||
NEW,
|
||||
PARTIALLY,
|
||||
APPROVED
|
||||
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package info.bukova.isspst.ui.requirements;
|
||||
package info.bukova.isspst.ui.requirement;
|
||||
|
||||
import info.bukova.isspst.data.Workflow;
|
||||
|
Loading…
Reference in New Issue