Skip to content

Commit e4f2b1d

Browse files
committed
Bumped ScalikeJDBC to 2.0.0-beta2
1 parent f935292 commit e4f2b1d

File tree

12 files changed

+53
-49
lines changed

12 files changed

+53
-49
lines changed

core/src/main/scala/scalikejdbc/async/internal/AsyncResultSetImpl.scala

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -119,48 +119,48 @@ private[scalikejdbc] class AsyncResultSetImpl(rows: IndexedSeq[RowData])
119119
case dt: DateTime => dt
120120
case TimeInMillis(ms) => new DateTime(ms)
121121
case other => throw new UnsupportedOperationException(
122-
s"Please send a feedback to the library maintainers about supporting ${other.getClass} for #dateTime!")
122+
s"Please send a feedback to the library maintainers about supporting ${other.getClass} for #jodaDateTime!")
123123
}
124-
override def dateTime(columnIndex: Int): DateTime = anyToDateTime(any(columnIndex))
125-
override def dateTime(columnLabel: String): DateTime = anyToDateTime(any(columnLabel))
126-
override def dateTimeOpt(columnIndex: Int): Option[DateTime] = Option(dateTime(columnIndex))
127-
override def dateTimeOpt(columnLabel: String): Option[DateTime] = Option(dateTime(columnLabel))
124+
override def jodaDateTime(columnIndex: Int): DateTime = anyToDateTime(any(columnIndex))
125+
override def jodaDateTime(columnLabel: String): DateTime = anyToDateTime(any(columnLabel))
126+
override def jodaDateTimeOpt(columnIndex: Int): Option[DateTime] = Option(jodaDateTime(columnIndex))
127+
override def jodaDateTimeOpt(columnLabel: String): Option[DateTime] = Option(jodaDateTime(columnLabel))
128128

129129
private def anyToLocalDateTime(any: Any): LocalDateTime = any match {
130130
case null => null
131131
case ldt: LocalDateTime => ldt
132132
case TimeInMillis(ms) => new LocalDateTime(ms)
133133
case other => throw new UnsupportedOperationException(
134-
s"Please send a feedback to the library maintainers about supporting ${other.getClass} for #localDateTime!")
134+
s"Please send a feedback to the library maintainers about supporting ${other.getClass} for #jodaLocalDateTime!")
135135
}
136-
override def localDateTime(columnIndex: Int): LocalDateTime = anyToLocalDateTime(any(columnIndex))
137-
override def localDateTime(columnLabel: String): LocalDateTime = anyToLocalDateTime(any(columnLabel))
138-
override def localDateTimeOpt(columnIndex: Int): Option[LocalDateTime] = Option(localDateTime(columnIndex))
139-
override def localDateTimeOpt(columnLabel: String): Option[LocalDateTime] = Option(localDateTime(columnLabel))
136+
override def jodaLocalDateTime(columnIndex: Int): LocalDateTime = anyToLocalDateTime(any(columnIndex))
137+
override def jodaLocalDateTime(columnLabel: String): LocalDateTime = anyToLocalDateTime(any(columnLabel))
138+
override def jodaLocalDateTimeOpt(columnIndex: Int): Option[LocalDateTime] = Option(jodaLocalDateTime(columnIndex))
139+
override def jodaLocalDateTimeOpt(columnLabel: String): Option[LocalDateTime] = Option(jodaLocalDateTime(columnLabel))
140140

141141
private def anyToLocalDate(any: Any): LocalDate = any match {
142142
case null => null
143143
case ld: LocalDate => ld
144144
case TimeInMillis(ms) => new LocalDate(ms)
145145
case other => throw new UnsupportedOperationException(
146-
s"Please send a feedback to the library maintainers about supporting ${other.getClass} for #localDate!")
146+
s"Please send a feedback to the library maintainers about supporting ${other.getClass} for #jodaLocalDate!")
147147
}
148-
override def localDate(columnIndex: Int): LocalDate = anyToLocalDate(any(columnIndex))
149-
override def localDate(columnLabel: String): LocalDate = anyToLocalDate(any(columnLabel))
150-
override def localDateOpt(columnIndex: Int): Option[LocalDate] = Option(localDate(columnIndex))
151-
override def localDateOpt(columnLabel: String): Option[LocalDate] = Option(localDate(columnLabel))
148+
override def jodaLocalDate(columnIndex: Int): LocalDate = anyToLocalDate(any(columnIndex))
149+
override def jodaLocalDate(columnLabel: String): LocalDate = anyToLocalDate(any(columnLabel))
150+
override def jodaLocalDateOpt(columnIndex: Int): Option[LocalDate] = Option(jodaLocalDate(columnIndex))
151+
override def jodaLocalDateOpt(columnLabel: String): Option[LocalDate] = Option(jodaLocalDate(columnLabel))
152152

