package orz.sorz.lab.smallcloudemoji.daogenerator;

import de.greenrobot.daogenerator.DaoGenerator;
import de.greenrobot.daogenerator.Entity;
import de.greenrobot.daogenerator.Schema;

public class AppDaoGenerator {

    public static void main(String[] args) throws Exception {
        Schema schema = new Schema(1, "org.sorz.lab.smallcloudemoji.models");

        addRepository(schema);

        new DaoGenerator().generateAll(schema, "app/src-gen");

    }

    private static void addRepository(Schema schema) {
        Entity repository = schema.addEntity("Repository");
        repository.addIdProperty();
        repository.addStringProperty("url").notNull();
        repository.addStringProperty("alias");
        repository.addDateProperty("lastUpdateDate");
    }
}

@@ -169,22 +169,108 @@
 nerator.
-Schema
+Property;%0Aimport de.greenrobot.daogenerator.Schema;%0Aimport de.greenrobot.daogenerator.ToMany
 ;%0A%0Apubli
@@ -654,32 +654,56 @@
 itory%22);%0A       
+ Property repositoryId =
  repository.addI
@@ -713,16 +713,30 @@
 operty()
+.getProperty()
 ;%0A      
@@ -782,16 +782,25 @@
 otNull()
+.unique()
 ;%0A      
@@ -893,17 +893,778 @@
 eDate%22);
+%0A%0A        Entity category = schema.addEntity(%22Category%22);%0A        Property categoryId = category.addIdProperty().getProperty();%0A        category.addStringProperty(%22name%22);%0A        category.addToOne(repository, repositoryId);%0A%0A        ToMany repositoryToCategories = repository.addToMany(category, repositoryId);%0A        repositoryToCategories.setName(%22categories%22);%0A%0A        Entity entry = schema.addEntity(%22Entry%22);%0A        entry.addIdProperty();%0A        entry.addStringProperty(%22emoticon%22).notNull();%0A        entry.addStringProperty(%22description%22);%0A        entry.addDateProperty(%22lastUsed%22);%0A        entry.addToOne(category, categoryId);%0A%0A        ToMany categoryToEntries = category.addToMany(entry, categoryId);%0A        categoryToEntries.setName(%22entries%22);
 %0A    %7D%0A
+%0A
 %7D%0A

Add entities