Skip to content

Commit e098c4a

Browse files
abhrjbenjamin-bader
authored andcommitted
Update dropwizard and jooq to latest (#47)
1 parent 489a6b5 commit e098c4a

File tree

5 files changed

+15
-31
lines changed

5 files changed

+15
-31
lines changed

droptools-example/pom.xml

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616

1717
<properties>
1818
<autovalue.version>1.0-rc1</autovalue.version>
19-
<dropwizard.version>1.0.0</dropwizard.version>
19+
<dropwizard.version>1.3.5</dropwizard.version>
2020
<dropwizard.flyway.version>0.9.2-3</dropwizard.flyway.version>
2121
<dropwizard.jooq.version>${project.parent.version}</dropwizard.jooq.version>
2222
<junit.version>4.12</junit.version>
2323
<mockito.version>1.9.5</mockito.version>
2424
<truth.version>0.23</truth.version>
2525

2626
<flyway.version>4.0.3</flyway.version>
27-
<postgres.jdbc.version>9.3-1101-jdbc41</postgres.jdbc.version>
27+
<postgres.jdbc.version>42.2.4</postgres.jdbc.version>
2828
</properties>
2929

3030
<dependencies>
@@ -73,7 +73,7 @@
7373
<plugin>
7474
<groupId>org.jooq</groupId>
7575
<artifactId>jooq-codegen-maven</artifactId>
76-
<version>3.4.2</version>
76+
<version>3.11.3</version>
7777

7878
<executions>
7979
<execution>
@@ -100,29 +100,13 @@
100100
</jdbc>
101101

102102
<generator>
103-
<name>org.jooq.util.DefaultGenerator</name>
104103
<generate>
105104
<deprecated>false</deprecated>
106105
</generate>
107106
<database>
108-
<name>org.jooq.util.postgres.PostgresDatabase</name>
107+
<name>org.jooq.meta.postgres.PostgresDatabase</name>
109108
<includes>.*</includes>
110109
<inputSchema>ex</inputSchema>
111-
112-
<customTypes>
113-
<customType>
114-
<name>DateTime</name>
115-
<type>org.joda.time.DateTime</type>
116-
<converter>com.bendb.dropwizard.jooq.JodaDateTimeConverter</converter>
117-
</customType>
118-
</customTypes>
119-
120-
<forcedTypes>
121-
<forcedType>
122-
<name>DateTime</name>
123-
<types>(?i:timestamp).*</types>
124-
</forcedType>
125-
</forcedTypes>
126110
</database>
127111
<target>
128112
<packageName>com.bendb.example.db</packageName>

droptools-example/src/main/java/com/bendb/example/core/BlogPost.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import com.google.auto.value.AutoValue;
55
import com.google.common.collect.ImmutableList;
66
import io.dropwizard.jackson.JsonSnakeCase;
7-
import org.joda.time.DateTime;
7+
import java.time.OffsetDateTime;
88

99
import java.util.List;
1010

@@ -18,7 +18,7 @@ public abstract class BlogPost {
1818
public abstract String text();
1919

2020
@JsonProperty
21-
public abstract DateTime createdAt();
21+
public abstract OffsetDateTime createdAt();
2222

2323
@JsonProperty
2424
public abstract ImmutableList<String> tags();
@@ -28,7 +28,7 @@ public abstract class BlogPost {
2828
public static BlogPost create(
2929
int postId,
3030
String text,
31-
DateTime createdAt,
31+
OffsetDateTime createdAt,
3232
List<String> tags) {
3333
return new AutoValue_BlogPost(postId, text, createdAt, immutableCopy(tags));
3434
}

droptools-example/src/main/java/com/bendb/example/resources/PostsResource.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import com.bendb.example.db.tables.records.BlogPostRecord;
77
import com.bendb.example.db.tables.records.PostTagRecord;
88
import io.dropwizard.jersey.params.IntParam;
9-
import org.joda.time.DateTime;
9+
import java.time.OffsetDateTime;
1010
import org.jooq.*;
1111
import org.jooq.impl.DSL;
1212
import javax.ws.rs.*;
@@ -44,12 +44,12 @@ public List<BlogPost> findPostsByTag(@QueryParam("tag") String tag, @JooqInject(
4444
.where(field("id").equal(BLOG_POST.ID)))
4545
.groupBy(BLOG_POST.ID, BLOG_POST.BODY, BLOG_POST.CREATED_AT)
4646
.orderBy(BLOG_POST.CREATED_AT.desc())
47-
.fetch(new RecordMapper<Record4<Integer, String, DateTime, String[]>, BlogPost>() {
47+
.fetch(new RecordMapper<Record4<Integer, String, OffsetDateTime, String[]>, BlogPost>() {
4848
@Override
49-
public BlogPost map(Record4<Integer, String, DateTime, String[]> record) {
49+
public BlogPost map(Record4<Integer, String, OffsetDateTime, String[]> record) {
5050
final Integer postId = record.value1();
5151
final String text = record.value2();
52-
final DateTime createdAt = record.value3();
52+
final OffsetDateTime createdAt = record.value3();
5353
final List<String> tags = Arrays.asList(record.value4());
5454

5555
return BlogPost.create(postId, text, createdAt, tags);
@@ -96,7 +96,7 @@ public Response run(Configuration configuration) throws Exception {
9696
@GET
9797
@Path("/{id}")
9898
public BlogPost getPost(@PathParam("id") IntParam id, @Context DSLContext create) {
99-
final Record4<Integer, String, DateTime, String[]> record = create
99+
final Record4<Integer, String, OffsetDateTime, String[]> record = create
100100
.select(BLOG_POST.ID, BLOG_POST.BODY, BLOG_POST.CREATED_AT, arrayAgg(POST_TAG.TAG_NAME))
101101
.from(BLOG_POST)
102102
.leftOuterJoin(POST_TAG)
@@ -111,7 +111,7 @@ public BlogPost getPost(@PathParam("id") IntParam id, @Context DSLContext create
111111

112112
final Integer postId = record.value1();
113113
final String text = record.value2();
114-
final DateTime createdAt = record.value3();
114+
final OffsetDateTime createdAt = record.value3();
115115
final List<String> tags = Arrays.asList(record.value4());
116116

117117
return BlogPost.create(postId, text, createdAt, tags);

dropwizard-jooq/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<description>Addon bundle for Dropwizard to support jOOQ for database access</description>
2020

2121
<properties>
22-
<jooq.version>3.9.1</jooq.version>
22+
<jooq.version>3.11.3</jooq.version>
2323
</properties>
2424

2525
<dependencies>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555

5656
<properties>
5757
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
58-
<dropwizard.version>1.2.0</dropwizard.version>
58+
<dropwizard.version>1.3.5</dropwizard.version>
5959
<coberatura.version>2.7</coberatura.version>
6060

6161
<github.global.server>github</github.global.server>

0 commit comments

Comments
 (0)