153153
private def anyToLocalTime(any: Any): LocalTime = any match {
154154
case null => null
155155
case lt: LocalTime => lt
156156
case TimeInMillis(ms) => new LocalTime(ms)
157157
case other => throw new UnsupportedOperationException(
158-
s"Please send a feedback to the library maintainers about supporting ${other.getClass} for #localTime!")
158+
s"Please send a feedback to the library maintainers about supporting ${other.getClass} for #jodaLocalTime!")
159159
}
160-
override def localTime(columnIndex: Int): LocalTime = anyToLocalTime(any(columnIndex))
161-
override def localTime(columnLabel: String): LocalTime = anyToLocalTime(any(columnLabel))
162-
override def localTimeOpt(columnIndex: Int): Option[LocalTime] = Option(localTime(columnIndex))
163-
override def localTimeOpt(columnLabel: String): Option[LocalTime] = Option(localTime(columnLabel))
160+
override def jodaLocalTime(columnIndex: Int): LocalTime = anyToLocalTime(any(columnIndex))
161+
override def jodaLocalTime(columnLabel: String): LocalTime = anyToLocalTime(any(columnLabel))
162+
override def jodaLocalTimeOpt(columnIndex: Int): Option[LocalTime] = Option(jodaLocalTime(columnIndex))
163+
override def jodaLocalTimeOpt(columnLabel: String): Option[LocalTime] = Option(jodaLocalTime(columnLabel))
164164

