Add House to domain

apache_commons_compress
Terekhin Alexander 5 years ago
parent 5ea6934925
commit 5dc67acd5d
  1. 203
      src/main/java/me/bearns/fias/domain/House.java
  2. 403
      src/main/java/me/bearns/fias/domain/Houses.java
  3. 12
      src/main/java/me/bearns/fias/repository/HouseRepository.java

@ -0,0 +1,203 @@
package me.bearns.fias.domain;
import javax.persistence.*;
import javax.xml.bind.annotation.*;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.Objects;
import java.util.UUID;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "")
@Entity
@Table(name = "house")
public class House implements Serializable {
private static final long serialVersionUID = 1L;
private static DatatypeFactory dtf;
static {
try {
dtf = DatatypeFactory.newInstance();
} catch (DatatypeConfigurationException e) {
e.printStackTrace();
}
}
//@Type(type="uuid-char")
@XmlAttribute(name = "HOUSEID", required = true)
@Column(name = "houseid")
@Id
public UUID houseid;
//@Type(type="uuid-char")
@XmlAttribute(name = "AOGUID", required = true)
@Column(name = "aoguid")
public UUID aoguid;
//@Type(type="uuid-char")
@XmlAttribute(name = "HOUSEGUID", required = true)
@Column(name = "houseguid")
public UUID houseguid;
@XmlAttribute(name = "POSTALCODE")
protected String postalcode;
@XmlAttribute(name = "REGIONCODE")
public String regioncode;
@XmlAttribute(name = "IFNSFL")
protected String ifnsfl;
@XmlAttribute(name = "TERRIFNSFL")
protected String terrifnsfl;
@XmlAttribute(name = "IFNSUL")
protected String ifnsul;
@XmlAttribute(name = "TERRIFNSUL")
protected String terrifnsul;
@XmlAttribute(name = "OKATO")
protected String okato;
@XmlAttribute(name = "OKTMO")
protected String oktmo;
@XmlAttribute(name = "UPDATEDATE", required = true)
@XmlSchemaType(name = "date")
protected XMLGregorianCalendar updatedate;
@XmlAttribute(name = "HOUSENUM")
protected String housenum;
@XmlAttribute(name = "ESTSTATUS", required = true)
protected BigInteger eststatus;
@XmlAttribute(name = "BUILDNUM")
protected String buildnum;
@XmlAttribute(name = "STRUCNUM")
protected String strucnum;
@XmlAttribute(name = "STRSTATUS")
protected BigInteger strstatus;
@XmlAttribute(name = "STARTDATE", required = true)
@XmlSchemaType(name = "date")
protected XMLGregorianCalendar startdate;
@XmlAttribute(name = "ENDDATE", required = true)
@XmlSchemaType(name = "date")
protected XMLGregorianCalendar enddate;
@XmlAttribute(name = "STATSTATUS", required = true)
protected BigInteger statstatus;
@XmlAttribute(name = "NORMDOC")
protected String normdoc;
@XmlAttribute(name = "COUNTER", required = true)
protected BigInteger counter;
@XmlAttribute(name = "CADNUM")
protected String cadnum;
@XmlAttribute(name = "DIVTYPE", required = true)
protected int divtype;
// jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
public House aoguid(String aoguid) {
this.aoguid = UUID.fromString(aoguid);
return this;
}
public void setAoguid(UUID aoguid) {
this.aoguid = aoguid;
}
public House houseid(UUID houseid) {
this.houseid = houseid;
return this;
}
@Column(name = "updatedate")
@Access(AccessType.PROPERTY)
public Calendar getUpdatedate() {
return updatedate!=null ? updatedate.toGregorianCalendar() : null;
}
public void setUpdatedate(GregorianCalendar updatedate) {
this.updatedate = dtf.newXMLGregorianCalendar(updatedate);
}
@Column(name = "startdate")
@Access(AccessType.PROPERTY)
public Calendar getStartdate() {
return startdate!=null ? startdate.toGregorianCalendar() : null;
}
public void setStartdate(GregorianCalendar startdate) {
this.startdate = dtf.newXMLGregorianCalendar(startdate);
}
@Column(name = "enddate")
@Access(AccessType.PROPERTY)
public Calendar getEnddate() {
return enddate!=null ? enddate.toGregorianCalendar() : null;
}
public void setEnddate(GregorianCalendar enddate) {
this.enddate = dtf.newXMLGregorianCalendar(enddate);
}
public void setHouseid(UUID houseid) {
this.houseid = houseid;
}
public House houseguid(UUID houseguid) {
this.houseguid = houseguid;
return this;
}
public void setHouseguid(UUID houseguid) {
this.houseguid = houseguid;
}
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
House house = (House) o;
if (divtype != house.divtype) return false;
if (!houseid.equals(house.houseid)) return false;
if (aoguid != null ? !aoguid.equals(house.aoguid) : house.aoguid != null) return false;
if (houseguid != null ? !houseguid.equals(house.houseguid) : house.houseguid != null) return false;
if (postalcode != null ? !postalcode.equals(house.postalcode) : house.postalcode != null) return false;
if (regioncode != null ? !regioncode.equals(house.regioncode) : house.regioncode != null) return false;
if (ifnsfl != null ? !ifnsfl.equals(house.ifnsfl) : house.ifnsfl != null) return false;
if (terrifnsfl != null ? !terrifnsfl.equals(house.terrifnsfl) : house.terrifnsfl != null) return false;
if (ifnsul != null ? !ifnsul.equals(house.ifnsul) : house.ifnsul != null) return false;
if (terrifnsul != null ? !terrifnsul.equals(house.terrifnsul) : house.terrifnsul != null) return false;
if (okato != null ? !okato.equals(house.okato) : house.okato != null) return false;
if (oktmo != null ? !oktmo.equals(house.oktmo) : house.oktmo != null) return false;
if (updatedate != null ? !updatedate.equals(house.updatedate) : house.updatedate != null) return false;
if (housenum != null ? !housenum.equals(house.housenum) : house.housenum != null) return false;
if (eststatus != null ? !eststatus.equals(house.eststatus) : house.eststatus != null) return false;
if (buildnum != null ? !buildnum.equals(house.buildnum) : house.buildnum != null) return false;
if (strucnum != null ? !strucnum.equals(house.strucnum) : house.strucnum != null) return false;
if (strstatus != null ? !strstatus.equals(house.strstatus) : house.strstatus != null) return false;
if (startdate != null ? !startdate.equals(house.startdate) : house.startdate != null) return false;
if (enddate != null ? !enddate.equals(house.enddate) : house.enddate != null) return false;
if (statstatus != null ? !statstatus.equals(house.statstatus) : house.statstatus != null) return false;
if (normdoc != null ? !normdoc.equals(house.normdoc) : house.normdoc != null) return false;
if (counter != null ? !counter.equals(house.counter) : house.counter != null) return false;
return cadnum != null ? cadnum.equals(house.cadnum) : house.cadnum == null;
}
@Override
public int hashCode() {
return Objects.hashCode(houseid);
}
@Override
public String toString() {
return "House{" +
"aoguid='" + (aoguid!=null ? aoguid : "") + "'" +
", houseid='" + (houseid!=null ? houseid : "") + "'" +
", houseguid='" + (houseguid!=null ? houseguid : "") + "'" +
"}";
}
}

