Search in sources :

Example 16 with FormEvent

use of org.jaffa.modules.printing.domain.FormEvent in project jaffa-framework by jaffa-projects.

the class FormEventMaintenanceTx method load.

// .//GEN-END:_preprocessUpdate_2_be
// .//GEN-BEGIN:_loadUpdate_1_be
/**
 * Retrieve the domain object.
 */
private FormEvent load(UOW uow, FormEventMaintenanceUpdateInDto input) throws FrameworkException, ApplicationExceptions {
    FormEvent domain = null;
    Criteria criteria = new Criteria();
    criteria.setTable(FormEventMeta.getName());
    // .//GEN-END:_loadUpdate_1_be
    // Add custom criteria//GEN-FIRST:_loadUpdate_1
    // .//GEN-LAST:_loadUpdate_1
    // .//GEN-BEGIN:_loadUpdate_2_be
    criteria.addCriteria(FormEventMeta.EVENT_NAME, input.getEventName());
    criteria.setLocking(Criteria.LOCKING_PARANOID);
    Iterator itr = uow.query(criteria).iterator();
    if (itr.hasNext())
        domain = (FormEvent) itr.next();
    // .//GEN-BEGIN:_loadUpdate_3_be
    if (domain == null) {
        ApplicationExceptions appExps = new ApplicationExceptions();
        appExps.add(new DomainObjectNotFoundException(FormEventMeta.getLabelToken()));
        throw appExps;
    }
    return domain;
}
Also used : ApplicationExceptions(org.jaffa.exceptions.ApplicationExceptions) FormEvent(org.jaffa.modules.printing.domain.FormEvent) DomainObjectNotFoundException(org.jaffa.exceptions.DomainObjectNotFoundException) Criteria(org.jaffa.persistence.Criteria)

Aggregations

FormEvent (org.jaffa.modules.printing.domain.FormEvent)16 ApplicationExceptions (org.jaffa.exceptions.ApplicationExceptions)9 ApplicationException (org.jaffa.exceptions.ApplicationException)5 FrameworkException (org.jaffa.exceptions.FrameworkException)5 Criteria (org.jaffa.persistence.Criteria)5 UOW (org.jaffa.persistence.UOW)5 DomainObjectNotFoundException (org.jaffa.exceptions.DomainObjectNotFoundException)3 FormUsage (org.jaffa.modules.printing.domain.FormUsage)2 ValidationException (org.jaffa.datatypes.ValidationException)1 InvalidForeignKeyException (org.jaffa.datatypes.exceptions.InvalidForeignKeyException)1 FormEventFinderOutDto (org.jaffa.modules.printing.components.formeventfinder.dto.FormEventFinderOutDto)1 FormEventFinderOutRowDto (org.jaffa.modules.printing.components.formeventfinder.dto.FormEventFinderOutRowDto)1 FormEventLookupOutDto (org.jaffa.modules.printing.components.formeventlookup.dto.FormEventLookupOutDto)1 FormEventLookupOutRowDto (org.jaffa.modules.printing.components.formeventlookup.dto.FormEventLookupOutRowDto)1 FormEventViewerOutDto (org.jaffa.modules.printing.components.formeventviewer.dto.FormEventViewerOutDto)1 FormUsageDto (org.jaffa.modules.printing.components.formgroupviewer.dto.FormUsageDto)1