Repository: quarkusio/quarkus
Issue: Misleading/Erroneous signatures in Panache Hibernate Kotlin 

**Describe the bug**
Several signatures in the `PanacheCompanion` indicate that the result of function call may be `null`, e.g. `PanacheCompanion<Id, Entity>.findById(id: Id): Entity?` or `PanacheQuery<Entity>.singleResult(): Entity?`.

**Expected behavior**
Invoking a function with a nullable result type returns `null` instead of throwing an exception; like e.g. `PanacheQuery<Entity>.firstResult(): Entity?`.

**Actual behavior**
```
javax.persistence.NoResultException: No entity found for query
	at org.hibernate.query.internal.AbstractProducedQuery.getSingleResult(AbstractProducedQuery.java:1583)
	at io.quarkus.hibernate.orm.panache.common.runtime.CommonPanacheQueryImpl.singleResult(CommonPanacheQueryImpl.java:299)
	at io.quarkus.hibernate.orm.panache.kotlin.runtime.PanacheQueryImpl.singleResult(PanacheQueryImpl.java:171)
```

**Environment (please complete the following information):**
 - Output of `uname -a` or `ver`: 
 - Output of `java -version`: 
```
openjdk version "11.0.8" 2020-07-14
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.8+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.8+10, mixed mode)
```
 - GraalVM version (if different from Java): 
 - Quarkus version or git rev: any version with Panache Kotlin support
 - Build tool (ie. output of `mvnw --version` or `gradlew --version`): 


Changed files:
extensions/panache/hibernate-orm-panache-kotlin/runtime/src/main/kotlin/io/quarkus/hibernate/orm/panache/kotlin/PanacheQuery.kt
integration-tests/hibernate-orm-panache-kotlin/src/main/kotlin/io/quarkus/it/panache/kotlin/TestEndpoint.kt

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 e2995b7c8c2..c0e4e12b009 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
@@ -239,5 +239,5 @@ interface PanacheQuery<Entity: Any> {
      * @throws NonUniqueResultException if there are more than one result
      * @see [PanacheQuery.firstResult]
      */
-    fun singleResult(): Entity?
+    fun singleResult(): Entity
 }
\\ No newline at end of file
diff --git a/integration-tests/hibernate-orm-panache-kotlin/src/main/kotlin/io/quarkus/it/panache/kotlin/TestEndpoint.kt b/integration-tests/hibernate-orm-panache-kotlin/src/main/kotlin/io/quarkus/it/panache/kotlin/TestEndpoint.kt
index 3ecd18bbbbc..ac96a93f858 100644
--- a/integration-tests/hibernate-orm-panache-kotlin/src/main/kotlin/io/quarkus/it/panache/kotlin/TestEndpoint.kt
+++ b/integration-tests/hibernate-orm-panache-kotlin/src/main/kotlin/io/quarkus/it/panache/kotlin/TestEndpoint.kt
@@ -9,10 +9,10 @@ import org.hibernate.engine.spi.SelfDirtinessTracker
 import org.hibernate.jpa.QueryHints
 import org.junit.jupiter.api.Assertions
 import org.junit.jupiter.api.fail
-import org.wildfly.common.Assert
 import java.lang.UnsupportedOperationException
 import java.lang.reflect.Field
 import java.lang.reflect.Method
+import java.util.UUID
 import java.util.stream.Collectors
 import java.util.stream.Stream
 import javax.inject.Inject
@@ -38,6 +38,16 @@ class TestEndpoint {
     @Path("model")
     @Transactional
     fun testModel(): String {
+        Assertions.assertDoesNotThrow {
+            Person.findById(Long.MIN_VALUE)
+        }
+        Assertions.assertDoesNotThrow {
+            Person.find("name = ?1", UUID.randomUUID().toString()).firstResult()
+        }
+        Assertions.assertThrows(NoResultException::class.java, {
+            Person.find("name = ?1", UUID.randomUUID().toString()).singleResult()
+        })
+
         var persons: List<Person> = Person.findAll().list()
         Assertions.assertEquals(0, persons.size)
 
@@ -970,15 +980,15 @@ class TestEndpoint {
 
         // Ensure that any JAX-B annotations are properly moved to generated getters
         var m: Method = JAXBEntity::class.java.getMethod("getNamedAnnotatedProp")
-        var anno = m.getAnnotation(XmlAttribute::class.java)
-        Assertions.assertNotNull(anno)
-        Assertions.assertEquals("Named", anno.name)
+        var annotation = m.getAnnotation(XmlAttribute::class.java)
+        Assertions.assertNotNull(annotation)
+        Assertions.assertEquals("Named", annotation.name)
         Assertions.assertNull(m.getAnnotation(XmlTransient::class.java))
 
         m = JAXBEntity::class.java.getMethod("getDefaultAnnotatedProp")
-        anno = m.getAnnotation(XmlAttribute::class.java)
-        Assertions.assertNotNull(anno)
-        Assertions.assertEquals("##default", anno.name)
+        annotation = m.getAnnotation(XmlAttribute::class.java)
+        Assertions.assertNotNull(annotation)
+        Assertions.assertEquals("##default", annotation.name)
         Assertions.assertNull(m.getAnnotation(XmlTransient::class.java))
 
         m = JAXBEntity::class.java.getMethod("getUnAnnotatedProp")
@@ -991,12 +1001,12 @@ class TestEndpoint {
 
         m = JAXBEntity::class.java.getMethod("getArrayAnnotatedProp")
         Assertions.assertNull(m.getAnnotation(XmlTransient::class.java))
-        val elementsAnno = m.getAnnotation(XmlElements::class.java)
-        Assertions.assertNotNull(elementsAnno)
-        Assertions.assertNotNull(elementsAnno.value)
-        Assertions.assertEquals(2, elementsAnno.value.size)
-        Assertions.assertEquals("array1", elementsAnno.value.get(0).name)
-        Assertions.assertEquals("array2", elementsAnno.value.get(1).name)
+        val elementsAnnotation = m.getAnnotation(XmlElements::class.java)
+        Assertions.assertNotNull(elementsAnnotation)
+        Assertions.assertNotNull(elementsAnnotation.value)
+        Assertions.assertEquals(2, elementsAnnotation.value.size)
+        Assertions.assertEquals("array1", elementsAnnotation.value[0].name)
+        Assertions.assertEquals("array2", elementsAnnotation.value[1].name)
 
         // Ensure that all original fields were labeled @XmlTransient and had their original JAX-B annotations removed
         ensureFieldSanitized("namedAnnotatedProp")