Skip to content

Implement ExplicitEntities Annotation for Enhanced DAO and Entity Management#10

Merged
teogor merged 1 commit intomainfrom
bugfix/ksp-relations-no-dao
Feb 15, 2024
Merged

Implement ExplicitEntities Annotation for Enhanced DAO and Entity Management#10
teogor merged 1 commit intomainfrom
bugfix/ksp-relations-no-dao

Conversation

@teogor
Copy link
Copy Markdown
Owner

@teogor teogor commented Feb 15, 2024

This pull request introduces the ExplicitEntities annotation for improved clarity, type safety, and mapping in your DAO classes.

Benefits:

  • Enhanced Type Safety: Explicitly listing managed entities prevents potential type errors and improves code understanding.
  • Safer Mapping: Precise entity information allows code generation tools to perform more accurate DAO-entity mappings.
  • Clearer Intent: The annotation makes the relationship between a DAO and its entities explicit, boosting code readability and maintainability.

Key Features:

  • An attribute for specifying the list of associated entity classes.
  • An optional attribute to mark the DAO as managing only the listed entities.

Usage:

Annotate your DAO classes with @ExplicitEntities and provide the list of managed entities:

@ExplicitEntities(entities = [MyEntity1::class, MyEntity2::class])
class MyDao {
    // ...
}

closes #9

@teogor teogor added this to the 1.0.0-alpha02 milestone Feb 15, 2024
@teogor teogor self-assigned this Feb 15, 2024
@teogor teogor merged commit 4de1c04 into main Feb 15, 2024
@zeobot zeobot Bot deleted the bugfix/ksp-relations-no-dao branch February 15, 2024 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

[Bug]: KSP Plugin Failure with Relations Table and Missing DAO

1 participant