view flys-backend/src/main/java/de/intevation/seddb/model/StationgewId.java @ 5779:ebec12def170

Datacage: Add a pool of builders to make it multi threadable. XML DOM is not thread safe. Therefore the old implementation only allowed one thread to use the builder at a time. As the complexity of the configuration has increased over time this has become a bottleneck of the whole application because it took quiet some time to build a result. Furthermore the builder code path is visited very frequent. So many concurrent requests were piled up resulting in long waits for the users. To mitigate this problem a round robin pool of builders is used now. Each of the pooled builders has an independent copy of the XML template and can be run in parallel. The number of builders is determined by the system property 'flys.datacage.pool.size'. It defaults to 4.
author Sascha L. Teichmann <teichmann@intevation.de>
date Sun, 21 Apr 2013 12:48:09 +0200
parents 2ae732e2c65c
children 18619c1e7c2a
line wrap: on
line source
package de.intevation.seddb.model;
// Generated 14.06.2012 11:30:57 by Hibernate Tools 3.4.0.CR1


import java.math.BigDecimal;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * StationgewId generated by hbm2java
 */
@Embeddable
public class StationgewId  implements java.io.Serializable {


     private long stationid;
     private long gewaesserid;
     private BigDecimal km;
     private Long bezugspegelid;
     private String name;
     private boolean uferistlinks;
     private BigDecimal teilVon;
     private BigDecimal teilBis;
     private BigDecimal abstHmst;
     private BigDecimal LHochwert;
     private BigDecimal LRechwert;
     private BigDecimal LNn;
     private BigDecimal RHochwert;
     private BigDecimal RRechwert;
     private BigDecimal RNn;
     private String bemerkung;
     private Long oldmstid;
     private boolean istfeststoff;
     private String gewname;

    public StationgewId() {
    }

    public StationgewId(long stationid, long gewaesserid, BigDecimal km, String name, boolean uferistlinks, boolean istfeststoff, String gewname) {
        this.stationid = stationid;
        this.gewaesserid = gewaesserid;
        this.km = km;
        this.name = name;
        this.uferistlinks = uferistlinks;
        this.istfeststoff = istfeststoff;
        this.gewname = gewname;
    }
    public StationgewId(long stationid, long gewaesserid, BigDecimal km, Long bezugspegelid, String name, boolean uferistlinks, BigDecimal teilVon, BigDecimal teilBis, BigDecimal abstHmst, BigDecimal LHochwert, BigDecimal LRechwert, BigDecimal LNn, BigDecimal RHochwert, BigDecimal RRechwert, BigDecimal RNn, String bemerkung, Long oldmstid, boolean istfeststoff, String gewname) {
       this.stationid = stationid;
       this.gewaesserid = gewaesserid;
       this.km = km;
       this.bezugspegelid = bezugspegelid;
       this.name = name;
       this.uferistlinks = uferistlinks;
       this.teilVon = teilVon;
       this.teilBis = teilBis;
       this.abstHmst = abstHmst;
       this.LHochwert = LHochwert;
       this.LRechwert = LRechwert;
       this.LNn = LNn;
       this.RHochwert = RHochwert;
       this.RRechwert = RRechwert;
       this.RNn = RNn;
       this.bemerkung = bemerkung;
       this.oldmstid = oldmstid;
       this.istfeststoff = istfeststoff;
       this.gewname = gewname;
    }



    @Column(name="STATIONID", nullable=false, precision=11, scale=0)
    public long getStationid() {
        return this.stationid;
    }

    public void setStationid(long stationid) {
        this.stationid = stationid;
    }


    @Column(name="GEWAESSERID", nullable=false, precision=11, scale=0)
    public long getGewaesserid() {
        return this.gewaesserid;
    }

    public void setGewaesserid(long gewaesserid) {
        this.gewaesserid = gewaesserid;
    }


    @Column(name="KM", nullable=false, precision=8, scale=3)
    public BigDecimal getKm() {
        return this.km;
    }

    public void setKm(BigDecimal km) {
        this.km = km;
    }


    @Column(name="BEZUGSPEGELID", precision=11, scale=0)
    public Long getBezugspegelid() {
        return this.bezugspegelid;
    }

    public void setBezugspegelid(Long bezugspegelid) {
        this.bezugspegelid = bezugspegelid;
    }


