Norbi
05/04/2024, 5:28 PMJoffrey
05/04/2024, 5:29 PMJoffrey
05/04/2024, 5:29 PMNorbi
05/04/2024, 5:50 PMEntityManager
.
In my TypeSafeEntityManager: EntityManager
sub-interface I have overridden createQuery()
to require opt-in:
@NotTypeSafeJpaApi
override fun createQuery(qlString: String): Query
But I also wanted to create an extension function:
inline fun <reified T : Any> TypeSafeEntityManager.createQuery(qlString: String): TypeSafeQuery<T> = ...
Never mind, I will do something else, thanks for the answer ๐Norbi
05/04/2024, 5:58 PMJoffrey
05/04/2024, 6:01 PMJoffrey
05/04/2024, 6:02 PM@Deprecated
annotation instead of requiring opt-in, this way you can use ReplaceWith
to automatically replace the callYoussef Shoaib [MOD]
05/04/2024, 6:03 PMEntityManager
might not be what you want if you're trying to stop users from calling the unsafe methods. Instead, you can have a @NotTypeSafeJpaApi val manager: EntityManager
exposed.Joffrey
05/04/2024, 6:05 PMNorbi
05/04/2024, 6:10 PMGood idea, thanks!exposedEntityManager