P15GEN2\59518
2024-05-29 d4210c7c4b04abde20037ea8aa0f54ef8a2649aa
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
package foundation.period;
 
import foundation.data.entity.Entity;
import foundation.data.entity.EntitySet;
import foundation.data.object.DataObject;
import foundation.server.Initializer;
 
public class ActivePeriodLoader extends Initializer {
 
    @Override
    public void startUp() throws Exception {
        // TODO Auto-generated method stub
        
    }
 
    @Override
    public void shutDown() throws Exception {
        // TODO Auto-generated method stub
        
    }
    
    public void load() throws Exception {
        DataObject dataObject = DataObject.getInstance("workperiod");
        EntitySet entitySet = dataObject.getTableEntitySet();
        
        if (entitySet.isEmpty()) {
            throw new Exception("empty active period");
        }
        
        Entity entity = entitySet.getEntity(0);
        
        String id = entity.getString("id");
        int year = entity.getInteger("year", 0);
        int month = entity.getInteger("month", 0);
        
        ActivePeriod.init(id, year, month);
    }
}