mapping of basepac corrected

This commit is contained in:
Peter Hormanns 2013-05-02 17:10:45 +02:00
parent 3b61da9c17
commit 1ba497e953

View File

@ -12,8 +12,6 @@ import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
@ -49,14 +47,9 @@ public class BasePac implements Serializable {
@Column(name = "valid", columnDefinition = "boolean")
private boolean valid;
@OneToMany(fetch = FetchType.LAZY, cascade = ALL)
@JoinTable(name = "component", joinColumns = @JoinColumn(name = "basepacket_id"), inverseJoinColumns = @JoinColumn(name = "basecomponent_id"))
@OneToMany(fetch = FetchType.LAZY, cascade=ALL, mappedBy="basePac")
private Set<Component> components;
@OneToMany(fetch = FetchType.LAZY, cascade = ALL)
@JoinTable(name = "packet_component", joinColumns = @JoinColumn(name = "packet_id"), inverseJoinColumns = @JoinColumn(name = "basepacket_id"))
private Set<Pac> pacs;
public long id() {
return basePacId;
}
@ -125,14 +118,6 @@ public class BasePac implements Serializable {
getComponents().remove(comp);
}
public Set<Pac> getPacs() {
return pacs;
}
public void setPacs(Set<Pac> pacs) {
this.pacs = pacs;
}
// generic
public boolean equals(Object aOther) {
if (aOther == null || aOther.getClass() != getClass())