Skip to content

Commit 0557059

Browse files
committed
* Fix count extension functions.
Relates to #32
1 parent 7bccf02 commit 0557059

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

storm-kotlin/src/main/kotlin/st/orm/kotlin/repository/KRepositoryLookupExtensions.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,7 +1173,7 @@ inline fun <reified T, V> KRepositoryLookup.countBy(
11731173
* @return the count of matching entities.
11741174
*/
11751175
@Suppress("UNCHECKED_CAST")
1176-
inline fun <reified T, V> KRepositoryLookup.count(
1176+
inline fun <reified T> KRepositoryLookup.count(
11771177
noinline predicate: KWhereBuilder<T, *, *>.() -> KPredicateBuilder<T, *, *>
11781178
): Long where T : Record = when {
11791179
Entity::class.java.isAssignableFrom(T::class.java) -> {
@@ -1194,7 +1194,7 @@ inline fun <reified T, V> KRepositoryLookup.count(
11941194
* @return the count of matching entities.
11951195
*/
11961196
@Suppress("UNCHECKED_CAST")
1197-
inline fun <reified T, V> KRepositoryLookup.count(predicateBuilder: KPredicateBuilder<T, *, *>): Long
1197+
inline fun <reified T> KRepositoryLookup.count(predicateBuilder: KPredicateBuilder<T, *, *>): Long
11981198
where T : Record = when {
11991199
Entity::class.java.isAssignableFrom(T::class.java) -> {
12001200
val method = this::class.java.getMethod("entity", Class::class.java)

storm-kotlin/src/main/kotlin/st/orm/kotlin/repository/RepositoryLookupExtensions.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,9 +1161,9 @@ inline fun <reified T, V> RepositoryLookup.countBy(
11611161
* @return the count of matching entities.
11621162
*/
11631163
@Suppress("UNCHECKED_CAST")
1164-
inline fun <reified T, V> RepositoryLookup.count(
1165-
noinline predicate: WhereBuilder<T, *, *>.() -> PredicateBuilder<T, *, *>
1166-
): Long where T : Record, T : Entity<*> = when {
1164+
inline fun <reified T> RepositoryLookup.count(
1165+
noinline predicate: WhereBuilder<T, *, *>.() -> PredicateBuilder<T, T, *>
1166+
): Long where T : Record = when {
11671167
Entity::class.java.isAssignableFrom(T::class.java) -> {
11681168
val method = this::class.java.getMethod("entity", Class::class.java)
11691169
(method.invoke(this, T::class.java) as EntityRepository<T, *>).selectCount().where(predicate).singleResult
@@ -1182,7 +1182,7 @@ inline fun <reified T, V> RepositoryLookup.count(
11821182
* @return the count of matching entities.
11831183
*/
11841184
@Suppress("UNCHECKED_CAST")
1185-
inline fun <reified T, V> RepositoryLookup.count(predicateBuilder: KPredicateBuilder<T, *, *>): Long
1185+
inline fun <reified T> RepositoryLookup.count(predicateBuilder: KPredicateBuilder<T, T, *>): Long
11861186
where T : Record = when {
11871187
Entity::class.java.isAssignableFrom(T::class.java) -> {
11881188
val method = this::class.java.getMethod("entity", Class::class.java)

0 commit comments

Comments
 (0)