}
public Contract(Long id, Boolean isCore, String name,
HhStartDate startDate, HhStartDate finishDate, String chargeScript)
throws HttpException {
Configuration configuration = Configuration.getConfiguration();
if (id == null) {
if (isCore) {
id = configuration.nextCoreContractId();
} else {
id = configuration.nextUserContractId();
}
} else {
isCore = id % 2 == 1;
if (isCore) {
if (id > configuration.getCoreContractId()) {
configuration.setCoreContractId(id);
}
} else {
if (id > configuration.getUserContractId()) {
configuration.setUserContractId(id);
}
}
}
setId(id);
internalUpdate(name, chargeScript);