public boolean isOnlyOneSequenceForEachEntityIsActiveConstraint() {
if (!isActive()) {
return true;
}
IEntitySequenceDAO entitySequenceDAO = Registry.getEntitySequenceDAO();
if (isNewObject()) {
return !entitySequenceDAO
.existOtherActiveSequenceByEntityNameForNewObject(this);
} else {
try {
EntitySequence c = entitySequenceDAO
.getActiveEntitySequence(this.entityName);
return c.getId().equals(getId());
} catch (NonUniqueResultException e) {
return false;
} catch (InstanceNotFoundException e) {