-
Notifications
You must be signed in to change notification settings - Fork 693
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
Empty constructor, explicit save, and other DAO improvements #794
Comments
First of all, thank you for an interest in Exposed. You could read a bit more here and also look for I will try to look at your code a bit later (maybe next week).
I was sure what |
We could use a flag to use active-record or explicit save()? I was reviewing using data class with reflections, I even adapted exposed-dao to save and consult with data class, but it is a problem to work relationships and lazy load, we would have to do something like |
I have updated my repository with some improvements, which can be seen in the file https://github.com/AliLozano/Exposed/blob/master/exposed-tests/src/test/kotlin/org/jetbrains/exposed/sql/tests/shared/entities/EntityWihtoutIdConstructor.kt Some of the improvements added:
School.objects.filter { Schools.region innerJoin Regions.name like "%Region" }
I'm missing:
PD: I cannot run the tests because the mysql cannot be initialized, I have not delved into it. |
I was looking for some ORM to work with a database in Kotlin and I found this library that I like very much, its way of making queries reminds me a little of Django, however I still believe that we need to improve the daos:
* Creating a new entity is a bit complex because it has no empty constructor.
* You cannot instantiate an Entity without queuing it to insert it.
A solution
I have made some slight changes in the library of the exposed-dao, I was careful with back compatibility, however I can't run tests. so I would very much like you to take a look.
You can see SamplesDAO to see the change I've made:
I would like to add methods to detach object to work outside a transaction, but I want to know if this is aligned to the project.
https://github.com/AliLozano/Exposed/
PD: If you add to the documentation how to run the tests, I would greatly appreciate it.
The text was updated successfully, but these errors were encountered: