use of org.jaffa.exceptions.DomainObjectNotFoundException in project jaffa-framework by jaffa-projects.
the class FormTemplateMaintenanceTx method load.
// .//GEN-END:_preprocessUpdate_2_be
// .//GEN-BEGIN:_loadUpdate_1_be
/**
* Retrieve the domain object.
*/
private FormTemplate load(UOW uow, FormTemplateMaintenanceUpdateInDto input) throws FrameworkException, ApplicationExceptions {
FormTemplate domain = null;
Criteria criteria = new Criteria();
criteria.setTable(FormTemplateMeta.getName());
// .//GEN-END:_loadUpdate_1_be
// Add custom criteria //GEN-FIRST:_loadUpdate_1
// .//GEN-LAST:_loadUpdate_1
// .//GEN-BEGIN:_loadUpdate_2_be
criteria.addCriteria(FormTemplateMeta.FORM_ID, input.getFormId());
criteria.setLocking(Criteria.LOCKING_PARANOID);
Iterator itr = uow.query(criteria).iterator();
if (itr.hasNext())
domain = (FormTemplate) itr.next();
// .//GEN-BEGIN:_loadUpdate_3_be
if (domain == null) {
ApplicationExceptions appExps = new ApplicationExceptions();
appExps.add(new DomainObjectNotFoundException(FormTemplateMeta.getLabelToken()));
throw appExps;
}
return domain;
}
use of org.jaffa.exceptions.DomainObjectNotFoundException in project jaffa-framework by jaffa-projects.
the class FormUsageMaintenanceTx method load.
// .//GEN-END:_preprocessDelete_2_be
// .//GEN-BEGIN:_loadDelete_1_be
/**
* Retrieve the domain object.
*/
private FormUsage load(UOW uow, FormUsageMaintenanceDeleteInDto input) throws FrameworkException, ApplicationExceptions {
FormUsage domain = null;
Criteria criteria = new Criteria();
criteria.setTable(FormUsageMeta.getName());
// .//GEN-END:_loadDelete_1_be
// Add custom criteria //GEN-FIRST:_loadDelete_1
// .//GEN-LAST:_loadDelete_1
// .//GEN-BEGIN:_loadDelete_2_be
criteria.addCriteria(FormUsageMeta.FORM_NAME, input.getFormName());
criteria.setLocking(Criteria.LOCKING_PARANOID);
Iterator itr = uow.query(criteria).iterator();
if (itr.hasNext())
domain = (FormUsage) itr.next();
// .//GEN-BEGIN:_loadDelete_3_be
if (domain == null) {
ApplicationExceptions appExps = new ApplicationExceptions();
appExps.add(new DomainObjectNotFoundException(FormUsageMeta.getLabelToken()));
throw appExps;
}
return domain;
}
use of org.jaffa.exceptions.DomainObjectNotFoundException in project jaffa-framework by jaffa-projects.
the class FormUsageMaintenanceTx method load.
// .//GEN-END:_preprocessUpdate_2_be
// .//GEN-BEGIN:_loadUpdate_1_be
/**
* Retrieve the domain object.
*/
private FormUsage load(UOW uow, FormUsageMaintenanceUpdateInDto input) throws FrameworkException, ApplicationExceptions {
FormUsage domain = null;
Criteria criteria = new Criteria();
criteria.setTable(FormUsageMeta.getName());
// .//GEN-END:_loadUpdate_1_be
// Add custom criteria //GEN-FIRST:_loadUpdate_1
// .//GEN-LAST:_loadUpdate_1
// .//GEN-BEGIN:_loadUpdate_2_be
criteria.addCriteria(FormUsageMeta.FORM_NAME, input.getFormName());
criteria.setLocking(Criteria.LOCKING_PARANOID);
Iterator itr = uow.query(criteria).iterator();
if (itr.hasNext())
domain = (FormUsage) itr.next();
// .//GEN-BEGIN:_loadUpdate_3_be
if (domain == null) {
ApplicationExceptions appExps = new ApplicationExceptions();
appExps.add(new DomainObjectNotFoundException(FormUsageMeta.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:_preprocessDelete_2_be
// .//GEN-BEGIN:_loadDelete_1_be
/**
* Retrieve the domain object.
*/
private PrinterOutputType load(UOW uow, PrinterOutputTypeMaintenanceDeleteInDto input) throws FrameworkException, ApplicationExceptions {
PrinterOutputType domain = null;
Criteria criteria = new Criteria();
criteria.setTable(PrinterOutputTypeMeta.getName());
// .//GEN-END:_loadDelete_1_be
// Add custom criteria //GEN-FIRST:_loadDelete_1
// .//GEN-LAST:_loadDelete_1
// .//GEN-BEGIN:_loadDelete_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:_loadDelete_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 OutputCommandMaintenanceTx method load.
// .//GEN-END:_preprocessDelete_2_be
// .//GEN-BEGIN:_loadDelete_1_be
/**
* Retrieve the domain object.
*/
private OutputCommand load(UOW uow, OutputCommandMaintenanceDeleteInDto input) throws FrameworkException, ApplicationExceptions {
OutputCommand domain = null;
Criteria criteria = new Criteria();
criteria.setTable(OutputCommandMeta.getName());
// .//GEN-END:_loadDelete_1_be
// Add custom criteria//GEN-FIRST:_loadDelete_1
// .//GEN-LAST:_loadDelete_1
// .//GEN-BEGIN:_loadDelete_2_be
criteria.addCriteria(OutputCommandMeta.OUTPUT_COMMAND_ID, input.getOutputCommandId());
criteria.setLocking(Criteria.LOCKING_PARANOID);
Iterator itr = uow.query(criteria).iterator();
if (itr.hasNext())
domain = (OutputCommand) itr.next();
// .//GEN-BEGIN:_loadDelete_3_be
if (domain == null) {
ApplicationExceptions appExps = new ApplicationExceptions();
appExps.add(new DomainObjectNotFoundException(OutputCommandMeta.getLabelToken()));
throw appExps;
}
return domain;
}
Aggregations