hefeixia
2021-02-18 5b8c95c760840f09910730943b21391e47187315
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package frame.object.data;
 
import frame.variant.expression.VariantRequestParams;
 
public class EntityInitializer {
 
    public void exec(VariantRequestParams variantRequestParams, Entity entity) throws Exception {
        entity.setID(new ID());
    }
 
    public void loadDefaultValue(VariantRequestParams params) throws Exception {
//        String tableName = entityMeta.getName();
//        EntityConfig entityConfig = configContainer.getField(tableName);
//        
//        if (entityConfig == null) {
//            set("id", Util.newShortGUID());
//            return;
//        }
//        
//        for (FieldConfig fieldConfig: entityConfig) {
//            String name = fieldConfig.getName();
//            
//            if (!entityMeta.containsSuperVCode(name)) {
//                continue;
//            }
//            
//            Object value = fieldConfig.getValue(params);
//            set(name, value);
//        }
    }
 
    public static EntityInitializer getInstance(String dataName) {
        EntityInitializer result = EntityInitializerContainer.get(dataName);
        
        if (result == null) {
            result = new EntityInitializer();
        }
        
        return result;
    }
 
}