Skip to content

Commit 545d957

Browse files
committed
Polishing.
Reformat code. Refine dependencies. See #650 Original pull request: #663
1 parent 244f971 commit 545d957

File tree

12 files changed

+325
-334
lines changed

12 files changed

+325
-334
lines changed

couchbase/pom.xml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
1+
<project xmlns="http://maven.apache.org/POM/4.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
34
<modelVersion>4.0.0</modelVersion>
45

56
<artifactId>spring-data-couchbase-examples</artifactId>
@@ -24,9 +25,9 @@
2425

2526
<dependencies>
2627

27-
<dependency>
28-
<groupId>org.springframework.data</groupId>
29-
<artifactId>spring-data-couchbase</artifactId>
28+
<dependency>
29+
<groupId>org.springframework.boot</groupId>
30+
<artifactId>spring-boot-starter-data-couchbase</artifactId>
3031
</dependency>
3132

3233
</dependencies>

couchbase/reactive/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@
1313

1414
<dependencies>
1515

16-
<dependency>
17-
<groupId>org.springframework.boot</groupId>
18-
<artifactId>spring-boot-starter-data-couchbase-reactive</artifactId>
19-
</dependency>
20-
2116
<dependency>
2217
<groupId>io.projectreactor</groupId>
2318
<artifactId>reactor-core</artifactId>

couchbase/transactions/pom.xml

Lines changed: 38 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,42 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
34
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4-
<modelVersion>4.0.0</modelVersion>
5-
6-
<artifactId>spring-data-couchbase-transactions</artifactId>
7-
<name>Spring Data Couchbase - Transaction example</name>
8-
<description>Transactions Demo project for Spring Data Couchbase</description>
9-
10-
<parent>
11-
<groupId>org.springframework.data.examples</groupId>
12-
<artifactId>spring-data-couchbase-examples</artifactId>
13-
<version>2.0.0.BUILD-SNAPSHOT</version>
14-
</parent>
15-
16-
<dependencies>
17-
<dependency>
18-
<groupId>org.springframework.boot</groupId>
19-
<artifactId>spring-boot-starter-data-couchbase</artifactId>
20-
</dependency>
21-
22-
<dependency>
23-
<groupId>org.springframework.boot</groupId>
24-
<artifactId>spring-boot-starter-test</artifactId>
25-
<scope>test</scope>
26-
</dependency>
27-
28-
<dependency>
29-
<groupId>${project.groupId}</groupId>
30-
<artifactId>spring-data-couchbase-example-utils</artifactId>
31-
<version>${project.version}</version>
32-
<scope>test</scope>
33-
</dependency>
34-
<dependency>
35-
<groupId>org.springframework.data.examples</groupId>
36-
<artifactId>spring-data-couchbase-example-utils</artifactId>
37-
<version>2.0.0.BUILD-SNAPSHOT</version>
38-
<scope>test</scope>
39-
</dependency>
40-
41-
</dependencies>
42-
43-
<build>
44-
<plugins>
45-
<plugin>
46-
<groupId>org.springframework.boot</groupId>
47-
<artifactId>spring-boot-maven-plugin</artifactId>
48-
</plugin>
49-
</plugins>
50-
</build>
51-
52-
<repositories>
53-
<repository>
54-
<id>spring-libs-snapshot</id>
55-
<url>https://repo.spring.io/libs-snapshot</url>
56-
</repository>
57-
<repository>
58-
<id>sonatype-snapshot</id>
59-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
60-
<snapshots>
61-
<enabled>true</enabled>
62-
</snapshots>
63-
<releases>
64-
<enabled>false</enabled>
65-
</releases>
66-
</repository>
67-
</repositories>
68-
69-
<pluginRepositories>
70-
<pluginRepository>
71-
<id>spring-snapshots</id>
72-
<url>https://repo.spring.io/snapshot</url>
73-
</pluginRepository>
74-
<pluginRepository>
75-
<id>spring-milestones</id>
76-
<url>https://repo.spring.io/milestone</url>
77-
</pluginRepository>
78-
</pluginRepositories>
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<artifactId>spring-data-couchbase-transactions</artifactId>
8+
<name>Spring Data Couchbase - Transaction example</name>
9+
<description>Transactions Demo project for Spring Data Couchbase</description>
10+
11+
<parent>
12+
<groupId>org.springframework.data.examples</groupId>
13+
<artifactId>spring-data-couchbase-examples</artifactId>
14+
<version>2.0.0.BUILD-SNAPSHOT</version>
15+
</parent>
16+
17+
<dependencies>
18+
19+
<dependency>
20+
<groupId>${project.groupId}</groupId>
21+
<artifactId>spring-data-couchbase-example-utils</artifactId>
22+
<version>${project.version}</version>
23+
</dependency>
24+
25+
<dependency>
26+
<groupId>junit</groupId>
27+
<artifactId>junit</artifactId>
28+
<scope>compile</scope>
29+
</dependency>
30+
31+
</dependencies>
32+
33+
<build>
34+
<plugins>
35+
<plugin>
36+
<groupId>org.springframework.boot</groupId>
37+
<artifactId>spring-boot-maven-plugin</artifactId>
38+
</plugin>
39+
</plugins>
40+
</build>
7941

