Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Wrong function type in javadsl.R2dbcSession #458

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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")
Original file line number Diff line number Diff line change
@@ -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

}
Original file line number Diff line number Diff line change
@@ -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