-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support copying classes that don't have direct dependency #82
Comments
Thanks for the feedback! We could definitely think of something, the main issue is figuring out where to attach the annotations that describe what to create. @mariobat88 do you have some idea of how you would like it to look like? |
Hi @serras sorry for the late reply. Not sure if that's possible, but maybe by creating an abstract class and annotate the function with a
I'm also not sure if the we need to pass in a parameter into the |
I see... the only problem is where would we generate the implementations. KSP is quite restrictive, so we cannot add it to an existing class, for example. |
What about having them as file annotations? So you would do: @file:Copy("toEntity", UserResponse::class, UserEntity::class) |
Not sure if this is planned in some future release, but let me explain my idea.
Usually when I set up my projects the database Entity classes (database module) and the Domain classes (repo module) don't have direct to each other so there is no way for me to annotate the classes with @copy. The way I copy objects is that I write mappers in my datasource layer which has dependency to both database and repositories. This is how I map my objects in a datasource:
Is there a way to do that with this library, or is it planned to support something similar?
The text was updated successfully, but these errors were encountered: