diff --git a/core/src/main/mima-filters/1.2.0-M5.backwards.excludes/r2dbc-session.excludes b/core/src/main/mima-filters/1.2.0-M5.backwards.excludes/r2dbc-session.excludes new file mode 100644 index 00000000..f8a71f8b --- /dev/null +++ b/core/src/main/mima-filters/1.2.0-M5.backwards.excludes/r2dbc-session.excludes @@ -0,0 +1,3 @@ +# Wrong function type, was ApiMayChange +ProblemFilters.exclude[IncompatibleMethTypeProblem]("akka.persistence.r2dbc.session.javadsl.R2dbcSession.selectOne") +ProblemFilters.exclude[IncompatibleMethTypeProblem]("akka.persistence.r2dbc.session.javadsl.R2dbcSession.select") diff --git a/core/src/main/scala/akka/persistence/r2dbc/session/javadsl/R2dbcSession.scala b/core/src/main/scala/akka/persistence/r2dbc/session/javadsl/R2dbcSession.scala index c328f39e..e86cddc9 100644 --- a/core/src/main/scala/akka/persistence/r2dbc/session/javadsl/R2dbcSession.scala +++ b/core/src/main/scala/akka/persistence/r2dbc/session/javadsl/R2dbcSession.scala @@ -7,14 +7,15 @@ package akka.persistence.r2dbc.session.javadsl import java.util.Optional import java.util.concurrent.CompletionStage import java.util.function.{ Function => JFunction } + import scala.collection.JavaConverters._ import scala.compat.java8.FutureConverters._ import scala.compat.java8.OptionConverters._ import scala.concurrent.ExecutionContext + import akka.actor.typed.ActorSystem import akka.annotation.ApiMayChange import akka.dispatch.ExecutionContexts -import akka.persistence.r2dbc.R2dbcSettings import akka.persistence.r2dbc.internal.R2dbcExecutor import akka.persistence.r2dbc.session.scaladsl import io.r2dbc.spi.Connection @@ -59,10 +60,10 @@ final class R2dbcSession(val connection: Connection)(implicit ec: ExecutionConte .map(results => results.map(java.lang.Long.valueOf).asJava) .toJava - def selectOne[A](statement: Statement)(mapRow: Row => A): CompletionStage[Optional[A]] = - R2dbcExecutor.selectOneInTx(statement, mapRow).map(_.asJava)(ExecutionContexts.parasitic).toJava + def selectOne[A](statement: Statement)(mapRow: JFunction[Row, A]): CompletionStage[Optional[A]] = + R2dbcExecutor.selectOneInTx(statement, mapRow(_)).map(_.asJava)(ExecutionContexts.parasitic).toJava - def select[A](statement: Statement)(mapRow: Row => A): CompletionStage[java.util.List[A]] = - R2dbcExecutor.selectInTx(statement, mapRow).map(_.asJava).toJava + def select[A](statement: Statement)(mapRow: JFunction[Row, A]): CompletionStage[java.util.List[A]] = + R2dbcExecutor.selectInTx(statement, mapRow(_)).map(_.asJava).toJava } diff --git a/core/src/main/scala/akka/persistence/r2dbc/session/scaladsl/R2dbcSession.scala b/core/src/main/scala/akka/persistence/r2dbc/session/scaladsl/R2dbcSession.scala index 5d1e3d0a..af6c1ef0 100644 --- a/core/src/main/scala/akka/persistence/r2dbc/session/scaladsl/R2dbcSession.scala +++ b/core/src/main/scala/akka/persistence/r2dbc/session/scaladsl/R2dbcSession.scala @@ -12,7 +12,6 @@ import scala.concurrent.duration._ import akka.actor.typed.ActorSystem import akka.annotation.ApiMayChange import akka.persistence.r2dbc.ConnectionFactoryProvider -import akka.persistence.r2dbc.ConnectionPoolSettings import akka.persistence.r2dbc.internal.R2dbcExecutor import io.r2dbc.spi.Connection import io.r2dbc.spi.Row