Skip to content

Commit 5d70d8d

Browse files
committed
-zipcodes +municipios
1 parent 8b8b785 commit 5d70d8d

26 files changed

+385
-410
lines changed

.classpath

Lines changed: 42 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,49 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<classpath>
3-
<classpathentry including="**/*.java" kind="src" path="src/main/java"/>
4-
<classpathentry excluding="**/*.java" kind="src" path="src/main/resources"/>
5-
<classpathentry kind="var" path="M2_REPO/javax/servlet/jstl/1.2/jstl-1.2.jar"/>
6-
<classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.4-20040521/servlet-api-2.4-20040521.jar"/>
7-
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-core/3.2.8.RELEASE/spring-core-3.2.8.RELEASE.jar"/>
8-
<classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar" sourcepath="M2_REPO/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3-sources.jar">
3+
<classpathentry kind="src" output="target/classes" path="src/main/java">
94
<attributes>
10-
<attribute name="javadoc_location" value="jar:file:/home/fb/.m2/repository/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3-javadoc.jar!/"/>
5+
<attribute name="optional" value="true"/>
6+
<attribute name="maven.pomderived" value="true"/>
7+
</attributes>
8+
</classpathentry>
9+
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
10+
<attributes>
11+
<attribute name="maven.pomderived" value="true"/>
12+
</attributes>
13+
</classpathentry>
14+
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
15+
<attributes>
16+
<attribute name="optional" value="true"/>
17+
<attribute name="maven.pomderived" value="true"/>
18+
<attribute name="test" value="true"/>
19+
</attributes>
20+
</classpathentry>
21+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
22+
<attributes>
23+
<attribute name="maven.pomderived" value="true"/>
24+
</attributes>
25+
</classpathentry>
26+
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
27+
<attributes>
28+
<attribute name="maven.pomderived" value="true"/>
29+
</attributes>
30+
</classpathentry>
31+
<classpathentry kind="src" path="target/generated-sources/annotations">
32+
<attributes>
33+
<attribute name="optional" value="true"/>
34+
<attribute name="maven.pomderived" value="true"/>
35+
<attribute name="ignore_optional_problems" value="true"/>
36+
<attribute name="m2e-apt" value="true"/>
37+
</attributes>
38+
</classpathentry>
39+
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
40+
<attributes>
41+
<attribute name="optional" value="true"/>
42+
<attribute name="maven.pomderived" value="true"/>
43+
<attribute name="ignore_optional_problems" value="true"/>
44+
<attribute name="m2e-apt" value="true"/>
45+
<attribute name="test" value="true"/>
1146
</attributes>
1247
</classpathentry>
13-
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-web/3.2.8.RELEASE/spring-web-3.2.8.RELEASE.jar" sourcepath="M2_REPO/org/springframework/spring-web/3.2.8.RELEASE/spring-web-3.2.8.RELEASE-sources.jar"/>
14-
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-aop/3.2.8.RELEASE/spring-aop-3.2.8.RELEASE.jar"/>
15-
<classpathentry kind="var" path="M2_REPO/aopalliance/aopalliance/1.0/aopalliance-1.0.jar" sourcepath="M2_REPO/aopalliance/aopalliance/1.0/aopalliance-1.0-sources.jar"/>
16-
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-beans/3.2.8.RELEASE/spring-beans-3.2.8.RELEASE.jar"/>
17-
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-context/3.2.8.RELEASE/spring-context-3.2.8.RELEASE.jar"/>
18-
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-expression/3.2.8.RELEASE/spring-expression-3.2.8.RELEASE.jar"/>
19-
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-webmvc/3.2.8.RELEASE/spring-webmvc-3.2.8.RELEASE.jar" sourcepath="M2_REPO/org/springframework/spring-webmvc/3.2.8.RELEASE/spring-webmvc-3.2.8.RELEASE-sources.jar"/>
20-
<classpathentry kind="var" path="M2_REPO/org/mongodb/mongo-java-driver/2.12.3/mongo-java-driver-2.12.3.jar"/>
21-
<classpathentry kind="var" path="M2_REPO/org/springframework/data/spring-data-mongodb/1.5.4.RELEASE/spring-data-mongodb-1.5.4.RELEASE.jar"/>
22-
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-tx/3.2.10.RELEASE/spring-tx-3.2.10.RELEASE.jar"/>
23-
<classpathentry kind="var" path="M2_REPO/org/springframework/data/spring-data-commons/1.8.4.RELEASE/spring-data-commons-1.8.4.RELEASE.jar"/>
24-
<classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.7.7/slf4j-api-1.7.7.jar"/>
25-
<classpathentry kind="var" path="M2_REPO/org/slf4j/jcl-over-slf4j/1.7.7/jcl-over-slf4j-1.7.7.jar"/>
26-
<classpathentry kind="var" path="M2_REPO/cglib/cglib/2.2.2/cglib-2.2.2.jar"/>
27-
<classpathentry kind="var" path="M2_REPO/asm/asm/3.3.1/asm-3.3.1.jar"/>
28-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
2948
<classpathentry kind="output" path="target/classes"/>
3049
</classpath>

