HSAdmin Backend Domains, E-Mail, Datenbanken
Peter Hormanns
2013-05-23 71bd2b5ad33bf6c0f066e45d9691e34b25ffb297
found one more mapping error with migrated database
3 files modified
26 ■■■■■ changed files
hsarback/src/de/hsadmin/mods/pac/Pac.java 6 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/pac/PacComponent.java 18 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/pac/PacModuleImpl.java 2 ●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/pac/Pac.java
@@ -49,7 +49,7 @@
    private String name;
    @JoinColumn(name = "bp_id")
    @ManyToOne(fetch = EAGER)
    @ManyToOne(fetch = LAZY)
    private Customer customer;
    @JoinColumn(name = "basepacket_id")
@@ -79,7 +79,7 @@
    @ManyToOne(fetch = EAGER)
    private INetAddress oldINetAddr;
    @OneToMany(fetch = EAGER, cascade = ALL, mappedBy="pac")
    @OneToMany(fetch = EAGER, cascade = ALL, mappedBy="pac", orphanRemoval=true)
    private Set<PacComponent> pacComponents;
    @OneToMany(fetch = LAZY, cascade = ALL, mappedBy="pac")
@@ -95,7 +95,7 @@
        for (Component comp : basePac.getComponents()) {
            PacComponent pacComp = new PacComponent();
            pacComp.setCreated(today);
            pacComp.setComponent(comp);
            pacComp.setBaseComponent(comp.getBaseComponent());
            pacComp.setPac(this);
            if (setDefaults) {
                pacComp.setQuantity(comp.getDefaultQuantity());
hsarback/src/de/hsadmin/mods/pac/PacComponent.java
@@ -34,7 +34,7 @@
    
    @ManyToOne
    @JoinColumn(name = "basecomponent_id")
    private Component component;
    private BaseComponent baseComponent;
    @Column(name = "quantity", columnDefinition = "integer")
    private int quantity;
@@ -52,7 +52,11 @@
    }
    public BaseComponent getBaseComponent() {
        return getComponent().getBaseComponent();
        return baseComponent;
    }
    public void setBaseComponent(BaseComponent baseComponent) {
        this.baseComponent = baseComponent;
    }
    public Pac getPac() {
@@ -87,17 +91,9 @@
        this.cancelled = cancelled;
    }
    public Component getComponent() {
        return component;
    }
    public void setComponent(Component component) {
        this.component = component;
    }
    @Override
    public String toString() {
        return "pac=" + pac.getName() + ";comp=" + component.getBaseComponent().getFeature() + ";quantity=" + getQuantity();
        return "pac=" + pac.getName() + ";comp=" + getBaseComponent().getFeature() + ";quantity=" + getQuantity();
    }
}
hsarback/src/de/hsadmin/mods/pac/PacModuleImpl.java
@@ -80,7 +80,7 @@
            Component comp = (Component) cObj;
            PacComponent pacComponent = new PacComponent();
            BaseComponent baseComponent = comp.getBaseComponent();
            pacComponent.setComponent(comp);
            pacComponent.setBaseComponent(comp.getBaseComponent());
            pacComponent.setCreated(now);
            pacComponent.setPac(pac);
            String feature = baseComponent.getFeature();