8042
</project>

couchbase/transactions/src/main/java/com/example/demo/AirlineGates.java

Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
package com.example.demo;
1717

1818
import org.springframework.data.annotation.Id;
19-
import org.springframework.data.annotation.PersistenceConstructor;
2019
import org.springframework.data.annotation.Version;
2120
import org.springframework.data.couchbase.core.index.QueryIndexed;
2221
import org.springframework.data.couchbase.core.mapping.Document;
@@ -26,37 +25,40 @@
2625
*/
2726
@Document
2827
public class AirlineGates {
29-
@Id String id;
30-
@Version Long version;
31-
@QueryIndexed String name;
32-
String iata;
33-
Long gates;
34-
35-
@PersistenceConstructor
36-
public AirlineGates(String id, String name, String iata, Long gates) {
37-
this.id = id;
38-
this.name = name;
39-
this.iata = iata;
40-
this.gates = gates;
41-
}
42-
43-
public String getId() {
44-
return id;
45-
}
46-
public Long getGates() {
47-
return gates;
48-
}
49-
50-
public String toString(){
51-
StringBuffer sb=new StringBuffer();
52-
sb.append("{");
53-
sb.append("\"id\":"+id);
54-
sb.append(", \"name\":"+name);
55-
sb.append(", \"iata\":"+iata);
56-
sb.append(", \"gates\":"+gates);
57-
sb.append("}");
58-
59-
return sb.toString();
60-
}
28+
@Id
29+
String id;
30+
@Version
31+
Long version;
32+
@QueryIndexed
33+
String name;
34+
String iata;
35+
Long gates;
36+
37+
public AirlineGates(String id, String name, String iata, Long gates) {
38+
this.id = id;
39+
this.name = name;
40+
this.iata = iata;
41+
this.gates = gates;
42+
}
43+
44+
public String getId() {
45+
return id;
46+
}
47+
48+
public Long getGates() {
49+
return gates;
50+
}
51+
52+
public String toString() {
53+
StringBuffer sb = new StringBuffer();
54+
sb.append("{");
55+
sb.append("\"id\":" + id);
56+
sb.append(", \"name\":" + name);
57+
sb.append(", \"iata\":" + iata);
58+
sb.append(", \"gates\":" + gates);
59+
sb.append("}");
60+
61+
return sb.toString();
62+
}
6163

6264
}

couchbase/transactions/src/main/java/com/example/demo/AirlineGatesRepository.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,15 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
1716
package com.example.demo;
1817

1918
import org.springframework.data.couchbase.repository.CouchbaseRepository;
2019
import org.springframework.data.couchbase.repository.DynamicProxyable;
21-
import org.springframework.stereotype.Repository;
2220

2321
/**
2422
* @author Michael Reiche
2523
*/
26-
@Repository
2724
public interface AirlineGatesRepository
28-
extends CouchbaseRepository<AirlineGates, String>, DynamicProxyable<AirlineGatesRepository> {
25+
extends CouchbaseRepository<AirlineGates, String>, DynamicProxyable<AirlineGatesRepository> {
2926

3027
}

0 commit comments

Comments
 (0)