I have looked for answers but couldn't find any to my problem. I have an existing (complex) database already populated and I wish to integrate it in an Android App. I chose to use GreenDAO and I experimented with the Dao Generator. I checked links like: link and it is not a problem to copy an existing database to assets. My problem is that I still have to write a lot of code to create entities for the model, dao classes to be created/generated.
Example code for generating classes:
Schema schema = new Schema(0, "de.test.app.database");
Entity program = schema.addEntity("Program");
program.addIdProperty();
program.addStringProperty("name");
program.addDateProperty("beginDate");
try {
DaoGenerator db = new DaoGenerator();
db.generateAll(schema, "app/src/main/java");
} catch (Exception e) {
e.printStackTrace();
}
Is there a way to generate the needed model and dao classes after existing database/tables with GreenDao? For example, the way in hibernate you have the possibility to generate the POJO classes from existing tables.