@AssertTrue(message = "job group and name are already being used")
public boolean isUniqueJobGroupAndNameConstraint() {
if (StringUtils.isBlank(jobGroup) && StringUtils.isBlank(jobName)) {
return true;
}
IJobSchedulerConfigurationDAO jobSchedulerConfigurationDAO = Registry
.getJobSchedulerConfigurationDAO();
if (isNewObject()) {
return !jobSchedulerConfigurationDAO
.existsByJobGroupAndJobNameAnotherTransaction(this);
} else {
JobSchedulerConfiguration found = jobSchedulerConfigurationDAO
.findUniqueByJobGroupAndJobNameAnotherTransaction(jobGroup,
jobName);
return found == null || found.getId().equals(getId());
}
}