    @Column(name="NAME", nullable=false, length=50)
    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }


    @Column(name="UFERISTLINKS", nullable=false, precision=1, scale=0)
    public boolean isUferistlinks() {
        return this.uferistlinks;
    }

    public void setUferistlinks(boolean uferistlinks) {
        this.uferistlinks = uferistlinks;
    }


    @Column(name="TEIL_VON", precision=8, scale=3)
    public BigDecimal getTeilVon() {
        return this.teilVon;
    }

    public void setTeilVon(BigDecimal teilVon) {
        this.teilVon = teilVon;
    }


    @Column(name="TEIL_BIS", precision=8, scale=3)
    public BigDecimal getTeilBis() {
        return this.teilBis;
    }

    public void setTeilBis(BigDecimal teilBis) {
        this.teilBis = teilBis;
    }


    @Column(name="ABST_HMST", precision=8, scale=3)
    public BigDecimal getAbstHmst() {
        return this.abstHmst;
    }

    public void setAbstHmst(BigDecimal abstHmst) {
        this.abstHmst = abstHmst;
    }


    @Column(name="L_HOCHWERT", precision=11, scale=3)
    public BigDecimal getLHochwert() {
        return this.LHochwert;
    }

    public void setLHochwert(BigDecimal LHochwert) {
        this.LHochwert = LHochwert;
    }


    @Column(name="L_RECHWERT", precision=11, scale=3)
    public BigDecimal getLRechwert() {
        return this.LRechwert;
    }

    public void setLRechwert(BigDecimal LRechwert) {
        this.LRechwert = LRechwert;
    }


    @Column(name="L_NN", precision=8, scale=3)
    public BigDecimal getLNn() {
        return this.LNn;
    }

    public void setLNn(BigDecimal LNn) {
        this.LNn = LNn;
    }


    @Column(name="R_HOCHWERT", precision=11, scale=3)
    public BigDecimal getRHochwert() {
        return this.RHochwert;
    }

    public void setRHochwert(BigDecimal RHochwert) {
        this.RHochwert = RHochwert;
    }


    @Column(name="R_RECHWERT", precision=11, scale=3)
    public BigDecimal getRRechwert() {
        return this.RRechwert;
    }

    public void setRRechwert(BigDecimal RRechwert) {
        this.RRechwert = RRechwert;
    }


    @Column(name="R_NN", precision=8, scale=3)
    public BigDecimal getRNn() {
        return this.RNn;
    }

    public void setRNn(BigDecimal RNn) {
        this.RNn = RNn;
    }


    @Column(name="BEMERKUNG", length=240)
    public String getBemerkung() {
        return this.bemerkung;
    }

    public void setBemerkung(String bemerkung) {
        this.bemerkung = bemerkung;
    }


    @Column(name="OLDMSTID", precision=11, scale=0)
    public Long getOldmstid() {
        return this.oldmstid;
    }

    public void setOldmstid(Long oldmstid) {
        this.oldmstid = oldmstid;
    }


    @Column(name="ISTFESTSTOFF", nullable=false, precision=1, scale=0)
    public boolean isIstfeststoff() {
        return this.istfeststoff;
    }

    public void setIstfeststoff(boolean istfeststoff) {
        this.istfeststoff = istfeststoff;
    }


    @Column(name="GEWNAME", nullable=false, length=20)
    public String getGewname() {
        return this.gewname;
    }

    public void setGewname(String gewname) {
        this.gewname = gewname;
    }


   public boolean equals(Object other) {
         if ( (this == other ) ) return true;
         if ( (other == null ) ) return false;
         if ( !(other instanceof StationgewId) ) return false;
         StationgewId castOther = ( StationgewId ) other;

         return (this.getStationid()==castOther.getStationid())
 && (this.getGewaesserid()==castOther.getGewaesserid())
 && ( (this.getKm()==castOther.getKm()) || ( this.getKm()!=null && castOther.getKm()!=null && this.getKm().equals(castOther.getKm()) ) )
 && ( (this.getBezugspegelid()==castOther.getBezugspegelid()) || ( this.getBezugspegelid()!=null && castOther.getBezugspegelid()!=null && this.getBezugspegelid().equals(castOther.getBezugspegelid()) ) )
 && ( (this.getName()==castOther.getName()) || ( this.getName()!=null && castOther.getName()!=null && this.getName().equals(castOther.getName()) ) )
 && (this.isUferistlinks()==castOther.isUferistlinks())
 && ( (this.getTeilVon()==castOther.getTeilVon()) || ( this.getTeilVon()!=null && castOther.getTeilVon()!=null && this.getTeilVon().equals(castOther.getTeilVon()) ) )
 && ( (this.getTeilBis()==castOther.getTeilBis()) || ( this.getTeilBis()!=null && castOther.getTeilBis()!=null && this.getTeilBis().equals(castOther.getTeilBis()) ) )
 && ( (this.getAbstHmst()==castOther.getAbstHmst()) || ( this.getAbstHmst()!=null && castOther.getAbstHmst()!=null && this.getAbstHmst().equals(castOther.getAbstHmst()) ) )
 && ( (this.getLHochwert()==castOther.getLHochwert()) || ( this.getLHochwert()!=null && castOther.getLHochwert()!=null && this.getLHochwert().equals(castOther.getLHochwert()) ) )
 && ( (this.getLRechwert()==castOther.getLRechwert()) || ( this.getLRechwert()!=null && castOther.getLRechwert()!=null && this.getLRechwert().equals(castOther.getLRechwert()) ) )
 && ( (this.getLNn()==castOther.getLNn()) || ( this.getLNn()!=null && castOther.getLNn()!=null && this.getLNn().equals(castOther.getLNn()) ) )
 && ( (this.getRHochwert()==castOther.getRHochwert()) || ( this.getRHochwert()!=null && castOther.getRHochwert()!=null && this.getRHochwert().equals(castOther.getRHochwert()) ) )
 && ( (this.getRRechwert()==castOther.getRRechwert()) || ( this.getRRechwert()!=null && castOther.getRRechwert()!=null && this.getRRechwert().equals(castOther.getRRechwert()) ) )
 && ( (this.getRNn()==castOther.getRNn()) || ( this.getRNn()!=null && castOther.getRNn()!=null && this.getRNn().equals(castOther.getRNn()) ) )
 && ( (this.getBemerkung()==castOther.getBemerkung()) || ( this.getBemerkung()!=null && castOther.getBemerkung()!=null && this.getBemerkung().equals(castOther.getBemerkung()) ) )
 && ( (this.getOldmstid()==castOther.getOldmstid()) || ( this.getOldmstid()!=null && castOther.getOldmstid()!=null && this.getOldmstid().equals(castOther.getOldmstid()) ) )
 && (this.isIstfeststoff()==castOther.isIstfeststoff())
 && ( (this.getGewname()==castOther.getGewname()) || ( this.getGewname()!=null && castOther.getGewname()!=null && this.getGewname().equals(castOther.getGewname()) ) );
   }

   public int hashCode() {
         int result = 17;

         result = 37 * result + (int) this.getStationid();
         result = 37 * result + (int) this.getGewaesserid();
         result = 37 * result + ( getKm() == null ? 0 : this.getKm().hashCode() );
         result = 37 * result + ( getBezugspegelid() == null ? 0 : this.getBezugspegelid().hashCode() );
         result = 37 * result + ( getName() == null ? 0 : this.getName().hashCode() );
         result = 37 * result + (this.isUferistlinks()?1:0);
         result = 37 * result + ( getTeilVon() == null ? 0 : this.getTeilVon().hashCode() );
         result = 37 * result + ( getTeilBis() == null ? 0 : this.getTeilBis().hashCode() );
         result = 37 * result + ( getAbstHmst() == null ? 0 : this.getAbstHmst().hashCode() );
         result = 37 * result + ( getLHochwert() == null ? 0 : this.getLHochwert().hashCode() );
         result = 37 * result + ( getLRechwert() == null ? 0 : this.getLRechwert().hashCode() );
         result = 37 * result + ( getLNn() == null ? 0 : this.getLNn().hashCode() );
         result = 37 * result + ( getRHochwert() == null ? 0 : this.getRHochwert().hashCode() );
         result = 37 * result + ( getRRechwert() == null ? 0 : this.getRRechwert().hashCode() );
         result = 37 * result + ( getRNn() == null ? 0 : this.getRNn().hashCode() );
         result = 37 * result + ( getBemerkung() == null ? 0 : this.getBemerkung().hashCode() );
         result = 37 * result + ( getOldmstid() == null ? 0 : this.getOldmstid().hashCode() );
         result = 37 * result + (this.isIstfeststoff()?1:0);
         result = 37 * result + ( getGewname() == null ? 0 : this.getGewname().hashCode() );
         return result;
   }
}

http://dive4elements.wald.intevation.org