Permalink
Browse files

Add County layer with unit and integration tests

1 parent 9a31318 commit 1ab20173f7b9846d7c046ed9304f9978c42bcc88 @jmarin jmarin committed Oct 25, 2012
@@ -9,7 +9,7 @@
*
*/
public enum CensusGeographyEnum {
- STATE2010("state2010"), COUNTY2010("county2010"), TRACT2010("tract2010"), BLOCK2010(
+ STATE2010("state2010"), COUNTY2010("county2010"), BLOCK2010(
"block2010"), ALL("all");
private String externalGeographyType;
@@ -0,0 +1,57 @@
+package org.geo.spatialsearch.census.model;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Table;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ *
+ * @author Juan Marin
+ *
+ */
+
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "County")
+@XmlRootElement(name = "County")
+@Entity
+@Table(name = "county2010", schema = "census")
+public class County2010 extends CensusGeoBaseObject {
+
+ @Column(name = "STATEFP10")
+ private String statefp10;
+
+ @Column(name = "GEOID10")
+ private String geoid;
+
+ @Column(name = "NAME10")
+ private String name;
+
+ public String getStatefp10() {
+ return statefp10;
+ }
+
+ public void setStatefp10(String statefp10) {
+ this.statefp10 = statefp10;
+ }
+
+ public String getGeoid() {
+ return geoid;
+ }
+
+ public void setGeoid(String geoid) {
+ this.geoid = geoid;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+}
@@ -8,6 +8,7 @@
import javax.xml.bind.annotation.XmlElement;
import org.geo.spatialsearch.census.model.Block2010;
+import org.geo.spatialsearch.census.model.County2010;
import org.geo.spatialsearch.census.model.State2010;
/**
@@ -18,63 +19,49 @@
@XmlAccessorType(XmlAccessType.FIELD)
public class CensusLookupBaseResponse {
- @XmlElement(name = "state")
- private List<State2010> states;
+ @XmlElement(name = "state")
+ private List<State2010> states;
- // @XmlElement(name = "county")
- // private List<County2000> counties;
- //
- // @XmlElement(name = "censusTract")
- // private List<Tract2000> tracts;
- //
- @XmlElement(name = "block")
- private List<Block2010> blocks;
+ @XmlElement(name = "county")
+ private List<County2010> counties;
- public CensusLookupBaseResponse() {
- }
+ @XmlElement(name = "block")
+ private List<Block2010> blocks;
- public List<State2010> getStates() {
- if (states == null) {
- states = new ArrayList<State2010>();
- }
- return states;
- }
+ public CensusLookupBaseResponse() {
+ }
- public void setStates(List<State2010> states) {
- this.states = states;
- }
+ public List<State2010> getStates() {
+ if (states == null) {
+ states = new ArrayList<State2010>();
+ }
+ return states;
+ }
- // public List<County2000> getCounties() {
- // if (counties == null) {
- // counties = new ArrayList<County2000>();
- // }
- // return counties;
- // }
- //
- // public void setCounties(List<County2000> counties) {
- // this.counties = counties;
- // }
- //
- // public List<Tract2000> getTracts() {
- // if (tracts == null) {
- // tracts = new ArrayList<Tract2000>();
- // }
- // return tracts;
- // }
- //
- // public void setTracts(List<Tract2000> tracts) {
- // this.tracts = tracts;
- // }
- //
- public List<Block2010> getBlocks() {
- if (blocks == null) {
- blocks = new ArrayList<Block2010>();
- }
- return blocks;
- }
+ public void setStates(List<State2010> states) {
+ this.states = states;
+ }
- public void setBlocks(List<Block2010> blocks) {
- this.blocks = blocks;
- }
+ public List<County2010> getCounties() {
+ if (counties == null) {
+ counties = new ArrayList<County2010>();
+ }
+ return counties;
+ }
+
+ public void setCounties(List<County2010> counties) {
+ this.counties = counties;
+ }
+
+ public List<Block2010> getBlocks() {
+ if (blocks == null) {
+ blocks = new ArrayList<Block2010>();
+ }
+ return blocks;
+ }
+
+ public void setBlocks(List<Block2010> blocks) {
+ this.blocks = blocks;
+ }
}
Oops, something went wrong.

0 comments on commit 1ab2017

Please sign in to comment.