Skip to content
This repository has been archived by the owner on Dec 30, 2018. It is now read-only.

Commit

Permalink
Merge pull request #54 from hazendaz/master
Browse files Browse the repository at this point in the history
Turn on formatting
  • Loading branch information
hazendaz committed Aug 27, 2018
2 parents 614a222 + a84fa4b commit 05dc933
Show file tree
Hide file tree
Showing 12 changed files with 98 additions and 60 deletions.
15 changes: 15 additions & 0 deletions .mvn/wrapper/MavenWrapperDownloader.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/**
* Copyright 2016-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
Expand Down
22 changes: 22 additions & 0 deletions format.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2016-2018 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE Format>
<Format>
<!-- Dummy format file -->
</Format>
5 changes: 3 additions & 2 deletions src/main/java/org/apache/ibatis/type/InstantTypeHandler.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2016 the original author or authors.
* Copyright 2016-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -28,7 +28,8 @@
public class InstantTypeHandler extends BaseTypeHandler<Instant> {

@Override
public void setNonNullParameter(PreparedStatement ps, int i, Instant parameter, JdbcType jdbcType) throws SQLException {
public void setNonNullParameter(PreparedStatement ps, int i, Instant parameter, JdbcType jdbcType)
throws SQLException {
ps.setTimestamp(i, Timestamp.from(parameter));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2016 the original author or authors.
* Copyright 2016-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -33,7 +33,7 @@ public class JapaneseDateTypeHandler extends BaseTypeHandler<JapaneseDate> {

@Override
public void setNonNullParameter(PreparedStatement ps, int i, JapaneseDate parameter, JdbcType jdbcType)
throws SQLException {
throws SQLException {
ps.setDate(i, Date.valueOf(LocalDate.ofEpochDay(parameter.toEpochDay())));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2016 the original author or authors.
* Copyright 2016-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -29,7 +29,7 @@ public class LocalDateTimeTypeHandler extends BaseTypeHandler<LocalDateTime> {

@Override
public void setNonNullParameter(PreparedStatement ps, int i, LocalDateTime parameter, JdbcType jdbcType)
throws SQLException {
throws SQLException {
ps.setTimestamp(i, Timestamp.valueOf(parameter));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2016 the original author or authors.
* Copyright 2016-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -29,7 +29,7 @@ public class LocalDateTypeHandler extends BaseTypeHandler<LocalDate> {

@Override
public void setNonNullParameter(PreparedStatement ps, int i, LocalDate parameter, JdbcType jdbcType)
throws SQLException {
throws SQLException {
ps.setDate(i, Date.valueOf(parameter));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2016 the original author or authors.
* Copyright 2016-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -29,7 +29,7 @@ public class LocalTimeTypeHandler extends BaseTypeHandler<LocalTime> {

@Override
public void setNonNullParameter(PreparedStatement ps, int i, LocalTime parameter, JdbcType jdbcType)
throws SQLException {
throws SQLException {
ps.setTime(i, Time.valueOf(parameter));
}

Expand Down
44 changes: 22 additions & 22 deletions src/main/java/org/apache/ibatis/type/MonthTypeHandler.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2016 the original author or authors.
* Copyright 2016-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -27,28 +27,28 @@
* @author Björn Raupach
*/
public class MonthTypeHandler extends BaseTypeHandler<Month> {

@Override
public void setNonNullParameter(PreparedStatement ps, int i, Month month, JdbcType type) throws SQLException {
ps.setInt(i, month.getValue());
}

@Override
public Month getNullableResult(ResultSet rs, String columnName) throws SQLException {
int month = rs.getInt(columnName);
return month == 0 ? null : Month.of(month);
}
@Override
public void setNonNullParameter(PreparedStatement ps, int i, Month month, JdbcType type) throws SQLException {
ps.setInt(i, month.getValue());
}

@Override
public Month getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
int month = rs.getInt(columnIndex);
return month == 0 ? null : Month.of(month);
}
@Override
public Month getNullableResult(ResultSet rs, String columnName) throws SQLException {
int month = rs.getInt(columnName);
return month == 0 ? null : Month.of(month);
}

@Override
public Month getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
int month = rs.getInt(columnIndex);
return month == 0 ? null : Month.of(month);
}

@Override
public Month getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
int month = cs.getInt(columnIndex);
return month == 0 ? null : Month.of(month);
}

@Override
public Month getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
int month = cs.getInt(columnIndex);
return month == 0 ? null : Month.of(month);
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2016 the original author or authors.
* Copyright 2016-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -30,7 +30,7 @@ public class OffsetDateTimeTypeHandler extends BaseTypeHandler<OffsetDateTime> {

@Override
public void setNonNullParameter(PreparedStatement ps, int i, OffsetDateTime parameter, JdbcType jdbcType)
throws SQLException {
throws SQLException {
ps.setTimestamp(i, Timestamp.from(parameter.toInstant()));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2016 the original author or authors.
* Copyright 2016-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -29,7 +29,7 @@ public class OffsetTimeTypeHandler extends BaseTypeHandler<OffsetTime> {

@Override
public void setNonNullParameter(PreparedStatement ps, int i, OffsetTime parameter, JdbcType jdbcType)
throws SQLException {
throws SQLException {
ps.setTime(i, Time.valueOf(parameter.toLocalTime()));
}

Expand Down
44 changes: 22 additions & 22 deletions src/main/java/org/apache/ibatis/type/YearTypeHandler.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2016 the original author or authors.
* Copyright 2016-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -26,28 +26,28 @@
* @author Björn Raupach
*/
public class YearTypeHandler extends BaseTypeHandler<Year> {

@Override
public void setNonNullParameter(PreparedStatement ps, int i, Year year, JdbcType type) throws SQLException {
ps.setInt(i, year.getValue());
}

@Override
public Year getNullableResult(ResultSet rs, String columnName) throws SQLException {
int year = rs.getInt(columnName);
return year == 0 ? null : Year.of(year);
}
@Override
public void setNonNullParameter(PreparedStatement ps, int i, Year year, JdbcType type) throws SQLException {
ps.setInt(i, year.getValue());
}

@Override
public Year getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
int year = rs.getInt(columnIndex);
return year == 0 ? null : Year.of(year);
}
@Override
public Year getNullableResult(ResultSet rs, String columnName) throws SQLException {
int year = rs.getInt(columnName);
return year == 0 ? null : Year.of(year);
}

@Override
public Year getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
int year = rs.getInt(columnIndex);
return year == 0 ? null : Year.of(year);
}

@Override
public Year getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
int year = cs.getInt(columnIndex);
return year == 0 ? null : Year.of(year);
}

@Override
public Year getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
int year = cs.getInt(columnIndex);
return year == 0 ? null : Year.of(year);
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2016 the original author or authors.
* Copyright 2016-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -30,7 +30,7 @@ public class ZonedDateTimeTypeHandler extends BaseTypeHandler<ZonedDateTime> {

@Override
public void setNonNullParameter(PreparedStatement ps, int i, ZonedDateTime parameter, JdbcType jdbcType)
throws SQLException {
throws SQLException {
ps.setTimestamp(i, Timestamp.from(parameter.toInstant()));
}

Expand Down

0 comments on commit 05dc933

Please sign in to comment.