JetBrains / Exposed

Kotlin SQL Framework
http://jetbrains.github.io/Exposed/
Apache License 2.0
8.36k stars 695 forks source link

Add EntityClass#testCache(ID) overload #1276

Open vlsi opened 3 years ago

vlsi commented 3 years ago

Currently, only testCache(EntityID<ID>) is present, so please add testCache(ID): https://github.com/JetBrains/Exposed/blob/d59247283dc8c1af019e3e2a8c75c7519d1fdb6d/exposed-dao/src/main/kotlin/org/jetbrains/exposed/dao/EntityClass.kt#L73-L75

For instance, get(...) has two variations:

https://github.com/JetBrains/Exposed/blob/d59247283dc8c1af019e3e2a8c75c7519d1fdb6d/exposed-dao/src/main/kotlin/org/jetbrains/exposed/dao/EntityClass.kt#L20-L22

vlsi commented 3 years ago

Workaround is

fun<ID: Comparable<ID>, T : Entity<ID>> EntityClass<ID, T>.testCache(id: ID) =
    testCache(EntityID(id, table))