Skip to content

Commit

Permalink
remove deprecated methods, fix #952
Browse files Browse the repository at this point in the history
  • Loading branch information
zambrovski committed Feb 21, 2024
1 parent 7c60895 commit 95bc5ae
Showing 1 changed file with 1 addition and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import io.holunda.polyflow.view.jpa.task.toTask
import io.holunda.polyflow.view.jpa.update.updateTaskQuery
import io.holunda.polyflow.view.query.PageableSortableQuery
import io.holunda.polyflow.view.query.task.*
import io.holunda.polyflow.view.task
import mu.KLogging
import org.axonframework.config.ProcessingGroup
import org.axonframework.eventhandling.EventHandler
Expand Down Expand Up @@ -251,18 +252,6 @@ class JpaPolyflowViewTaskService(
)
}


/**
* Legacy handler to support old query.
*/
@Deprecated("Will be removed in future versions", ReplaceWith("query(query: TaskWithDataEntriesForIdQuery): Optional<TaskWithDataEntries>"))
@QueryHandler
fun legacyQuery(query: TaskWithDataEntriesForIdQuery): TaskWithDataEntries? {
logger.warn { "You are using deprecated API, consider to switch to query(TaskWithDataEntriesForIdQuery): Optional<TaskWithDataEntries>" }
return query(query).orElse(null)
}


@QueryHandler
override fun query(query: TaskWithDataEntriesForIdQuery): Optional<TaskWithDataEntries> {
return Optional.ofNullable(taskRepository.findByIdOrNull(query.id)?.let { taskEntity ->
Expand All @@ -274,16 +263,6 @@ class JpaPolyflowViewTaskService(
}


/**
* Legacy handler to support old query.
*/
@Deprecated("Will be removed in future versions", ReplaceWith("query(TaskForIdQuery): Optional<Task>"))
@QueryHandler
fun legacyQuery(query: TaskForIdQuery): Task? {
logger.warn { "You are using deprecated API, consider to switch to query(TaskForIdQuery): Optional<Task>" }
return query(query).orElse(null)
}

@QueryHandler
override fun query(query: TaskForIdQuery): Optional<Task> {
return Optional.ofNullable(taskRepository.findByIdOrNull(query.id)?.toTask(objectMapper))
Expand Down

0 comments on commit 95bc5ae

Please sign in to comment.