165165
private def anyToUrl(any: Any): java.net.URL = any match {
166166
case null => null

core/src/test/scala/programmerlist/Company.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ object Company extends SQLSyntaxSupport[Company] with ShortenedNames {
2424
id = rs.long(c.id),
2525
name = rs.string(c.name),
2626
url = rs.stringOpt(c.url),
27-
createdAt = rs.timestamp(c.createdAt).toDateTime,
28-
deletedAt = rs.timestampOpt(c.deletedAt).map(_.toDateTime)
27+
createdAt = rs.jodaDateTime(c.createdAt),
28+
deletedAt = rs.jodaDateTimeOpt(c.deletedAt)
2929
)
3030

3131
lazy val c = Company.syntax("c")

core/src/test/scala/programmerlist/ExampleSpec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import scala.concurrent._, duration._, ExecutionContext.Implicits.global
66
import org.scalatest._, matchers._
77
import unit._
88

9-
class ExampleSpec extends FlatSpec with ShouldMatchers with DBSettings with Logging {
9+
class ExampleSpec extends FlatSpec with Matchers with DBSettings with Logging {
1010

1111
val p = Programmer.syntax("p")
1212

core/src/test/scala/programmerlist/Skill.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ object Skill extends SQLSyntaxSupport[Skill] with ShortenedNames {
2222
def apply(s: ResultName[Skill])(rs: WrappedResultSet): Skill = new Skill(
2323
id = rs.long(s.id),
2424
name = rs.string(s.name),
25-
createdAt = rs.timestamp(s.createdAt).toDateTime,
26-
deletedAt = rs.timestampOpt(s.deletedAt).map(_.toDateTime)
25+
createdAt = rs.jodaDateTime(s.createdAt),
26+
deletedAt = rs.jodaDateTimeOpt(s.deletedAt)
2727
)
2828

2929
def opt(s: SyntaxProvider[Skill])(rs: WrappedResultSet): Option[Skill] = rs.longOpt(s.resultName.id).map(_ => apply(s.resultName)(rs))

core/src/test/scala/sample/MySQLSampleSpec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import scala.concurrent._, duration._, ExecutionContext.Implicits.global
66
import scalikejdbc._, SQLInterpolation._, async._
77
import unit._
88

9-
class MySQLSampleSpec extends FlatSpec with ShouldMatchers with DBSettings with Logging {
9+
class MySQLSampleSpec extends FlatSpec with Matchers with DBSettings with Logging {
1010

1111
val column = AsyncLover.column
1212
val createdTime = DateTime.now.withMillisOfSecond(0)

core/src/test/scala/sample/PostgreSQLSampleSpec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import scala.concurrent._, duration.DurationInt, ExecutionContext.Implicits.glob
77
import scalikejdbc._, SQLInterpolation._, async._
88
import unit._
99

10-
class PostgreSQLSampleSpec extends FlatSpec with ShouldMatchers with DBSettings with Logging {
10+
class PostgreSQLSampleSpec extends FlatSpec with Matchers with DBSettings with Logging {
1111

1212
val column = AsyncLover.column
1313
val createdTime = DateTime.now.withMillisOfSecond(0)

play-sample/app/models/Company.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ object Company extends SQLSyntaxSupport[Company] with ShortenedNames {
2424
id = rs.long(c.id),
2525
name = rs.string(c.name),
2626
url = rs.stringOpt(c.url),
27-
createdAt = rs.timestamp(c.createdAt).toDateTime,
28-
deletedAt = rs.timestampOpt(c.deletedAt).map(_.toDateTime)
27+
createdAt = rs.jodaDateTime(c.createdAt),
28+
deletedAt = rs.jodaDateTimeOpt(c.deletedAt)
2929
)
3030

3131
lazy val c = Company.syntax("c")

play-sample/app/models/Programmer.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ object Programmer extends SQLSyntaxSupport[Programmer] with ShortenedNames {
4242
id = rs.long(p.id),
4343
name = rs.string(p.name),
4444
companyId = rs.longOpt(p.companyId),
45-
createdAt = rs.timestamp(p.createdAt).toDateTime,
46-
deletedAt = rs.timestampOpt(p.deletedAt).map(_.toDateTime)
45+
createdAt = rs.jodaDateTime(p.createdAt),
46+
deletedAt = rs.jodaDateTimeOpt(p.deletedAt)
4747
)
4848

4949
// join query with company table

play-sample/app/models/Skill.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ object Skill extends SQLSyntaxSupport[Skill] with ShortenedNames {
2222
def apply(s: ResultName[Skill])(rs: WrappedResultSet): Skill = new Skill(
2323
id = rs.long(s.id),
2424
name = rs.string(s.name),
25-
createdAt = rs.timestamp(s.createdAt).toDateTime,
26-
deletedAt = rs.timestampOpt(s.deletedAt).map(_.toDateTime)
25+
createdAt = rs.jodaDateTime(s.createdAt),
26+
deletedAt = rs.jodaDateTimeOpt(s.deletedAt)
2727
)
2828

2929
def opt(s: SyntaxProvider[Skill])(rs: WrappedResultSet): Option[Skill] = rs.longOpt(s.resultName.id).map(_ => apply(s.resultName)(rs))

project/Build.scala

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import play.Project._
44

55
object ScalikeJDBCAsyncProject extends Build {
66

7-
lazy val _version = "0.3.5"
8-
lazy val scalikejdbcVersion = "1.7.4"
9-
lazy val mauricioVersion = "0.2.11"
10-
lazy val defaultPlayVersion = "2.2.1"
7+
lazy val _version = "0.3.6-SNAPSHOT"
8+
lazy val scalikejdbcVersion = "2.0.0-beta2"
9+
lazy val mauricioVersion = "0.2.13"
10+
lazy val defaultPlayVersion = "2.2.2"
1111

1212
lazy val core = Project(
1313
id = "core",
@@ -26,13 +26,15 @@ object ScalikeJDBCAsyncProject extends Build {
2626
"org.scalikejdbc" %% "scalikejdbc-interpolation" % scalikejdbcVersion % "compile",
2727
"com.github.mauricio" %% "postgresql-async" % mauricioVersion % "provided",
2828
"com.github.mauricio" %% "mysql-async" % mauricioVersion % "provided",
29-
"org.postgresql" % "postgresql" % "9.3-1100-jdbc41" % "test",
30-
"mysql" % "mysql-connector-java" % "5.1.28" % "test",
31-
"org.scalatest" %% "scalatest" % "1.9.2" % "test",
32-
"ch.qos.logback" % "logback-classic" % "1.1.1" % "test"
29+
"org.postgresql" % "postgresql" % "9.3-1101-jdbc41" % "test",
30+
"mysql" % "mysql-connector-java" % "5.1.30" % "test",
31+
"org.scalatest" %% "scalatest" % "2.1.3" % "test",
32+
"ch.qos.logback" % "logback-classic" % "1.1.2" % "test"
3333
)
3434
},
3535
sbtPlugin := false,
36+
transitiveClassifiers in Global := Seq(Artifact.SourceClassifier),
37+
incOptions := incOptions.value.withNameHashing(true),
3638
scalacOptions ++= _scalacOptions,
3739
publishMavenStyle := true,
3840
publishArtifact in Test := false,
@@ -66,6 +68,8 @@ object ScalikeJDBCAsyncProject extends Build {
6668
publishArtifact in Test := false,
6769
pomIncludeRepository := { x => false },
6870
pomExtra := _pomExtra,
71+
transitiveClassifiers in Global := Seq(Artifact.SourceClassifier),
72+
incOptions := incOptions.value.withNameHashing(true),
6973
scalacOptions ++= _scalacOptions
7074
)
7175
) dependsOn(core)
@@ -79,10 +83,10 @@ object ScalikeJDBCAsyncProject extends Build {
7983
"org.scalikejdbc" %% "scalikejdbc-interpolation" % scalikejdbcVersion,
8084
"com.github.mauricio" %% "postgresql-async" % mauricioVersion,
8185
"com.github.mauricio" %% "mysql-async" % mauricioVersion,
82-
"org.postgresql" % "postgresql" % "9.3-1100-jdbc41",
86+
"org.postgresql" % "postgresql" % "9.3-1101-jdbc41",
8387
"com.github.tototoshi" %% "play-flyway" % "1.0.1",
84-
"mysql" % "mysql-connector-java" % "5.1.28",
85-
"org.json4s" %% "json4s-ext" % "3.2.6",
88+
"mysql" % "mysql-connector-java" % "5.1.30",
89+
"org.json4s" %% "json4s-ext" % "3.2.8",
8690
"com.github.tototoshi" %% "play-json4s-native" % "0.2.0"
8791
)
8892
play.Project(appName, appVersion, appDependencies, path = file("play-sample")).settings(

0 commit comments

Comments
 (0)