Search in sources :

Example 1 with DomainObjectChangedException

use of org.jaffa.exceptions.DomainObjectChangedException in project jaffa-framework by jaffa-projects.

the class PrinterOutputTypeMaintenanceTx method domainObjectChangedTest.

// .//GEN-END:_deleteRelatedObjects_2_be
// .//GEN-BEGIN:_domainObjectChangedTest_1_be
/**
 * Ensure the domain object has not been modified.
 */
private void domainObjectChangedTest(Boolean performDirtyReadCheck, PrinterOutputType domain, org.jaffa.datatypes.DateTime lastChangedOn) throws FrameworkException, ApplicationExceptions {
    if (performDirtyReadCheck != null && performDirtyReadCheck.booleanValue()) {
        if (lastChangedOn == null ? domain.getLastChangedOn() != null : !lastChangedOn.equals(domain.getLastChangedOn())) {
            DomainObjectChangedException e = new DomainObjectChangedException(domain.getLastChangedBy(), Formatter.format(domain.getLastChangedOn()));
            ApplicationExceptions aes = new ApplicationExceptions();
            aes.add(e);
            throw aes;
        }
    }
}
Also used : ApplicationExceptions(org.jaffa.exceptions.ApplicationExceptions) DomainObjectChangedException(org.jaffa.exceptions.DomainObjectChangedException)

Example 2 with DomainObjectChangedException

use of org.jaffa.exceptions.DomainObjectChangedException in project jaffa-framework by jaffa-projects.

the class AttachmentMaintenanceTx method domainObjectChangedTest.

// .//GEN-END:_deleteRelatedObjects_2_be
// .//GEN-BEGIN:_domainObjectChangedTest_1_be
/**
 * Ensure the domain object has not been modified.
 */
private void domainObjectChangedTest(Boolean performDirtyReadCheck, Attachment domain, org.jaffa.datatypes.DateTime lastChangedOn) throws FrameworkException, ApplicationExceptions {
    if (performDirtyReadCheck != null && performDirtyReadCheck.booleanValue()) {
        if (lastChangedOn == null ? domain.getLastChangedOn() != null : !lastChangedOn.equals(domain.getLastChangedOn())) {
            DomainObjectChangedException e = new DomainObjectChangedException(domain.getLastChangedBy(), Formatter.format(domain.getLastChangedOn()));
            ApplicationExceptions aes = new ApplicationExceptions();
            aes.add(e);
            throw aes;
        }
    }
}
Also used : ApplicationExceptions(org.jaffa.exceptions.ApplicationExceptions) DomainObjectChangedException(org.jaffa.exceptions.DomainObjectChangedException)

Example 3 with DomainObjectChangedException

use of org.jaffa.exceptions.DomainObjectChangedException in project jaffa-framework by jaffa-projects.

the class FormDefinitionMaintenanceTx method domainObjectChangedTest.

// .//GEN-END:_deleteRelatedObjects_2_be
// .//GEN-BEGIN:_domainObjectChangedTest_1_be
/**
 * Ensure the domain object has not been modified.
 */
private void domainObjectChangedTest(Boolean performDirtyReadCheck, FormDefinition domain, org.jaffa.datatypes.DateTime lastChangedOn) throws FrameworkException, ApplicationExceptions {
    if (performDirtyReadCheck != null && performDirtyReadCheck.booleanValue()) {
        if (lastChangedOn == null ? domain.getLastChangedOn() != null : !lastChangedOn.equals(domain.getLastChangedOn())) {
            DomainObjectChangedException e = new DomainObjectChangedException(domain.getLastChangedBy(), Formatter.format(domain.getLastChangedOn()));
            ApplicationExceptions aes = new ApplicationExceptions();
            aes.add(e);
            throw aes;
        }
    }
}
Also used : ApplicationExceptions(org.jaffa.exceptions.ApplicationExceptions) DomainObjectChangedException(org.jaffa.exceptions.DomainObjectChangedException)

Example 4 with DomainObjectChangedException

use of org.jaffa.exceptions.DomainObjectChangedException in project jaffa-framework by jaffa-projects.

the class UserMaintenanceTx method domainObjectChangedTest.

// .//GEN-END:_deleteRelatedObjects_2_be
// .//GEN-BEGIN:_domainObjectChangedTest_1_be
/**
 * Ensure the domain object has not been modified.
 */
private void domainObjectChangedTest(Boolean performDirtyReadCheck, User domain, org.jaffa.datatypes.DateTime lastUpdatedOn) throws FrameworkException, ApplicationExceptions {
    if (performDirtyReadCheck != null && performDirtyReadCheck.booleanValue()) {
        if (lastUpdatedOn == null ? domain.getLastUpdatedOn() != null : !lastUpdatedOn.equals(domain.getLastUpdatedOn())) {
            DomainObjectChangedException e = new DomainObjectChangedException(domain.getLastUpdatedBy(), Formatter.format(domain.getLastUpdatedOn()));
            ApplicationExceptions aes = new ApplicationExceptions();
            aes.add(e);
            throw aes;
        }
    }
}
Also used : ApplicationExceptions(org.jaffa.exceptions.ApplicationExceptions) DomainObjectChangedException(org.jaffa.exceptions.DomainObjectChangedException)

Example 5 with DomainObjectChangedException

use of org.jaffa.exceptions.DomainObjectChangedException in project jaffa-framework by jaffa-projects.

the class FormUsageMaintenanceTx method domainObjectChangedTest.

// .//GEN-END:_deleteRelatedObjects_2_be
// .//GEN-BEGIN:_domainObjectChangedTest_1_be
/**
 * Ensure the domain object has not been modified.
 */
private void domainObjectChangedTest(Boolean performDirtyReadCheck, FormUsage domain, org.jaffa.datatypes.DateTime lastChangedOn) throws FrameworkException, ApplicationExceptions {
    if (performDirtyReadCheck != null && performDirtyReadCheck.booleanValue()) {
        if (lastChangedOn == null ? domain.getLastChangedOn() != null : !lastChangedOn.equals(domain.getLastChangedOn())) {
            DomainObjectChangedException e = new DomainObjectChangedException(domain.getLastChangedBy(), Formatter.format(domain.getLastChangedOn()));
            ApplicationExceptions aes = new ApplicationExceptions();
            aes.add(e);
            throw aes;
        }
    }
}
Also used : ApplicationExceptions(org.jaffa.exceptions.ApplicationExceptions) DomainObjectChangedException(org.jaffa.exceptions.DomainObjectChangedException)

Aggregations

ApplicationExceptions (org.jaffa.exceptions.ApplicationExceptions)6 DomainObjectChangedException (org.jaffa.exceptions.DomainObjectChangedException)6 IntrospectionException (java.beans.IntrospectionException)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 ApplicationException (org.jaffa.exceptions.ApplicationException)1 ApplicationExceptionWithContext (org.jaffa.exceptions.ApplicationExceptionWithContext)1 DomainObjectNotFoundException (org.jaffa.exceptions.DomainObjectNotFoundException)1 FrameworkException (org.jaffa.exceptions.FrameworkException)1 MultipleDomainObjectsFoundException (org.jaffa.exceptions.MultipleDomainObjectsFoundException)1 GraphDataObject (org.jaffa.soa.graph.GraphDataObject)1