ExplicitEntities

@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class ExplicitEntities(val entities: Array<KClass<*>> = [], val isExclusive: Boolean = false)

Explicitly defines the entities this DAO interacts with for safer mapping and improved type safety.

This annotation is used to associate a DAO class with the specific entity classes it manages. It serves several purposes:

  • Enhanced type safety: By explicitly listing the entities, you ensure the DAO methods operate on the intended types, reducing potential type errors and improving code clarity.

  • Safer mapping: Knowing the exact entities allows code generation tools to perform more accurate mapping between DAOs and entities, mitigating potential mapping issues.

  • Clearer intent: This annotation makes the relationship between the DAO and its entities explicit, improving code readability and maintainability.

Parameters

entities

Array<*>>>: The list of entity classes associated with the DAO. Defaults to an empty array.

isExclusive

Boolean: (Optional) Specifies whether only the listed entities are managed by this DAO. Defaults to false.

Properties

Link copied to clipboard
Link copied to clipboard
val isExclusive: Boolean = false