HSAdmin Backend Domains, E-Mail, Datenbanken
Peter Hormanns
2012-07-18 7d895c049ed373cbcd9a0b4bb1976d0ac7648021
define JPA CascadeType
2 files modified
6 ■■■■■ changed files
hsarback/src/de/hsadmin/mods/dom/Domain.java 3 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/dom/DomainOption.java 3 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/dom/Domain.java
@@ -6,6 +6,7 @@
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 @@
    @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() {
hsarback/src/de/hsadmin/mods/dom/DomainOption.java
@@ -4,6 +4,7 @@
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityManager;
@@ -34,7 +35,7 @@
    @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")})