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);
|
}
|
}
|