Permalink
Browse files

Fix block query

  • Loading branch information...
1 parent 13f2742 commit 26b92786ee9f2c1bb655d00544c97f0b6d72adcc @jmarin jmarin committed Oct 19, 2012
@@ -86,31 +86,35 @@ public CensusLookupResponse findByCoordinates(
return apiResponse;
}
+ @Transactional(readOnly = true)
private void findAllByPoint(CensusLookupResponse apiResponse, Point point) {
// TODO Auto-generated method stub
}
+ @Transactional(readOnly = true)
private void findBlockByPoint(CensusLookupResponse apiResponse, Point point) {
- final Criteria stateCriteria = block2010DAO.createCriteria();
- stateCriteria.add(SpatialRestrictions.contains("geometry", point));
- Block2010 block = block2010DAO.findByCriteria(stateCriteria);
+ final Criteria blockCriteria = block2010DAO.createCriteria();
+ blockCriteria.add(SpatialRestrictions.contains("geometry", point));
+ Block2010 block = block2010DAO.findByCriteria(blockCriteria);
if (block != null) {
block.setEnvelope(new Envelope(block.getGeometry()
.getEnvelopeInternal()));
apiResponse.getCensusLookupBaseResponse().getBlocks().add(block);
}
ValidationUtil.isEmptyResult(apiResponse, apiResponse
.getCensusLookupBaseResponse().getStates(),
- Message.NO_STATE_RESULTS_FOUND, null);
+ Message.NO_BLOCK_RESULTS_FOUND, null);
}
+ @Transactional(readOnly = true)
private void findTractByPoint(CensusLookupResponse apiResponse, Point point) {
// TODO Auto-generated method stub
}
+ @Transactional(readOnly = true)
private void findCountyByPoint(CensusLookupResponse apiResponse, Point point) {
// TODO Auto-generated method stub
@@ -2,17 +2,20 @@
public enum Message {
- GEOGRAPHY_TYPE_NOT_VALID("Malformed URL: Geography Type not valid"), NO_STATE_RESULTS_FOUND(
- "No State results found"), NO_RESULTS_FOUND("No results found");
+ GEOGRAPHY_TYPE_NOT_VALID("Malformed URL: Geography Type not valid"), NO_STATE_RESULTS_FOUND(
+ "No tate results found"), NO_COUNTY_RESULTS_FOUND(
+ "No county results found"), NO_TRACT_RESULTS_FOUND(
+ "No tract results found"), NO_BLOCK_RESULTS_FOUND(
+ "No block results found"), NO_RESULTS_FOUND("No results found");
- private String message;
+ private String message;
- private Message(String message) {
- this.message = message;
- }
+ private Message(String message) {
+ this.message = message;
+ }
- public String getMessage() {
- return message;
- }
+ public String getMessage() {
+ return message;
+ }
}
@@ -50,6 +50,7 @@
<property name="annotatedClasses">
<list>
<value>org.geo.spatialsearch.census.model.State2010</value>
+ <value>org.geo.spatialsearch.census.model.Block2010</value>
</list>
</property>
</bean>

0 comments on commit 26b9278

Please sign in to comment.