.gitignore

100644100755
File mode changed.

.project

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<projectDescription>
3-
<name>java-geospatial-springdata</name>
4-
<comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
5-
<projects/>
6-
<buildSpec>
7-
<buildCommand>
8-
<name>org.eclipse.jdt.core.javabuilder</name>
9-
</buildCommand>
10-
</buildSpec>
11-
<natures>
12-
<nature>org.eclipse.jdt.core.javanature</nature>
13-
</natures>
14-
</projectDescription>
3+
<name>mongodb-java-geospatial-springdata-casadocodigo</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.m2e.core.maven2Builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>org.eclipse.jdt.core.javanature</nature>
21+
<nature>org.eclipse.m2e.core.maven2Nature</nature>
22+
</natures>
23+
</projectDescription>

LICENSE

100644100755
File mode changed.

README.md

100644100755
Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
11
mongodb-java-geospatial-springdata-casadocodigo
2-
====================================
2+
===============================================
33

44
MongoDB com Geospatial + Java com Spring Data + Bootstrap
5-
--------------------------------------------
5+
-----------------------------------------------------------
66

77
* Database.....: *test*
8-
* Collection...: *zipcodes*
8+
* Collection...: *municipios*
99

1010
* Exemplo de documento
1111

1212
```
13-
db.zipcodes.findOne()
14-
13+
db.municipios.findOne()
1514
{
16-
"_id" : ObjectId("544edc295e0a44b1d3da5d2a"),
17-
"city" : "AARON",
18-
"state" : "KY",
15+
"_id" : 3500550.0,
16+
"nome" : "Águas de Santa Bárbara",
17+
"uf" : "SP",
18+
"estado" : "São Paulo",
1919
"loc" : {
20-
"x" : 85.19911399999999,
21-
"y" : 36.812827
22-
}
20+
"x" : -49.2421,
21+
"y" : -22.8812
22+
},
23+
"capital" : "N"
2324
}
2425
```
2526
--------------------------------------------
2627

2728
1. Restaure o banco do diretório DUMP
28-
2. Execute o script sobe-tomcat
29+
2. mvn spring-boot:run
2930
3. Acesse a URL: http://localhost:8080/

dump/test/municipios.bson

665 KB
Binary file not shown.

dump/test/municipios.metadata.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_","ns":"test.municipios"},{"v":{"$numberInt":"2"},"key":{"loc":"2d"},"name":"loc_2d","ns":"test.municipios"}],"uuid":"c0969f634a75400ab4e178791d218897","collectionName":"municipios"}

dump/test/zipcodes.bson

-2.14 MB
Binary file not shown.

dump/test/zipcodes.metadata.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

pom.xml

Lines changed: 29 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,60 @@
11
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
22
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
33
<modelVersion>4.0.0</modelVersion>
4+
<parent>
5+
<groupId>org.springframework.boot</groupId>
6+
<artifactId>spring-boot-starter-parent</artifactId>
7+
<version>2.3.1.RELEASE</version>
8+
<relativePath />
9+
</parent>
10+
411
<groupId>com.boaglio.casadocodigo.mongodb</groupId>
512
<artifactId>java-geospatial-springdata</artifactId>
6-
7-
<packaging>war</packaging>
8-
<version>1.0-SNAPSHOT</version>
9-
<name>ZipCodes com Java + Spring Data</name>
13+
<version>1.2.0</version>
14+
<name>Municipios com Java + Spring Data</name>
1015

