MatrixDev / Roomigrant

Automated Android Room ORM migrations generator with compile-time code generation
MIT License
373 stars 23 forks source link

need help with java #2

Closed jacksonperondi closed 3 years ago

jacksonperondi commented 4 years ago

Hello. First of all, thank you very much for this amazing library. I am trying to implement automatic migration using java. These are more questions than an issue.

I'm trying to use the default migration rules in the "@GenerateRoomMigrations" annotation by omitting the rule class as in the README example, but the annotation has a mandatory parameter. Could you provide a java example of how to declare default rules?

Another big question I have is what "* Database_Migrations.build ()" means. Even in the test project I downloaded from the repository there is an unresolved reference notice for that line.

Thank you!

Tamsiree commented 4 years ago

I had the same confusion and expected an answer.

RBusarow commented 4 years ago

That's Database_Migrations a generated file/class. The name and package mirror those of the database being migrated. For instance, if the actual database is com.example.MyDatabase, the generated class will be com.example.MyDatabase_Migrations.

After running a build, even if it fails because it can't resolve that file, the generated file will exist. If the IDE doesn't auto-import it for you, just add it manually and everything should work.

MatrixDev commented 3 years ago

Was answered by @RBusarow