@ -0,0 +1,403 @@
package me.bearns.fias.domain;
import javax.xml.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="House" maxOccurs="unbounded">
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;attribute name="POSTALCODE">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;length value="6"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="REGIONCODE">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;length value="2"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="IFNSFL">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;length value="4"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="TERRIFNSFL">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;length value="4"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="IFNSUL">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;length value="4"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="TERRIFNSUL">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;length value="4"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="OKATO">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;length value="11"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="OKTMO">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;minLength value="8"/>
* &lt;maxLength value="11"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="UPDATEDATE" use="required" type="{http://www.w3.org/2001/XMLSchema}date" />
* &lt;attribute name="HOUSENUM">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;minLength value="1"/>
* &lt;maxLength value="20"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="ESTSTATUS" use="required">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}integer">
* &lt;totalDigits value="1"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="BUILDNUM">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;minLength value="0"/>
* &lt;maxLength value="10"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="STRUCNUM">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;minLength value="0"/>
* &lt;maxLength value="10"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="STRSTATUS">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}integer">
* &lt;totalDigits value="10"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="HOUSEID" use="required">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;length value="36"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="HOUSEGUID" use="required">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;length value="36"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="AOGUID" use="required">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;length value="36"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="STARTDATE" use="required" type="{http://www.w3.org/2001/XMLSchema}date" />
* &lt;attribute name="ENDDATE" use="required" type="{http://www.w3.org/2001/XMLSchema}date" />
* &lt;attribute name="STATSTATUS" use="required">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}integer">
* &lt;totalDigits value="10"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="NORMDOC">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;length value="36"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="COUNTER" use="required">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}integer">
* &lt;totalDigits value="10"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="CADNUM">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;minLength value="1"/>
* &lt;maxLength value="100"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="DIVTYPE" use="required">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}int">
* &lt;enumeration value="0"/>
* &lt;enumeration value="1"/>
* &lt;enumeration value="2"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;/element>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"house"
})
@XmlRootElement(name = "Houses")
public class Houses {
@XmlElement(name = "House", required = true)
protected List<House> house;
/**
* Gets the value of the house property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the house property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getHouse().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link House }
*
*
*/
public List<House> getHouse() {
if (house == null) {
house = new ArrayList<House>();
}
return this.house;
}
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;attribute name="POSTALCODE">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;length value="6"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="REGIONCODE">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;length value="2"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="IFNSFL">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;length value="4"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="TERRIFNSFL">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;length value="4"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="IFNSUL">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;length value="4"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="TERRIFNSUL">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;length value="4"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="OKATO">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;length value="11"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="OKTMO">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;minLength value="8"/>
* &lt;maxLength value="11"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="UPDATEDATE" use="required" type="{http://www.w3.org/2001/XMLSchema}date" />
* &lt;attribute name="HOUSENUM">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;minLength value="1"/>
* &lt;maxLength value="20"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="ESTSTATUS" use="required">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}integer">
* &lt;totalDigits value="1"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="BUILDNUM">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;minLength value="0"/>
* &lt;maxLength value="10"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="STRUCNUM">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;minLength value="0"/>
* &lt;maxLength value="10"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="STRSTATUS">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}integer">
* &lt;totalDigits value="10"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="HOUSEID" use="required">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;length value="36"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="HOUSEGUID" use="required">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;length value="36"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="AOGUID" use="required">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;length value="36"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="STARTDATE" use="required" type="{http://www.w3.org/2001/XMLSchema}date" />
* &lt;attribute name="ENDDATE" use="required" type="{http://www.w3.org/2001/XMLSchema}date" />
* &lt;attribute name="STATSTATUS" use="required">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}integer">
* &lt;totalDigits value="10"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="NORMDOC">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;length value="36"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="COUNTER" use="required">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}integer">
* &lt;totalDigits value="10"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="CADNUM">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;minLength value="1"/>
* &lt;maxLength value="100"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;attribute name="DIVTYPE" use="required">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}int">
* &lt;enumeration value="0"/>
* &lt;enumeration value="1"/>
* &lt;enumeration value="2"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/attribute>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
}

@ -0,0 +1,12 @@
package me.bearns.fias.repository;
import me.bearns.fias.domain.House;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.UUID;
@Repository
public interface HouseRepository extends JpaRepository<House, UUID> {
}
Loading…
Cancel
Save