define JPA CascadeType
This commit is contained in:
parent
b1945db130
commit
7d895c049e
@ -6,6 +6,7 @@ import static javax.persistence.GenerationType.SEQUENCE;
|
||||
import java.util.Date;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.EntityManager;
|
||||
@ -67,7 +68,7 @@ public class Domain extends AbstractEntity {
|
||||
@Column(name = "domain_dns_master", columnDefinition = "character varying(64)")
|
||||
private String dnsMaster;
|
||||
|
||||
@ManyToMany(fetch=FetchType.EAGER, mappedBy="domains")
|
||||
@ManyToMany(cascade = CascadeType.ALL, fetch=FetchType.EAGER, mappedBy="domains")
|
||||
private Set<DomainOption> domainOptions;
|
||||
|
||||
public Domain() {
|
||||
|
@ -4,6 +4,7 @@ import static javax.persistence.GenerationType.SEQUENCE;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.EntityManager;
|
||||
@ -34,7 +35,7 @@ public class DomainOption extends AbstractEntity {
|
||||
@Column(name = "domain_option_name", columnDefinition = "character varying(256)", nullable = false)
|
||||
private String name;
|
||||
|
||||
@ManyToMany(fetch=FetchType.LAZY)
|
||||
@ManyToMany(cascade = CascadeType.ALL, fetch=FetchType.LAZY)
|
||||
@JoinTable(name="domain__domain_option",
|
||||
joinColumns={@JoinColumn(name="domain_option_id", referencedColumnName="domain_option_id")},
|
||||
inverseJoinColumns={@JoinColumn(name="domain_id", referencedColumnName="domain_id")})
|
||||
|
Loading…
Reference in New Issue
Block a user