HSAdmin Backend Domains, E-Mail, Datenbanken
peter
2013-04-30 14645dc911e6f296bb00b6cb62af3c35a50060a6
clean or mapping
2 files modified
54 ■■■■ changed files
hsarback/src/de/hsadmin/mods/pac/Component.java 26 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/pac/ComponentId.java 28 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/pac/Component.java
@@ -18,17 +18,11 @@
    private static final long serialVersionUID = 970709621200712794L;
    @Id
    @Column(name="basepacket_id", insertable=false, updatable=false)
    private long basePacId;
    @Id
    @Column(name="basecomponent_id", insertable=false, updatable=false)
    private long baseComponentId;
    @ManyToOne
    @JoinColumn(name="basepacket_id")
    private BasePac basePac;
    
    @Id
    @ManyToOne
    @JoinColumn(name="basecomponent_id")
    private BaseComponent baseComponent;
@@ -62,7 +56,6 @@
    }
    public void setBasePac(BasePac basePac) {
        this.setBasePacId(basePac.id());
        this.basePac = basePac;
    }
@@ -71,7 +64,6 @@
    }
    public void setBaseComponent(BaseComponent baseComponent) {
        this.setBaseComponentId(baseComponent.id());
        this.baseComponent = baseComponent;
    }
@@ -121,22 +113,6 @@
    public void setAdminOnly(boolean adminOnly) {
        this.adminOnly = adminOnly;
    }
    public void setBasePacId(long basePacId) {
        this.basePacId = basePacId;
    }
    public long getBasePacId() {
        return basePacId;
    }
    public void setBaseComponentId(long baseComponentId) {
        this.baseComponentId = baseComponentId;
    }
    public long getBaseComponentId() {
        return baseComponentId;
    }
    public int getArticleNumber() {
hsarback/src/de/hsadmin/mods/pac/ComponentId.java
@@ -7,45 +7,45 @@
    private static final long serialVersionUID = 6213446997257985587L;
    private long basePacId;
    private long baseComponentId;
    private long basePac;
    private long baseComponent;
    public ComponentId() {
    }
    
    public ComponentId(long basePacId, long baseComponentId) {
        this.setBasePacId(basePacId);
        this.setBaseComponentId(baseComponentId);
        this.setBasePac(basePacId);
        this.setBaseComponent(baseComponentId);
    }
    
    @Override
    public boolean equals(Object obj) {
        if (obj != null && obj instanceof ComponentId) {
            ComponentId other = (ComponentId) obj;
            return getBasePacId() == other.getBasePacId() && getBaseComponentId() == other.getBaseComponentId();
            return getBasePac() == other.getBasePac() && getBaseComponent() == other.getBaseComponent();
        }
        return false;
    }
    
    @Override
    public int hashCode() {
        return (new Long(getBasePacId() ^ getBaseComponentId() % Integer.MAX_VALUE)).intValue();
        return (new Long(getBasePac() ^ getBaseComponent() % Integer.MAX_VALUE)).intValue();
    }
    public void setBasePacId(long basePacId) {
        this.basePacId = basePacId;
    public void setBasePac(long basePacId) {
        this.basePac = basePacId;
    }
    public long getBasePacId() {
        return basePacId;
    public long getBasePac() {
        return basePac;
    }
    public void setBaseComponentId(long baseComponentId) {
        this.baseComponentId = baseComponentId;
    public void setBaseComponent(long baseComponentId) {
        this.baseComponent = baseComponentId;
    }
    public long getBaseComponentId() {
        return baseComponentId;
    public long getBaseComponent() {
        return baseComponent;
    }
}