use of org.jaffa.exceptions.DomainObjectNotFoundException in project jaffa-framework by jaffa-projects.
the class PrinterDefinitionMaintenanceTx method load.
// .//GEN-END:_preprocessRetrieve_2_be
// .//GEN-BEGIN:_loadRetrieve_1_be
/**
* Retrieve the domain object.
*/
private PrinterDefinition load(UOW uow, PrinterDefinitionMaintenanceRetrieveInDto input) throws FrameworkException, ApplicationExceptions {
PrinterDefinition domain = null;
Criteria criteria = new Criteria();
criteria.setTable(PrinterDefinitionMeta.getName());
// .//GEN-END:_loadRetrieve_1_be
// Add custom criteria//GEN-FIRST:_loadRetrieve_1
// .//GEN-LAST:_loadRetrieve_1
// .//GEN-BEGIN:_loadRetrieve_2_be
criteria.addCriteria(PrinterDefinitionMeta.PRINTER_ID, input.getPrinterId());
Iterator itr = uow.query(criteria).iterator();
if (itr.hasNext())
domain = (PrinterDefinition) itr.next();
// .//GEN-BEGIN:_loadRetrieve_3_be
if (domain == null) {
ApplicationExceptions appExps = new ApplicationExceptions();
appExps.add(new DomainObjectNotFoundException(PrinterDefinitionMeta.getLabelToken()));
throw appExps;
}
return domain;
}
use of org.jaffa.exceptions.DomainObjectNotFoundException in project jaffa-framework by jaffa-projects.
the class PrinterDefinitionMaintenanceTx method load.
// .//GEN-END:_preprocessUpdate_2_be
// .//GEN-BEGIN:_loadUpdate_1_be
/**
* Retrieve the domain object.
*/
private PrinterDefinition load(UOW uow, PrinterDefinitionMaintenanceUpdateInDto input) throws FrameworkException, ApplicationExceptions {
PrinterDefinition domain = null;
Criteria criteria = new Criteria();
criteria.setTable(PrinterDefinitionMeta.getName());
// .//GEN-END:_loadUpdate_1_be
// Add custom criteria//GEN-FIRST:_loadUpdate_1
// .//GEN-LAST:_loadUpdate_1
// .//GEN-BEGIN:_loadUpdate_2_be
criteria.addCriteria(PrinterDefinitionMeta.PRINTER_ID, input.getPrinterId());
criteria.setLocking(Criteria.LOCKING_PARANOID);
Iterator itr = uow.query(criteria).iterator();
if (itr.hasNext())
domain = (PrinterDefinition) itr.next();
// .//GEN-BEGIN:_loadUpdate_3_be
if (domain == null) {
ApplicationExceptions appExps = new ApplicationExceptions();
appExps.add(new DomainObjectNotFoundException(PrinterDefinitionMeta.getLabelToken()));
throw appExps;
}
return domain;
}
use of org.jaffa.exceptions.DomainObjectNotFoundException in project jaffa-framework by jaffa-projects.
the class PrinterDefinitionViewerComponent method doInquiry.
// .//GEN-END:_display_2_be
// .//GEN-BEGIN:_inquiry_1_be
private void doInquiry() throws ApplicationExceptions, FrameworkException {
PrinterDefinitionViewerInDto inputDto = new PrinterDefinitionViewerInDto();
// .//GEN-END:_inquiry_1_be
// Add custom code before building the input dto //GEN-FIRST:_inquiry_1
// .//GEN-LAST:_inquiry_1
// .//GEN-BEGIN:_inquiry_2_be
inputDto.setPrinterId(m_printerId);
inputDto.setHeaderDto(createHeaderDto());
// create the Tx
if (m_tx == null)
m_tx = (IPrinterDefinitionViewer) Factory.createObject(IPrinterDefinitionViewer.class);
// .//GEN-END:_inquiry_2_be
// Add custom code before invoking the Tx //GEN-FIRST:_inquiry_2
// .//GEN-LAST:_inquiry_2
// .//GEN-BEGIN:_inquiry_3_be
// now get the details
m_outputDto = m_tx.read(inputDto);
// uncache the widgets
getUserSession().getWidgetCache(getComponentId()).clear();
// throw an exception if the output is null
if (m_outputDto == null) {
ApplicationExceptions appExps = new ApplicationExceptions();
appExps.add(new DomainObjectNotFoundException(PrinterDefinitionMeta.getLabelToken()));
throw appExps;
}
}
use of org.jaffa.exceptions.DomainObjectNotFoundException 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;
}
use of org.jaffa.exceptions.DomainObjectNotFoundException 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;
}
Aggregations