diff --git a/build-parent/pom.xml b/build-parent/pom.xml
index 2d17a11a05480..a0540aa7f5d53 100644
--- a/build-parent/pom.xml
+++ b/build-parent/pom.xml
@@ -329,7 +329,7 @@
d3js
${webjar.d3js.version}
-
+
org.webjars
chartjs
${webjar.chartjs.version}
@@ -775,6 +775,49 @@
+
+ format-kotlin
+
+ true
+
+ !no-format
+
+
+ src/main/kotlin
+
+
+
+
+
+ com.diffplug.spotless
+ spotless-maven-plugin
+ 2.25.0
+
+
+ format-kotlin
+ process-sources
+
+ apply
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
release
diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/websockets-codestart/kotlin/src/main/kotlin/org/acme/StartWebSocket.kt b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/websockets-codestart/kotlin/src/main/kotlin/org/acme/StartWebSocket.kt
index 660b2b780c9b2..eadc327cb78ce 100644
--- a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/websockets-codestart/kotlin/src/main/kotlin/org/acme/StartWebSocket.kt
+++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/websockets-codestart/kotlin/src/main/kotlin/org/acme/StartWebSocket.kt
@@ -1,13 +1,12 @@
package org.acme
-import java.io.IOException
import javax.enterprise.context.ApplicationScoped
import javax.websocket.*
import javax.websocket.server.PathParam
import javax.websocket.server.ServerEndpoint
-@ServerEndpoint("/start-websocket/{name}")
@ApplicationScoped
+@ServerEndpoint("/start-websocket/{name}")
class StartWebSocket {
@OnOpen
diff --git a/extensions/panache/hibernate-orm-panache-kotlin/runtime/src/main/kotlin/io/quarkus/hibernate/orm/panache/kotlin/PanacheCompanion.kt b/extensions/panache/hibernate-orm-panache-kotlin/runtime/src/main/kotlin/io/quarkus/hibernate/orm/panache/kotlin/PanacheCompanion.kt
index dcaaeea6514e7..e5a497036fe4b 100644
--- a/extensions/panache/hibernate-orm-panache-kotlin/runtime/src/main/kotlin/io/quarkus/hibernate/orm/panache/kotlin/PanacheCompanion.kt
+++ b/extensions/panache/hibernate-orm-panache-kotlin/runtime/src/main/kotlin/io/quarkus/hibernate/orm/panache/kotlin/PanacheCompanion.kt
@@ -14,14 +14,14 @@ import javax.persistence.LockModeType
*
* @param Entity the entity type
*/
-interface PanacheCompanion: PanacheCompanionBase
+interface PanacheCompanion : PanacheCompanionBase
/**
* Defines methods to be used via the companion objects of entities.
*
* @param Entity the entity type
*/
-interface PanacheCompanionBase {
+interface PanacheCompanionBase {
/**
* Returns the [EntityManager] for the [Entity] for extra operations (eg. CriteriaQueries)
@@ -528,7 +528,6 @@ interface PanacheCompanionBase {
@GenerateBridge
fun update(query: String, params: Parameters): Int = throw implementationInjectionMissing()
-
/**
* Flushes all pending changes to the database.
*/
diff --git a/extensions/panache/hibernate-orm-panache-kotlin/runtime/src/main/kotlin/io/quarkus/hibernate/orm/panache/kotlin/PanacheEntity.kt b/extensions/panache/hibernate-orm-panache-kotlin/runtime/src/main/kotlin/io/quarkus/hibernate/orm/panache/kotlin/PanacheEntity.kt
index 62e85dec6761c..2912a34b6d58a 100644
--- a/extensions/panache/hibernate-orm-panache-kotlin/runtime/src/main/kotlin/io/quarkus/hibernate/orm/panache/kotlin/PanacheEntity.kt
+++ b/extensions/panache/hibernate-orm-panache-kotlin/runtime/src/main/kotlin/io/quarkus/hibernate/orm/panache/kotlin/PanacheEntity.kt
@@ -1,6 +1,5 @@
package io.quarkus.hibernate.orm.panache.kotlin
-
import javax.persistence.GeneratedValue
import javax.persistence.Id
import javax.persistence.MappedSuperclass
@@ -18,7 +17,7 @@ import javax.persistence.MappedSuperclass
* @see [PanacheEntityBase]
*/
@MappedSuperclass
-open class PanacheEntity: PanacheEntityBase {
+open class PanacheEntity : PanacheEntityBase {
/**
* The auto-generated ID field. This field is set by Hibernate ORM when this entity
* is persisted.
diff --git a/extensions/panache/hibernate-orm-panache-kotlin/runtime/src/main/kotlin/io/quarkus/hibernate/orm/panache/kotlin/PanacheEntityBase.kt b/extensions/panache/hibernate-orm-panache-kotlin/runtime/src/main/kotlin/io/quarkus/hibernate/orm/panache/kotlin/PanacheEntityBase.kt
index 54a0a1af3a0fc..923c89783634c 100644
--- a/extensions/panache/hibernate-orm-panache-kotlin/runtime/src/main/kotlin/io/quarkus/hibernate/orm/panache/kotlin/PanacheEntityBase.kt
+++ b/extensions/panache/hibernate-orm-panache-kotlin/runtime/src/main/kotlin/io/quarkus/hibernate/orm/panache/kotlin/PanacheEntityBase.kt
@@ -1,10 +1,8 @@
package io.quarkus.hibernate.orm.panache.kotlin
import com.fasterxml.jackson.annotation.JsonIgnore
-import io.quarkus.hibernate.orm.panache.common.runtime.AbstractJpaOperations
import io.quarkus.hibernate.orm.panache.kotlin.runtime.KotlinJpaOperations.Companion.INSTANCE
import javax.json.bind.annotation.JsonbTransient
-import javax.persistence.EntityManager
/**
* Represents an entity. If your Hibernate entities extend this class they gain auto-generated accessors
@@ -31,9 +29,9 @@ interface PanacheEntityBase {
/**
* Persist this entity in the database, if not already persisted. This will set your ID field if it is not already set.
*
- * @see [PanacheEntityBase.isPersistent]
- * @see [PanacheEntityBase.flush]
- * @see [PanacheEntityBase.persistAndFlush]
+ * @see [PanacheEntityBase.isPersistent]
+ * @see [PanacheEntityBase.flush]
+ * @see [PanacheEntityBase.persistAndFlush]
*/
fun persist() {
INSTANCE.persist(this)
diff --git a/extensions/panache/hibernate-orm-panache-kotlin/runtime/src/main/kotlin/io/quarkus/hibernate/orm/panache/kotlin/PanacheQuery.kt b/extensions/panache/hibernate-orm-panache-kotlin/runtime/src/main/kotlin/io/quarkus/hibernate/orm/panache/kotlin/PanacheQuery.kt
index 77e61defab198..0939f4339048b 100644
--- a/extensions/panache/hibernate-orm-panache-kotlin/runtime/src/main/kotlin/io/quarkus/hibernate/orm/panache/kotlin/PanacheQuery.kt
+++ b/extensions/panache/hibernate-orm-panache-kotlin/runtime/src/main/kotlin/io/quarkus/hibernate/orm/panache/kotlin/PanacheQuery.kt
@@ -18,14 +18,14 @@ import javax.persistence.NonUniqueResultException
*
* @param Entity The entity type being queried
*/
-interface PanacheQuery {
+interface PanacheQuery {
/**
* Defines a projection class: the getters, and the public fields, will be used to restrict which fields should be
* retrieved from the database.
*
* @return a new query with the same state as the previous one (params, page, range, lockMode, hints, ...).
*/
- fun project(type: Class): PanacheQuery
+ fun project(type: Class): PanacheQuery
/**
* Sets the current page.
diff --git a/extensions/panache/hibernate-orm-panache-kotlin/runtime/src/main/kotlin/io/quarkus/hibernate/orm/panache/kotlin/PanacheRepository.kt b/extensions/panache/hibernate-orm-panache-kotlin/runtime/src/main/kotlin/io/quarkus/hibernate/orm/panache/kotlin/PanacheRepository.kt
index 63387c66abddc..b9b224d4d4234 100644
--- a/extensions/panache/hibernate-orm-panache-kotlin/runtime/src/main/kotlin/io/quarkus/hibernate/orm/panache/kotlin/PanacheRepository.kt
+++ b/extensions/panache/hibernate-orm-panache-kotlin/runtime/src/main/kotlin/io/quarkus/hibernate/orm/panache/kotlin/PanacheRepository.kt
@@ -7,4 +7,4 @@ package io.quarkus.hibernate.orm.panache.kotlin
*
* @param Entity The type of entity to operate on
*/
-interface PanacheRepository: PanacheRepositoryBase
\ No newline at end of file
+interface PanacheRepository : PanacheRepositoryBase
diff --git a/extensions/panache/hibernate-orm-panache-kotlin/runtime/src/main/kotlin/io/quarkus/hibernate/orm/panache/kotlin/PanacheRepositoryBase.kt b/extensions/panache/hibernate-orm-panache-kotlin/runtime/src/main/kotlin/io/quarkus/hibernate/orm/panache/kotlin/PanacheRepositoryBase.kt
index 994cdca12132f..d65543283c26c 100644
--- a/extensions/panache/hibernate-orm-panache-kotlin/runtime/src/main/kotlin/io/quarkus/hibernate/orm/panache/kotlin/PanacheRepositoryBase.kt
+++ b/extensions/panache/hibernate-orm-panache-kotlin/runtime/src/main/kotlin/io/quarkus/hibernate/orm/panache/kotlin/PanacheRepositoryBase.kt
@@ -17,7 +17,7 @@ import kotlin.reflect.KClass
* @param Entity The type of entity to operate on
* @param Id The ID type of the entity
*/
-interface PanacheRepositoryBase {
+interface PanacheRepositoryBase {
/**
* Returns the [EntityManager] for the [Entity] for extra operations (eg. CriteriaQueries)
@@ -33,8 +33,10 @@ interface PanacheRepositoryBase {
* @return the [EntityManager] tied to the given class
*/
@GenerateBridge
- @Deprecated(message="use Panache.getEntityManager() instead to access an entity manager for any entity class",
- replaceWith = ReplaceWith("Panache.getEntityManager()"))
+ @Deprecated(
+ message = "use Panache.getEntityManager() instead to access an entity manager for any entity class",
+ replaceWith = ReplaceWith("Panache.getEntityManager()")
+ )
fun getEntityManager(clazz: KClass): EntityManager = throw implementationInjectionMissing()
/**
diff --git a/extensions/panache/hibernate-orm-panache-kotlin/runtime/src/main/kotlin/io/quarkus/hibernate/orm/panache/kotlin/runtime/PanacheQueryImpl.kt b/extensions/panache/hibernate-orm-panache-kotlin/runtime/src/main/kotlin/io/quarkus/hibernate/orm/panache/kotlin/runtime/PanacheQueryImpl.kt
index f3b0c6c5a5377..778467b361e8e 100644
--- a/extensions/panache/hibernate-orm-panache-kotlin/runtime/src/main/kotlin/io/quarkus/hibernate/orm/panache/kotlin/runtime/PanacheQueryImpl.kt
+++ b/extensions/panache/hibernate-orm-panache-kotlin/runtime/src/main/kotlin/io/quarkus/hibernate/orm/panache/kotlin/runtime/PanacheQueryImpl.kt
@@ -8,7 +8,7 @@ import java.util.stream.Stream
import javax.persistence.EntityManager
import javax.persistence.LockModeType
-class PanacheQueryImpl : PanacheQuery {
+class PanacheQueryImpl : PanacheQuery {
private var delegate: CommonPanacheQueryImpl
internal constructor(em: EntityManager?, query: String?, orderBy: String?, paramsArrayOrMap: Any?) {
@@ -20,7 +20,7 @@ class PanacheQueryImpl : PanacheQuery {
}
// Builder
- override fun project(type: Class): PanacheQuery {
+ override fun project(type: Class): PanacheQuery {
return PanacheQueryImpl(delegate.project(type))
}
diff --git a/extensions/panache/hibernate-orm-panache-kotlin/runtime/src/test/kotlin/io/quarkus/hibernate/orm/panache/kotlin/runtime/TestAnalogs.kt b/extensions/panache/hibernate-orm-panache-kotlin/runtime/src/test/kotlin/io/quarkus/hibernate/orm/panache/kotlin/runtime/TestAnalogs.kt
index d0076144f59e4..0d4de6b8d1679 100644
--- a/extensions/panache/hibernate-orm-panache-kotlin/runtime/src/test/kotlin/io/quarkus/hibernate/orm/panache/kotlin/runtime/TestAnalogs.kt
+++ b/extensions/panache/hibernate-orm-panache-kotlin/runtime/src/test/kotlin/io/quarkus/hibernate/orm/panache/kotlin/runtime/TestAnalogs.kt
@@ -1,6 +1,5 @@
package io.quarkus.hibernate.orm.panache.kotlin.runtime
-
import io.quarkus.gizmo.Gizmo
import io.quarkus.hibernate.orm.panache.kotlin.PanacheCompanionBase
import io.quarkus.hibernate.orm.panache.kotlin.PanacheEntityBase
@@ -41,24 +40,26 @@ class TestAnalogs {
fun testPanacheEntityBase() {
val javaMethods = map(JavaPanacheEntityBase::class).methods
val kotlinMethods = map(PanacheEntityBase::class).methods
- val companionMethods = map(PanacheCompanionBase::class,
- ByteCodeType(PanacheEntityBase::class.java)).methods
+ val companionMethods = map(
+ PanacheCompanionBase::class,
+ ByteCodeType(PanacheEntityBase::class.java)
+ ).methods
val implemented = mutableListOf()
javaMethods
- .forEach {
- if (!it.isStatic()) {
- if (it in kotlinMethods) {
- kotlinMethods -= it
- implemented += it
- }
- } else {
- if (it in companionMethods) {
- companionMethods -= it
- implemented += it
- }
+ .forEach {
+ if (!it.isStatic()) {
+ if (it in kotlinMethods) {
+ kotlinMethods -= it
+ implemented += it
+ }
+ } else {
+ if (it in companionMethods) {
+ companionMethods -= it
+ implemented += it
}
}
+ }
javaMethods.removeIf {
it.name.endsWith("Optional") || it in implemented
}
@@ -78,9 +79,8 @@ class TestAnalogs {
}
}
-
private fun KClass<*>.bytes() =
- java.classLoader.getResourceAsStream(qualifiedName.toString().replace(".", "/") + ".class")
+ java.classLoader.getResourceAsStream(qualifiedName.toString().replace(".", "/") + ".class")
private fun compare(javaClass: AnalogVisitor, kotlinClass: AnalogVisitor, allowList: List = listOf()) {
val javaMethods = javaClass.methods
@@ -88,12 +88,12 @@ class TestAnalogs {
val implemented = mutableListOf()
javaMethods
- .forEach {
- if (it in kotlinMethods) {
- kotlinMethods -= it
- implemented += it
- }
+ .forEach {
+ if (it in kotlinMethods) {
+ kotlinMethods -= it
+ implemented += it
}
+ }
javaMethods.removeIf {
it.name.endsWith("Optional") ||
@@ -112,29 +112,34 @@ class TestAnalogs {
private fun methods(label: String, methods: List) {
println("$label: ")
methods.toSortedSet(compareBy { it.toString() })
- .forEach {
- println(it)
- }
+ .forEach {
+ println(it)
+ }
}
}
private fun List.byLine(): String {
val map = map { it.toString() }
return map
- .joinToString("\n" )
+ .joinToString("\n")
}
class AnalogVisitor(val erasedType: ByteCodeType? = null) : ClassVisitor(Gizmo.ASM_API_VERSION) {
val methods = mutableListOf()
- override fun visitMethod(access: Int, name: String, descriptor: String, signature: String?,
- exceptions: Array?): MethodVisitor? {
+ override fun visitMethod(
+ access: Int,
+ name: String,
+ descriptor: String,
+ signature: String?,
+ exceptions: Array?
+ ): MethodVisitor? {
if (name != "") {
val type = descriptor.substringAfterLast(")").trim()
var parameters = descriptor.substring(
descriptor.indexOf("("),
descriptor.lastIndexOf(")") + 1
)
- erasedType?.let { type->
+ erasedType?.let { type ->
parameters = parameters.replace(type.descriptor(), OBJECT.descriptor())
}
@@ -149,7 +154,7 @@ class Method(val access: Int, val name: String, val type: String, val parameters
override fun toString(): String {
return (if (isStatic()) "static " else "") + "fun ${name}$parameters" +
- (if (type.isNotBlank()) ": $type" else "") //+
+ (if (type.isNotBlank()) ": $type" else "") // +
}
override fun equals(other: Any?): Boolean {
@@ -168,7 +173,6 @@ class Method(val access: Int, val name: String, val type: String, val parameters
result = 31 * result + parameters.hashCode()
return result
}
-
}
fun Int.matches(mask: Int) = (this and mask) == mask
diff --git a/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/PanacheMongoCompanion.kt b/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/PanacheMongoCompanion.kt
index 39f4fab589413..13ef0c144a981 100644
--- a/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/PanacheMongoCompanion.kt
+++ b/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/PanacheMongoCompanion.kt
@@ -15,7 +15,7 @@ import java.util.stream.Stream
*
* @param Entity the entity type
*/
-interface PanacheMongoCompanion: PanacheMongoCompanionBase
+interface PanacheMongoCompanion : PanacheMongoCompanionBase
/**
* Define persistence and query methods for an Entity with a type of Id
@@ -23,7 +23,7 @@ interface PanacheMongoCompanion: PanacheMongoCo
* @param Entity the entity type
* @param Id the ID type
*/
-interface PanacheMongoCompanionBase {
+interface PanacheMongoCompanionBase {
/**
* Find an entity of this type by ID.
*
@@ -45,7 +45,7 @@ interface PanacheMongoCompanionBase {
*/
@GenerateBridge
fun find(query: String, vararg params: Any?): PanacheQuery =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities using a query and the given sort options with optional indexed parameters.
@@ -60,7 +60,7 @@ interface PanacheMongoCompanionBase {
*/
@GenerateBridge
fun find(query: String, sort: Sort, vararg params: Any?): PanacheQuery =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities using a query, with named parameters.
@@ -74,7 +74,7 @@ interface PanacheMongoCompanionBase {
*/
@GenerateBridge
fun find(query: String, params: Map): PanacheQuery =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities using a query and the given sort options, with named parameters.
@@ -89,7 +89,7 @@ interface PanacheMongoCompanionBase {
*/
@GenerateBridge
fun find(query: String, sort: Sort, params: Map): PanacheQuery =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities using a query, with named parameters.
@@ -103,7 +103,7 @@ interface PanacheMongoCompanionBase {
*/
@GenerateBridge
fun find(query: String, params: Parameters): PanacheQuery =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities using a query and the given sort options with named parameters.
@@ -118,7 +118,7 @@ interface PanacheMongoCompanionBase {
*/
@GenerateBridge
fun find(query: String, sort: Sort, params: Parameters): PanacheQuery =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities using a BSON query.
@@ -196,7 +196,7 @@ interface PanacheMongoCompanionBase {
*/
@GenerateBridge
fun list(query: String, sort: Sort, vararg params: Any?): List =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities matching a query, with named parameters.
@@ -226,7 +226,7 @@ interface PanacheMongoCompanionBase {
*/
@GenerateBridge
fun list(query: String, sort: Sort, params: Map): List =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities matching a query, with named parameters.
@@ -256,7 +256,7 @@ interface PanacheMongoCompanionBase {
*/
@GenerateBridge
fun list(query: String, sort: Sort, params: Parameters): List =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities using a BSON query.
@@ -338,7 +338,7 @@ interface PanacheMongoCompanionBase {
*/
@GenerateBridge
fun stream(query: String, sort: Sort, vararg params: Any?): Stream =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities matching a query, with named parameters.
@@ -353,7 +353,7 @@ interface PanacheMongoCompanionBase {
*/
@GenerateBridge
fun stream(query: String, params: Map): Stream =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities matching a query and the given sort options, with named parameters.
@@ -369,7 +369,7 @@ interface PanacheMongoCompanionBase {
*/
@GenerateBridge
fun stream(query: String, sort: Sort, params: Map): Stream =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities matching a query, with named parameters.
@@ -399,7 +399,7 @@ interface PanacheMongoCompanionBase {
*/
@GenerateBridge
fun stream(query: String, sort: Sort, params: Parameters): Stream =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities using a BSON query.
@@ -668,7 +668,7 @@ interface PanacheMongoCompanionBase {
*/
@GenerateBridge
fun update(update: String, params: Map): io.quarkus.mongodb.panache.common.PanacheUpdate =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Update all entities of this type by the given update document, with named parameters.
@@ -694,7 +694,7 @@ interface PanacheMongoCompanionBase {
*/
@GenerateBridge
fun update(update: Document): io.quarkus.mongodb.panache.common.PanacheUpdate = throw INSTANCE.implementationInjectionMissing()
-
+
/**
* Allow to access the underlying Mongo Collection.
*
diff --git a/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/PanacheMongoEntity.kt b/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/PanacheMongoEntity.kt
index 493d67bc67794..fb303c0f95306 100644
--- a/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/PanacheMongoEntity.kt
+++ b/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/PanacheMongoEntity.kt
@@ -11,7 +11,7 @@ import org.bson.types.ObjectId
* instead, and write your own ID field. You will still get auto-generated accessors and
* all the useful methods.
*
- * @see [PanacheMongoEntityBase]
+ * @see [PanacheMongoEntityBase]
*/
abstract class PanacheMongoEntity : PanacheMongoEntityBase() {
/**
@@ -28,4 +28,4 @@ abstract class PanacheMongoEntity : PanacheMongoEntityBase() {
* @return the class type and ID type
*/
override fun toString(): String = "${this.javaClass.simpleName}<$id>"
-}
\ No newline at end of file
+}
diff --git a/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/PanacheMongoEntityBase.kt b/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/PanacheMongoEntityBase.kt
index 5642a7ffdf8bd..0ea741aba9abd 100644
--- a/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/PanacheMongoEntityBase.kt
+++ b/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/PanacheMongoEntityBase.kt
@@ -7,7 +7,7 @@ import io.quarkus.mongodb.panache.kotlin.runtime.KotlinMongoOperations.Companion
* to all their public fields, as well as a lot of useful methods. Unless you have a custom ID strategy, you
* should not extend this class directly but extend [PanacheMongoEntity] instead.
*
- * @see [PanacheMongoEntity]
+ * @see [PanacheMongoEntity]
*/
@Suppress("unused")
abstract class PanacheMongoEntityBase {
@@ -40,4 +40,4 @@ abstract class PanacheMongoEntityBase {
fun delete() {
INSTANCE.delete(this)
}
-}
\ No newline at end of file
+}
diff --git a/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/PanacheMongoRepository.kt b/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/PanacheMongoRepository.kt
index 8dd5ebfeb5399..13593dd46e1be 100644
--- a/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/PanacheMongoRepository.kt
+++ b/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/PanacheMongoRepository.kt
@@ -10,4 +10,4 @@ import org.bson.types.ObjectId
*
* @param Entity The type of entity to operate on
*/
-interface PanacheMongoRepository : PanacheMongoRepositoryBase
\ No newline at end of file
+interface PanacheMongoRepository : PanacheMongoRepositoryBase
diff --git a/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/PanacheMongoRepositoryBase.kt b/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/PanacheMongoRepositoryBase.kt
index ba29e22d8a65f..09592a6360315 100644
--- a/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/PanacheMongoRepositoryBase.kt
+++ b/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/PanacheMongoRepositoryBase.kt
@@ -4,12 +4,12 @@ package io.quarkus.mongodb.panache.kotlin
import com.mongodb.client.MongoCollection
import com.mongodb.client.MongoDatabase
+import io.quarkus.mongodb.panache.kotlin.runtime.KotlinMongoOperations.Companion.INSTANCE
import io.quarkus.panache.common.Parameters
import io.quarkus.panache.common.Sort
import io.quarkus.panache.common.impl.GenerateBridge
import org.bson.Document
import java.util.stream.Stream
-import io.quarkus.mongodb.panache.kotlin.runtime.KotlinMongoOperations.Companion.INSTANCE
/**
* Represents a Repository for a specific type of entity [Entity], with an ID type
@@ -21,7 +21,7 @@ import io.quarkus.mongodb.panache.kotlin.runtime.KotlinMongoOperations.Companion
* @param Id The ID type of the entity
* @see [PanacheMongoRepository]
*/
-interface PanacheMongoRepositoryBase {
+interface PanacheMongoRepositoryBase {
/**
* Persist the given entity in the database.
* This will set its ID field if not already set.
@@ -72,7 +72,7 @@ interface PanacheMongoRepositoryBase {
*/
@GenerateBridge
fun find(query: String, vararg params: Any?): PanacheQuery =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities using a query and the given sort options, with optional indexed parameters.
@@ -86,7 +86,7 @@ interface PanacheMongoRepositoryBase {
*/
@GenerateBridge
fun find(query: String, sort: Sort, vararg params: Any?): PanacheQuery =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities using a query, with named parameters.
@@ -99,7 +99,7 @@ interface PanacheMongoRepositoryBase {
*/
@GenerateBridge
fun find(query: String, params: Map): PanacheQuery =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities using a query and the given sort options, with named parameters.
@@ -113,7 +113,7 @@ interface PanacheMongoRepositoryBase {
*/
@GenerateBridge
fun find(query: String, sort: Sort, params: Map): PanacheQuery =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities using a query, with named parameters.
@@ -126,7 +126,7 @@ interface PanacheMongoRepositoryBase {
*/
@GenerateBridge
fun find(query: String, params: Parameters): PanacheQuery =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities using a query and the given sort options, with named parameters.
@@ -140,7 +140,7 @@ interface PanacheMongoRepositoryBase {
*/
@GenerateBridge
fun find(query: String, sort: Sort, params: Parameters): PanacheQuery =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities using a BSON query.
@@ -212,7 +212,7 @@ interface PanacheMongoRepositoryBase {
*/
@GenerateBridge
fun list(query: String, sort: Sort, vararg params: Any?): List =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities matching a query, with named parameters.
@@ -240,7 +240,7 @@ interface PanacheMongoRepositoryBase {
*/
@GenerateBridge
fun list(query: String, sort: Sort, params: Map): List =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities matching a query, with named parameters.
@@ -268,7 +268,7 @@ interface PanacheMongoRepositoryBase {
*/
@GenerateBridge
fun list(query: String, sort: Sort, params: Parameters): List =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities using a BSON query.
@@ -344,7 +344,7 @@ interface PanacheMongoRepositoryBase {
*/
@GenerateBridge
fun stream(query: String, sort: Sort, vararg params: Any?): Stream =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities matching a query, with named parameters.
@@ -358,7 +358,7 @@ interface PanacheMongoRepositoryBase {
*/
@GenerateBridge
fun stream(query: String, params: Map): Stream =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities matching a query and the given sort options, with named parameters.
@@ -373,7 +373,7 @@ interface PanacheMongoRepositoryBase {
*/
@GenerateBridge
fun stream(query: String, sort: Sort, params: Map): Stream =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities matching a query, with named parameters.
@@ -401,7 +401,7 @@ interface PanacheMongoRepositoryBase {
*/
@GenerateBridge
fun stream(query: String, sort: Sort, params: Parameters): Stream =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities using a BSON query.
@@ -619,7 +619,7 @@ interface PanacheMongoRepositoryBase {
* @param entities the entities to update
*/
fun persistOrUpdate(firstEntity: Entity, vararg entities: Entity) =
- INSTANCE.persistOrUpdate(firstEntity, *entities)
+ INSTANCE.persistOrUpdate(firstEntity, *entities)
/**
* Update all entities of this type by the given update document, with optional indexed parameters.
@@ -644,7 +644,7 @@ interface PanacheMongoRepositoryBase {
*/
@GenerateBridge
fun update(update: String, params: Map): io.quarkus.mongodb.panache.common.PanacheUpdate =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Update all entities of this type by the given update document, with named parameters.
diff --git a/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/PanacheQuery.kt b/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/PanacheQuery.kt
index 1885a61567435..4f6251b0db3f8 100644
--- a/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/PanacheQuery.kt
+++ b/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/PanacheQuery.kt
@@ -15,14 +15,14 @@ import java.util.stream.Stream
*
* @param Entity The entity type being queried
*/
-interface PanacheQuery {
+interface PanacheQuery {
/**
* Defines a projection class: the getters, and the public fields, will be used to restrict which fields should be
* retrieved from the database.
*
* @return a new query with the same state as the previous one (params, page, range, ...).
*/
- fun project(type: Class): PanacheQuery
+ fun project(type: Class): PanacheQuery
/**
* Sets the current page.
@@ -46,7 +46,7 @@ interface PanacheQuery {
*
* @return this query, modified
* @throws UnsupportedOperationException if a page hasn't been set or if a range is already set
- * @see [previousPage]
+ * @see [previousPage]
*/
fun nextPage(): PanacheQuery
@@ -55,7 +55,7 @@ interface PanacheQuery {
*
* @return this query, modified
* @throws UnsupportedOperationException if a page hasn't been set or if a range is already set
- * @see [nextPage]
+ * @see [nextPage]
*/
fun previousPage(): PanacheQuery
@@ -64,7 +64,7 @@ interface PanacheQuery {
*
* @return this query, modified
* @throws UnsupportedOperationException if a page hasn't been set or if a range is already set
- * @see [lastPage]
+ * @see [lastPage]
*/
fun firstPage(): PanacheQuery
@@ -73,8 +73,8 @@ interface PanacheQuery {
*
* @return this query, modified
* @throws UnsupportedOperationException if a page hasn't been set or if a range is already set
- * @see [firstPage]
- * @see [count]
+ * @see [firstPage]
+ * @see [count]
*/
fun lastPage(): PanacheQuery
@@ -84,8 +84,8 @@ interface PanacheQuery {
*
* @return true if there is another page to read
* @throws UnsupportedOperationException if a page hasn't been set or if a range is already set
- * @see [hasPreviousPage]
- * @see [count]
+ * @see [hasPreviousPage]
+ * @see [count]
*/
fun hasNextPage(): Boolean
@@ -94,7 +94,7 @@ interface PanacheQuery {
*
* @return true if there is a previous page to read
* @throws UnsupportedOperationException if a page hasn't been set or if a range is already set
- * @see [hasNextPage]
+ * @see [hasNextPage]
*/
fun hasPreviousPage(): Boolean
@@ -155,8 +155,8 @@ interface PanacheQuery {
* Returns the current page of results as a [List].
*
* @return the current page of results as a [List].
- * @see [stream]
- * @see [page]
+ * @see [stream]
+ * @see [page]
*/
fun list(): List
@@ -164,8 +164,8 @@ interface PanacheQuery {
* Returns the current page of results as a [Stream].
*
* @return the current page of results as a [Stream].
- * @see [list]
- * @see [page]
+ * @see [list]
+ * @see [page]
*/
fun stream(): Stream
@@ -174,7 +174,7 @@ interface PanacheQuery {
* a single result.
*
* @return the first result of the current page index, or null if there are no results.
- * @see [singleResult]
+ * @see [singleResult]
*/
fun firstResult(): Entity?
@@ -183,7 +183,7 @@ interface PanacheQuery {
*
* @return the single result
* @throws PanacheQueryException if there is not exactly one result.
- * @see [firstResult]
+ * @see [firstResult]
*/
fun singleResult(): Entity?
-}
\ No newline at end of file
+}
diff --git a/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/reactive/ReactivePanacheMongoCompanion.kt b/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/reactive/ReactivePanacheMongoCompanion.kt
index 1940f2c8a0ce0..b42ee4c2123d2 100644
--- a/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/reactive/ReactivePanacheMongoCompanion.kt
+++ b/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/reactive/ReactivePanacheMongoCompanion.kt
@@ -17,8 +17,8 @@ import java.util.stream.Stream
*
* @param Entity the entity type
*/
-interface ReactivePanacheMongoCompanion
- : ReactivePanacheMongoCompanionBase
+interface ReactivePanacheMongoCompanion :
+ ReactivePanacheMongoCompanionBase
/**
* Define persistence and query methods for an Entity with a type of Id
@@ -26,7 +26,7 @@ interface ReactivePanacheMongoCompanion
* @param Entity the entity type
* @param Id the ID type
*/
-interface ReactivePanacheMongoCompanionBase {
+interface ReactivePanacheMongoCompanionBase {
/**
* Find an entity of this type by ID.
*
@@ -713,7 +713,7 @@ interface ReactivePanacheMongoCompanionBase =
- INSTANCE.persistOrUpdate(firstEntity, *entities)
+ INSTANCE.persistOrUpdate(firstEntity, *entities)
/**
* Update all entities of this type by the given update document, with optional indexed parameters.
@@ -766,7 +766,7 @@ interface ReactivePanacheMongoCompanionBase : ReactivePanacheMongoRepositoryBase
\ No newline at end of file
+interface ReactivePanacheMongoRepository : ReactivePanacheMongoRepositoryBase
diff --git a/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/reactive/ReactivePanacheMongoRepositoryBase.kt b/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/reactive/ReactivePanacheMongoRepositoryBase.kt
index dc001eb1de3ad..0fd68262b47b8 100644
--- a/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/reactive/ReactivePanacheMongoRepositoryBase.kt
+++ b/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/reactive/ReactivePanacheMongoRepositoryBase.kt
@@ -23,7 +23,7 @@ import java.util.stream.Stream
* @param Id The ID type of the entity
* @see [ReactivePanacheMongoRepository]
*/
-interface ReactivePanacheMongoRepositoryBase {
+interface ReactivePanacheMongoRepositoryBase {
/**
* Persist the given entity in the database.
* This will set its ID field if not already set.
@@ -74,7 +74,7 @@ interface ReactivePanacheMongoRepositoryBase {
*/
@GenerateBridge
fun find(query: String, vararg params: Any?): ReactivePanacheQuery =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities using a query and the given sort options, with optional indexed parameters.
@@ -88,7 +88,7 @@ interface ReactivePanacheMongoRepositoryBase {
*/
@GenerateBridge
fun find(query: String, sort: Sort, vararg params: Any?): ReactivePanacheQuery =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities using a query, with named parameters.
@@ -101,7 +101,7 @@ interface ReactivePanacheMongoRepositoryBase {
*/
@GenerateBridge
fun find(query: String, params: Map): ReactivePanacheQuery =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities using a query and the given sort options, with named parameters.
@@ -115,7 +115,7 @@ interface ReactivePanacheMongoRepositoryBase {
*/
@GenerateBridge
fun find(query: String, sort: Sort, params: Map): ReactivePanacheQuery =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities using a query, with named parameters.
@@ -128,7 +128,7 @@ interface ReactivePanacheMongoRepositoryBase {
*/
@GenerateBridge
fun find(query: String, params: Parameters): ReactivePanacheQuery =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities using a query and the given sort options, with named parameters.
@@ -142,7 +142,7 @@ interface ReactivePanacheMongoRepositoryBase {
*/
@GenerateBridge
fun find(query: String, sort: Sort, params: Parameters): ReactivePanacheQuery =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities using a BSON query.
@@ -166,7 +166,7 @@ interface ReactivePanacheMongoRepositoryBase {
*/
@GenerateBridge
fun find(query: Document, sort: Document): ReactivePanacheQuery =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find all entities of this type.
@@ -215,7 +215,7 @@ interface ReactivePanacheMongoRepositoryBase {
*/
@GenerateBridge
fun list(query: String, sort: Sort, vararg params: Any?): Uni> =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities matching a query, with named parameters.
@@ -229,7 +229,7 @@ interface ReactivePanacheMongoRepositoryBase {
*/
@GenerateBridge
fun list(query: String, params: Map): Uni> =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities matching a query and the given sort options, with named parameters.
@@ -244,7 +244,7 @@ interface ReactivePanacheMongoRepositoryBase {
*/
@GenerateBridge
fun list(query: String, sort: Sort, params: Map): Uni> =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities matching a query, with named parameters.
@@ -347,7 +347,7 @@ interface ReactivePanacheMongoRepositoryBase {
*/
@GenerateBridge
fun stream(query: String, sort: Sort, vararg params: Any?): Multi =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities matching a query, with named parameters.
@@ -361,7 +361,7 @@ interface ReactivePanacheMongoRepositoryBase {
*/
@GenerateBridge
fun stream(query: String, params: Map): Multi =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities matching a query and the given sort options, with named parameters.
@@ -376,7 +376,7 @@ interface ReactivePanacheMongoRepositoryBase {
*/
@GenerateBridge
fun stream(query: String, sort: Sort, params: Map): Multi =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities matching a query, with named parameters.
@@ -404,7 +404,7 @@ interface ReactivePanacheMongoRepositoryBase {
*/
@GenerateBridge
fun stream(query: String, sort: Sort, params: Parameters): Multi =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Find entities using a BSON query.
@@ -580,7 +580,7 @@ interface ReactivePanacheMongoRepositoryBase {
* @param entities the entities to insert
*/
fun persist(firstEntity: Entity, vararg entities: Entity): Uni =
- INSTANCE.persist(firstEntity, *entities)
+ INSTANCE.persist(firstEntity, *entities)
/**
* Update all given entities.
@@ -602,7 +602,7 @@ interface ReactivePanacheMongoRepositoryBase {
* @param entities the entities to update
*/
fun update(firstEntity: Entity, vararg entities: Entity): Uni =
- INSTANCE.update(firstEntity, *entities)
+ INSTANCE.update(firstEntity, *entities)
/**
* Persist all given entities or update them if they already exist.
@@ -610,7 +610,7 @@ interface ReactivePanacheMongoRepositoryBase {
* @param entities the entities to update
*/
fun persistOrUpdate(entities: Iterable): Uni =
- INSTANCE.persistOrUpdate(entities)
+ INSTANCE.persistOrUpdate(entities)
/**
* Persist all given entities or update them if they already exist.
@@ -618,7 +618,7 @@ interface ReactivePanacheMongoRepositoryBase {
* @param entities the entities to update
*/
fun persistOrUpdate(entities: Stream): Uni =
- INSTANCE.persistOrUpdate(entities)
+ INSTANCE.persistOrUpdate(entities)
/**
* Persist all given entities or update them if they already exist.
@@ -626,7 +626,7 @@ interface ReactivePanacheMongoRepositoryBase {
* @param entities the entities to update
*/
fun persistOrUpdate(firstEntity: Entity, vararg entities: Entity): Uni =
- INSTANCE.persistOrUpdate(firstEntity, *entities)
+ INSTANCE.persistOrUpdate(firstEntity, *entities)
/**
* Update all entities of this type by the given update document, with optional indexed parameters.
@@ -639,7 +639,7 @@ interface ReactivePanacheMongoRepositoryBase {
*/
@GenerateBridge
fun update(update: String, vararg params: Any?): io.quarkus.mongodb.panache.common.reactive.ReactivePanacheUpdate =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Update all entities of this type by the given update document, with named parameters.
@@ -652,7 +652,7 @@ interface ReactivePanacheMongoRepositoryBase {
*/
@GenerateBridge
fun update(update: String, params: Map): io.quarkus.mongodb.panache.common.reactive.ReactivePanacheUpdate =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Update all entities of this type by the given update document, with named parameters.
@@ -665,7 +665,7 @@ interface ReactivePanacheMongoRepositoryBase {
*/
@GenerateBridge
fun update(update: String, params: Parameters): io.quarkus.mongodb.panache.common.reactive.ReactivePanacheUpdate =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Update all entities of this type by the given BSON update document.
@@ -677,7 +677,7 @@ interface ReactivePanacheMongoRepositoryBase {
*/
@GenerateBridge
fun update(update: Document): io.quarkus.mongodb.panache.common.reactive.ReactivePanacheUpdate =
- throw INSTANCE.implementationInjectionMissing()
+ throw INSTANCE.implementationInjectionMissing()
/**
* Allow to access the underlying Mongo Collection
diff --git a/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/reactive/ReactivePanacheQuery.kt b/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/reactive/ReactivePanacheQuery.kt
index e3cc176e507de..be939bf4cfbc0 100644
--- a/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/reactive/ReactivePanacheQuery.kt
+++ b/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/reactive/ReactivePanacheQuery.kt
@@ -187,4 +187,4 @@ interface ReactivePanacheQuery {
* @see [firstResult]
*/
fun singleResult(): Uni
-}
\ No newline at end of file
+}
diff --git a/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/reactive/runtime/KotlinReactiveMongoOperations.kt b/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/reactive/runtime/KotlinReactiveMongoOperations.kt
index ff70db439f23a..923633458dcf9 100644
--- a/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/reactive/runtime/KotlinReactiveMongoOperations.kt
+++ b/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/reactive/runtime/KotlinReactiveMongoOperations.kt
@@ -1,9 +1,9 @@
package io.quarkus.mongodb.panache.kotlin.reactive.runtime
import io.quarkus.mongodb.panache.common.reactive.ReactivePanacheUpdate
-import io.quarkus.mongodb.panache.kotlin.reactive.ReactivePanacheQuery
import io.quarkus.mongodb.panache.common.reactive.runtime.ReactiveMongoOperations
import io.quarkus.mongodb.panache.common.reactive.runtime.ReactivePanacheUpdateImpl
+import io.quarkus.mongodb.panache.kotlin.reactive.ReactivePanacheQuery
import io.quarkus.mongodb.reactive.ReactiveMongoCollection
import io.smallrye.mutiny.Multi
import io.smallrye.mutiny.Uni
@@ -32,7 +32,7 @@ class KotlinReactiveMongoOperations : ReactiveMongoOperations, query: Document?, sortDoc: Document?) =
- ReactivePanacheQueryImpl(collection, query, sortDoc)
+ ReactivePanacheQueryImpl(collection, query, sortDoc)
/**
* Creates the update implementation
@@ -44,7 +44,7 @@ class KotlinReactiveMongoOperations : ReactiveMongoOperations, entityClass: Class<*>, docUpdate: Document) =
- ReactivePanacheUpdateImpl(this, entityClass, docUpdate, collection)
+ ReactivePanacheUpdateImpl(this, entityClass, docUpdate, collection)
/**
* Extracts the query results in to a List.
diff --git a/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/reactive/runtime/ReactivePanacheQueryImpl.kt b/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/reactive/runtime/ReactivePanacheQueryImpl.kt
index 78ace939995ba..1b16783a54dd2 100644
--- a/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/reactive/runtime/ReactivePanacheQueryImpl.kt
+++ b/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/reactive/runtime/ReactivePanacheQueryImpl.kt
@@ -1,14 +1,14 @@
package io.quarkus.mongodb.panache.kotlin.reactive.runtime
-import io.quarkus.mongodb.panache.common.reactive.runtime.CommonReactivePanacheQueryImpl
-import io.quarkus.mongodb.reactive.ReactiveMongoCollection
-import org.bson.conversions.Bson
-import io.smallrye.mutiny.Uni
import com.mongodb.ReadPreference
import com.mongodb.client.model.Collation
+import io.quarkus.mongodb.panache.common.reactive.runtime.CommonReactivePanacheQueryImpl
import io.quarkus.mongodb.panache.kotlin.reactive.ReactivePanacheQuery
+import io.quarkus.mongodb.reactive.ReactiveMongoCollection
import io.quarkus.panache.common.Page
import io.smallrye.mutiny.Multi
+import io.smallrye.mutiny.Uni
+import org.bson.conversions.Bson
class ReactivePanacheQueryImpl : ReactivePanacheQuery {
private val delegate: CommonReactivePanacheQueryImpl
diff --git a/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/runtime/KotlinMongoOperations.kt b/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/runtime/KotlinMongoOperations.kt
index f3058a83416b0..2fc96350f6dc5 100644
--- a/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/runtime/KotlinMongoOperations.kt
+++ b/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/runtime/KotlinMongoOperations.kt
@@ -3,9 +3,9 @@ package io.quarkus.mongodb.panache.kotlin.runtime
import com.mongodb.client.ClientSession
import com.mongodb.client.MongoCollection
import io.quarkus.mongodb.panache.common.PanacheUpdate
-import io.quarkus.mongodb.panache.kotlin.PanacheQuery
import io.quarkus.mongodb.panache.common.runtime.MongoOperations
import io.quarkus.mongodb.panache.common.runtime.PanacheUpdateImpl
+import io.quarkus.mongodb.panache.kotlin.PanacheQuery
import org.bson.Document
import java.util.stream.Stream
@@ -24,15 +24,13 @@ class KotlinMongoOperations : MongoOperations, PanacheUpdate>()
/**
* Creates the query implementation
- *
- * @param collection the collection to query
+ * * @param collection the collection to query
* @param query the query to base the new query off of
* @param sortDoc the sort document to use
- *
- * @return the new query implementation
+ * * @return the new query implementation
*/
override fun createQuery(collection: MongoCollection<*>, session: ClientSession?, query: Document?, sortDoc: Document?) =
- PanacheQueryImpl(collection, session, query, sortDoc)
+ PanacheQueryImpl(collection, session, query, sortDoc)
/**
* Creates the update implementation
@@ -44,14 +42,12 @@ class KotlinMongoOperations : MongoOperations, PanacheUpdate>()
* @return the new query implementation
*/
override fun createUpdate(collection: MongoCollection<*>, entityClass: Class<*>, docUpdate: Document) =
- PanacheUpdateImpl(this, entityClass, docUpdate, collection)
+ PanacheUpdateImpl(this, entityClass, docUpdate, collection)
/**
* Extracts the query results in to a List.
- *
- * @param query the query to list
- *
- * @return a [List] of the results
+ * * @param query the query to list
+ * * @return a [List] of the results
*/
override fun list(query: PanacheQuery<*>): List<*> = query.list()
diff --git a/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/runtime/PanacheQueryImpl.kt b/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/runtime/PanacheQueryImpl.kt
index 2b8a0400401ba..b0971593bb598 100644
--- a/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/runtime/PanacheQueryImpl.kt
+++ b/extensions/panache/mongodb-panache-kotlin/runtime/src/main/kotlin/io/quarkus/mongodb/panache/kotlin/runtime/PanacheQueryImpl.kt
@@ -4,13 +4,13 @@ import com.mongodb.ReadPreference
import com.mongodb.client.ClientSession
import com.mongodb.client.MongoCollection
import com.mongodb.client.model.Collation
-import io.quarkus.mongodb.panache.kotlin.PanacheQuery
import io.quarkus.mongodb.panache.common.runtime.CommonPanacheQueryImpl
+import io.quarkus.mongodb.panache.kotlin.PanacheQuery
import io.quarkus.panache.common.Page
import org.bson.conversions.Bson
import java.util.stream.Stream
-class PanacheQueryImpl : PanacheQuery {
+class PanacheQueryImpl : PanacheQuery {
private val delegate: CommonPanacheQueryImpl
internal constructor(collection: MongoCollection?, session: ClientSession?, mongoQuery: Bson?, sort: Bson?) {
@@ -21,7 +21,7 @@ class PanacheQueryImpl : PanacheQuery {
this.delegate = delegate
}
- override fun project(type: Class): PanacheQuery {
+ override fun project(type: Class): PanacheQuery {
return PanacheQueryImpl(delegate.project(type))
}
diff --git a/extensions/panache/mongodb-panache-kotlin/runtime/src/test/kotlin/io/quarkus/mongodb/panache/kotlin/TestAnalogs.kt b/extensions/panache/mongodb-panache-kotlin/runtime/src/test/kotlin/io/quarkus/mongodb/panache/kotlin/TestAnalogs.kt
index cf16838d3056b..cdd3305c8b00f 100644
--- a/extensions/panache/mongodb-panache-kotlin/runtime/src/test/kotlin/io/quarkus/mongodb/panache/kotlin/TestAnalogs.kt
+++ b/extensions/panache/mongodb-panache-kotlin/runtime/src/test/kotlin/io/quarkus/mongodb/panache/kotlin/TestAnalogs.kt
@@ -27,7 +27,6 @@ import io.quarkus.mongodb.panache.PanacheMongoEntityBase as JavaPanacheMongoEnti
import io.quarkus.mongodb.panache.PanacheMongoRepository as JavaPanacheMongoRepository
import io.quarkus.mongodb.panache.PanacheMongoRepositoryBase as JavaPanacheMongoRepositoryBase
import io.quarkus.mongodb.panache.PanacheQuery as JavaPanacheQuery
-
import io.quarkus.mongodb.panache.reactive.ReactivePanacheMongoEntity as ReactiveJavaPanacheMongoEntity
import io.quarkus.mongodb.panache.reactive.ReactivePanacheMongoEntityBase as ReactiveJavaPanacheMongoEntityBase
import io.quarkus.mongodb.panache.reactive.ReactivePanacheMongoRepository as ReactiveJavaPanacheMongoRepository
@@ -66,46 +65,48 @@ class TestAnalogs {
compare(ReactiveJavaPanacheMongoEntityBase::class, ReactivePanacheMongoEntityBase::class, ReactivePanacheMongoCompanionBase::class)
}
- private fun compare(javaEntity: KClass<*>,
- kotlinEntity: KClass<*>,
- companion: KClass<*>) {
+ private fun compare(
+ javaEntity: KClass<*>,
+ kotlinEntity: KClass<*>,
+ companion: KClass<*>
+ ) {
val javaMethods = map(javaEntity).methods
val kotlinMethods = map(kotlinEntity).methods
- .filterNot {
- it.name.contains("getId")
- || it.name.contains("setId")
- || it.name.contains("getOperations")
- }
- .toMutableList()
+ .filterNot {
+ it.name.contains("getId") ||
+ it.name.contains("setId") ||
+ it.name.contains("getOperations")
+ }
+ .toMutableList()
val companionMethods = map(companion).methods
val implemented = mutableListOf()
javaMethods
- .forEach {
- if (!it.isStatic()) {
- if (it in kotlinMethods) {
- kotlinMethods -= it
- implemented += it
- }
- } else {
- if (it in companionMethods) {
- companionMethods -= it
- implemented += it
- }
+ .forEach {
+ if (!it.isStatic()) {
+ if (it in kotlinMethods) {
+ kotlinMethods -= it
+ implemented += it
+ }
+ } else {
+ if (it in companionMethods) {
+ companionMethods -= it
+ implemented += it
}
}
+ }
javaMethods.removeIf {
it.name == "findByIdOptional" ||
- it in implemented
+ it in implemented
}
methods("javaMethods", javaMethods)
methods("kotlinMethods", kotlinMethods)
methods("companionMethods", companionMethods)
- assertTrue(javaMethods.isEmpty(), "New methods not implemented: ${javaMethods}")
- assertTrue(kotlinMethods.isEmpty(), "Old methods not removed: ${kotlinMethods}")
- assertTrue(companionMethods.isEmpty(), "Old methods not removed: ${companionMethods}")
+ assertTrue(javaMethods.isEmpty(), "New methods not implemented: $javaMethods")
+ assertTrue(kotlinMethods.isEmpty(), "Old methods not removed: $kotlinMethods")
+ assertTrue(companionMethods.isEmpty(), "Old methods not removed: $companionMethods")
}
private fun map(type: KClass<*>): AnalogVisitor {
@@ -114,9 +115,8 @@ class TestAnalogs {
}
}
-
private fun KClass<*>.bytes() =
- java.classLoader.getResourceAsStream(qualifiedName.toString().replace(".", "/") + ".class")
+ java.classLoader.getResourceAsStream(qualifiedName.toString().replace(".", "/") + ".class")
private fun compare(javaClass: AnalogVisitor, kotlinClass: AnalogVisitor, allowList: List = listOf()) {
val javaMethods = javaClass.methods
@@ -124,20 +124,20 @@ class TestAnalogs {
val implemented = mutableListOf()
javaMethods
- .forEach {
- if (it in kotlinMethods) {
- kotlinMethods -= it
- implemented += it
- }
+ .forEach {
+ if (it in kotlinMethods) {
+ kotlinMethods -= it
+ implemented += it
}
+ }
javaMethods.removeIf {
it.name in allowList ||
- it in implemented
+ it in implemented
}
- assertTrue(javaMethods.isEmpty(), "New methods not implemented: ${javaMethods}")
- assertTrue(kotlinMethods.isEmpty(), "Old methods not removed: ${kotlinMethods}")
+ assertTrue(javaMethods.isEmpty(), "New methods not implemented: $javaMethods")
+ assertTrue(kotlinMethods.isEmpty(), "Old methods not removed: $kotlinMethods")
}
@Suppress("unused")
@@ -145,9 +145,9 @@ class TestAnalogs {
if (methods.isNotEmpty()) {
println("$label: ")
methods
- .forEach {
- println(it)
- }
+ .forEach {
+ println(it)
+ }
println()
}
}
@@ -155,13 +155,18 @@ class TestAnalogs {
class AnalogVisitor : ClassVisitor(Gizmo.ASM_API_VERSION) {
val erasures = mapOf(
- getType(PanacheMongoEntityBase::class.java).descriptor to getType(Object::class.java).descriptor,
- getType(ReactivePanacheMongoEntityBase::class.java).descriptor to getType(Object::class.java).descriptor
+ getType(PanacheMongoEntityBase::class.java).descriptor to getType(Object::class.java).descriptor,
+ getType(ReactivePanacheMongoEntityBase::class.java).descriptor to getType(Object::class.java).descriptor
)
val methods = mutableListOf()
- override fun visitMethod(access: Int, name: String, descriptor: String, signature: String?,
- exceptions: Array?): MethodVisitor? {
+ override fun visitMethod(
+ access: Int,
+ name: String,
+ descriptor: String,
+ signature: String?,
+ exceptions: Array?
+ ): MethodVisitor? {
if (name != "" && name != "" && !descriptor.endsWith(ByteCodeType(Optional::class.java).descriptor())) {
val method = Method(access, name, erase(getReturnType(descriptor)), erase(getArgumentTypes(descriptor)))
methods += method
@@ -171,9 +176,11 @@ class AnalogVisitor : ClassVisitor(Gizmo.ASM_API_VERSION) {
private fun erase(type: Type): String {
var value = type.descriptor
- erasures.entries.forEach(Consumer {
- value = value.replace(it.key, it.value)
- })
+ erasures.entries.forEach(
+ Consumer {
+ value = value.replace(it.key, it.value)
+ }
+ )
return value
}
@@ -184,8 +191,8 @@ class Method(val access: Int, val name: String, val type: String, val parameters
fun isStatic() = access.matches(Opcodes.ACC_STATIC)
override fun toString(): String {
- return (if (isStatic()) "static " else "") + "fun ${name}(${parameters.joinToString(", ")})" +
- (if (type != Unit::class.qualifiedName) ": $type" else "")
+ return (if (isStatic()) "static " else "") + "fun $name(${parameters.joinToString(", ")})" +
+ (if (type != Unit::class.qualifiedName) ": $type" else "")
}
override fun equals(other: Any?): Boolean {
@@ -204,7 +211,6 @@ class Method(val access: Int, val name: String, val type: String, val parameters
result = 31 * result + parameters.hashCode()
return result
}
-
}
fun Int.matches(mask: Int) = (this and mask) == mask
@@ -227,4 +233,4 @@ fun Int.accDecode(): List {
}
}
return decode
-}
\ No newline at end of file
+}
diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-kotlin-serialization-common/runtime/src/main/kotlin/io/quarkus/kotlin/serialization/KotlinSerializerRecorder.kt b/extensions/resteasy-reactive/quarkus-resteasy-reactive-kotlin-serialization-common/runtime/src/main/kotlin/io/quarkus/kotlin/serialization/KotlinSerializerRecorder.kt
index 26038b0002f4c..1ef4e89d25acb 100644
--- a/extensions/resteasy-reactive/quarkus-resteasy-reactive-kotlin-serialization-common/runtime/src/main/kotlin/io/quarkus/kotlin/serialization/KotlinSerializerRecorder.kt
+++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-kotlin-serialization-common/runtime/src/main/kotlin/io/quarkus/kotlin/serialization/KotlinSerializerRecorder.kt
@@ -3,7 +3,6 @@ package io.quarkus.kotlin.serialization
import io.quarkus.runtime.annotations.Recorder
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.json.Json
-import kotlinx.serialization.modules.EmptySerializersModule
import java.util.function.Supplier
@Recorder
diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-kotlin-serialization/runtime/src/main/kotlin/io/quarkus/kotlin/serialization/KotlinSerializationMessageBodyReader.kt b/extensions/resteasy-reactive/quarkus-resteasy-reactive-kotlin-serialization/runtime/src/main/kotlin/io/quarkus/kotlin/serialization/KotlinSerializationMessageBodyReader.kt
index b5a99f7892b61..1631aaf5b4822 100644
--- a/extensions/resteasy-reactive/quarkus-resteasy-reactive-kotlin-serialization/runtime/src/main/kotlin/io/quarkus/kotlin/serialization/KotlinSerializationMessageBodyReader.kt
+++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-kotlin-serialization/runtime/src/main/kotlin/io/quarkus/kotlin/serialization/KotlinSerializationMessageBodyReader.kt
@@ -11,7 +11,6 @@ import org.jboss.resteasy.reactive.server.spi.ServerMessageBodyReader
import org.jboss.resteasy.reactive.server.spi.ServerRequestContext
import java.io.InputStream
import java.lang.reflect.Type
-import javax.inject.Inject
import javax.ws.rs.core.MediaType
import javax.ws.rs.core.MultivaluedMap
@@ -39,7 +38,8 @@ class KotlinSerializationMessageBodyReader(private val json: Json) : AbstractJso
@ExperimentalSerializationApi
private fun doReadFrom(type: Class, entityStream: InputStream): Any? {
- return if (StreamUtil.isEmpty(entityStream)) null else
+ return if (StreamUtil.isEmpty(entityStream)) null else {
json.decodeFromStream(serializer(type), entityStream)
+ }
}
}
diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-kotlin-serialization/runtime/src/main/kotlin/io/quarkus/kotlin/serialization/KotlinSerializationMessageBodyWriter.kt b/extensions/resteasy-reactive/quarkus-resteasy-reactive-kotlin-serialization/runtime/src/main/kotlin/io/quarkus/kotlin/serialization/KotlinSerializationMessageBodyWriter.kt
index 670449695565d..134e5592e7ad6 100644
--- a/extensions/resteasy-reactive/quarkus-resteasy-reactive-kotlin-serialization/runtime/src/main/kotlin/io/quarkus/kotlin/serialization/KotlinSerializationMessageBodyWriter.kt
+++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-kotlin-serialization/runtime/src/main/kotlin/io/quarkus/kotlin/serialization/KotlinSerializationMessageBodyWriter.kt
@@ -10,7 +10,6 @@ import org.jboss.resteasy.reactive.server.spi.ServerRequestContext
import java.io.OutputStream
import java.lang.reflect.Type
import java.nio.charset.StandardCharsets
-import javax.inject.Inject
import javax.ws.rs.Produces
import javax.ws.rs.core.MediaType
import javax.ws.rs.core.MultivaluedMap
@@ -19,14 +18,19 @@ import javax.ws.rs.core.MultivaluedMap
@OptIn(ExperimentalSerializationApi::class)
class KotlinSerializationMessageBodyWriter(private val json: Json) : AllWriteableMessageBodyWriter() {
override fun writeTo(
- o: Any, type: Class<*>, genericType: Type, annotations: Array, mediaType: MediaType,
- httpHeaders: MultivaluedMap