1116
<properties>
1217
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
13-
<spring.version>4.3.18.RELEASE</spring.version>
18+
<java.version>1.8</java.version>
1419
</properties>
1520

1621
<dependencies>
17-
18-
<!-- Spring -->
19-
<dependency>
20-
<groupId>org.springframework</groupId>
21-
<artifactId>spring-core</artifactId>
22-
<version>${spring.version}</version>
23-
</dependency>
24-
<dependency>
25-
<groupId>org.springframework</groupId>
26-
<artifactId>spring-web</artifactId>
27-
<version>${spring.version}</version>
28-
</dependency>
2922
<dependency>
30-
<groupId>org.springframework</groupId>
31-
<artifactId>spring-webmvc</artifactId>
32-
<version>${spring.version}</version>
23+
<groupId>org.springframework.boot</groupId>
24+
<artifactId>spring-boot-starter-data-mongodb</artifactId>
3325
</dependency>
3426
<dependency>
35-
<groupId>org.springframework</groupId>
36-
<artifactId>spring-context</artifactId>
37-
<version>${spring.version}</version>
27+
<groupId>org.springframework.boot</groupId>
28+
<artifactId>spring-boot-starter-web</artifactId>
3829
</dependency>
39-
40-
<!-- MongoDB Java driver -->
4130
<dependency>
42-
<groupId>org.mongodb</groupId>
43-
<artifactId>mongo-java-driver</artifactId>
44-
<version>3.3.0</version>
31+
<groupId>jstl</groupId>
32+
<artifactId>jstl</artifactId>
33+
<version>1.2</version>
4534
</dependency>
46-
47-
<!-- Spring Data MongoDB -->
4835
<dependency>
49-
<groupId>org.springframework.data</groupId>
50-
<artifactId>spring-data-mongodb</artifactId>
51-
<version>1.9.2.RELEASE</version>
36+
<groupId>org.springframework.boot</groupId>
37+
<artifactId>spring-boot-starter-tomcat</artifactId>
38+
<scope>provided</scope>
5239
</dependency>
53-
54-
<!-- Servlet -->
5540
<dependency>
56-
<groupId>javax.servlet</groupId>
57-
<artifactId>jstl</artifactId>
58-
<version>1.2</version>
41+
<groupId>org.apache.tomcat.embed</groupId>
42+
<artifactId>tomcat-embed-jasper</artifactId>
43+
<scope>provided</scope>
5944
</dependency>
6045
<dependency>
61-
<groupId>javax.servlet</groupId>
62-
<artifactId>javax.servlet-api</artifactId>
63-
<version>3.0.1</version>
64-
<scope>provided</scope>
46+
<groupId>org.springframework.boot</groupId>
47+
<artifactId>spring-boot-devtools</artifactId>
48+
<scope>runtime</scope>
49+
<optional>true</optional>
6550
</dependency>
66-
6751
</dependencies>
6852

6953
<build>
70-
<finalName>zipcodes</finalName>
7154
<plugins>
7255
<plugin>
73-
<artifactId>maven-compiler-plugin</artifactId>
74-
<version>3.1</version>
75-
<configuration>
76-
<source>1.7</source>
77-
<target>1.7</target>
78-
</configuration>
79-
</plugin>
80-
<plugin>
81-
<groupId>org.apache.tomcat.maven</groupId>
82-
<artifactId>tomcat7-maven-plugin</artifactId>
83-
<version>2.2</version>
84-
<configuration>
85-
<httpPort>8080</httpPort>
86-
<path>/</path>
87-
</configuration>
56+
<groupId>org.springframework.boot</groupId>
57+
<artifactId>spring-boot-maven-plugin</artifactId>
8858
</plugin>
8959
</plugins>
9060
</build>

0 commit comments

Comments
 (0)