Closed LuigiMaestrelli closed 5 years ago
I use my class model structure like this:
model -- xxxx ------ xxxx.java ------ blablabla.java -- yyyy ------ test.java ------ ... -- ....
The DaoSession's namespace changed when I created a new package under model, and alphabetically, the new package is now the first package under model.
So, if I keep creating packages and by that, changing the first package on the list, the DaoSession will be changing namespaces every time?????
Yes, greenDAO automatically chooses a package based on where your entities are stored.
You can try to set the daoPackage property in the greendao closure:
greendao {
schemaVersion 6
daoPackage "com.example.model"
}
Though note that all generated classes will then be created in that package.
Closing. Please re-open if your question was not answered. -ut
I've been using greenDao in the same project for months. Today I added a new entity. After that, the greenDao changed the DaoSession and DaoMaster's namespaces to the same namespace as the new entity added. And it broke all the project DaoSession's imports. Removing the @entity from the new class made the greenDao generating process go back to the same namespace as before.
All of that without changing any dependencies, I just changed the schemaVersion inside the build.gradle
This is my build.gradle