Search in sources :

Example 16 with PrinterOutputType

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

the class PrinterOutputTypeMaintenanceTx method load.

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

Example 17 with PrinterOutputType

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

the class PrinterOutputTypeMaintenanceTx method load.

// .//GEN-END:_preprocessRetrieve_2_be
// .//GEN-BEGIN:_loadRetrieve_1_be
/**
 * Retrieve the domain object.
 */
private PrinterOutputType load(UOW uow, PrinterOutputTypeMaintenanceRetrieveInDto input) throws FrameworkException, ApplicationExceptions {
    PrinterOutputType domain = null;
    Criteria criteria = new Criteria();
    criteria.setTable(PrinterOutputTypeMeta.getName());
    // .//GEN-END:_loadRetrieve_1_be
    // Add custom criteria //GEN-FIRST:_loadRetrieve_1
    // .//GEN-LAST:_loadRetrieve_1
    // .//GEN-BEGIN:_loadRetrieve_2_be
    criteria.addCriteria(PrinterOutputTypeMeta.OUTPUT_TYPE, input.getOutputType());
    Iterator itr = uow.query(criteria).iterator();
    if (itr.hasNext())
        domain = (PrinterOutputType) itr.next();
    // .//GEN-BEGIN:_loadRetrieve_3_be
    if (domain == null) {
        ApplicationExceptions appExps = new ApplicationExceptions();
        appExps.add(new DomainObjectNotFoundException(PrinterOutputTypeMeta.getLabelToken()));
        throw appExps;
    }
    return domain;
}
Also used : PrinterOutputType(org.jaffa.modules.printing.domain.PrinterOutputType) ApplicationExceptions(org.jaffa.exceptions.ApplicationExceptions) DomainObjectNotFoundException(org.jaffa.exceptions.DomainObjectNotFoundException) Criteria(org.jaffa.persistence.Criteria)

Aggregations

PrinterOutputType (org.jaffa.modules.printing.domain.PrinterOutputType)17 ApplicationExceptions (org.jaffa.exceptions.ApplicationExceptions)10 ApplicationException (org.jaffa.exceptions.ApplicationException)6 UOW (org.jaffa.persistence.UOW)6 FrameworkException (org.jaffa.exceptions.FrameworkException)5 DomainObjectNotFoundException (org.jaffa.exceptions.DomainObjectNotFoundException)4 InvalidForeignKeyException (org.jaffa.datatypes.exceptions.InvalidForeignKeyException)3 Criteria (org.jaffa.persistence.Criteria)3 DateTime (org.jaffa.datatypes.DateTime)1 ValidationException (org.jaffa.datatypes.ValidationException)1 PrinterOutputTypeFinderOutDto (org.jaffa.modules.printing.components.printeroutputtypefinder.dto.PrinterOutputTypeFinderOutDto)1 PrinterOutputTypeFinderOutRowDto (org.jaffa.modules.printing.components.printeroutputtypefinder.dto.PrinterOutputTypeFinderOutRowDto)1 PrinterOutputTypeLookupOutDto (org.jaffa.modules.printing.components.printeroutputtypelookup.dto.PrinterOutputTypeLookupOutDto)1 PrinterOutputTypeLookupOutRowDto (org.jaffa.modules.printing.components.printeroutputtypelookup.dto.PrinterOutputTypeLookupOutRowDto)1 PrinterOutputTypeViewerOutDto (org.jaffa.modules.printing.components.printeroutputtypeviewer.dto.PrinterOutputTypeViewerOutDto)1 OutputCommand (org.jaffa.modules.printing.domain.OutputCommand)1 PrinterDefinition (org.jaffa.modules.printing.domain.PrinterDefinition)1