added migration generation

This commit is contained in:
wea_ondara
2022-08-14 12:41:44 +02:00
parent 23e046ef7e
commit b11ae150b3
85 changed files with 4206 additions and 121 deletions

View File

@@ -19,12 +19,13 @@ class EntityInitializer {
throw new ModelException("DbSet " + ctxfield.getName() + " is missing the " + Clazz.class.getSimpleName() + " annotation");
}
var dbsetClazz = (Class<? extends SerializableObject>) clazzAnnotation.clazz();
initEntity(mb, dbsetClazz);
initEntity(mb, dbsetClazz, ctxfield.getName());
}
}
static void initEntity(ModelBuilder mb, Class<? extends SerializableObject> clazz) {
static void initEntity(ModelBuilder mb, Class<? extends SerializableObject> clazz, String name) {
var entity = mb.getOrCreateEntity(clazz);
entity.setName(name);
var fields = ReflectionUtil.getFieldsRecursive(clazz);
for (var f : fields) {