ItEr44S10CUGravacionModelosUnidadesTraballoItEr43S12: Fixing bug. Forcing load of data.
Although it's transient data it has already existent data that must be loaded in order to avoid LazyInitializationExceptions
This commit is contained in:
parent
61a0f98b4e
commit
4ec0445bae
2 changed files with 9 additions and 2 deletions
|
|
@ -298,6 +298,7 @@ public class OrderModel implements IOrderModel {
|
|||
loadNeededDataForConversation();
|
||||
this.order = createOrderFrom((OrderTemplate) templateDAO
|
||||
.findExistingEntity(template.getId()));
|
||||
forceLoadAdvanceAssignmentsAndMeasurements(this.order);
|
||||
initializeOrder();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -127,19 +127,25 @@ public class OrderTemplatesModel implements IOrderTemplatesModel {
|
|||
OrderElement reloaded = orderElementDAO
|
||||
.findExistingEntity(orderElement.getId());
|
||||
template = reloaded.createTemplate();
|
||||
loadAssociatedData(template);
|
||||
treeModel = new TemplatesTree(template);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public void initEdit(OrderElementTemplate template) {
|
||||
initializeAcompanyingObjectsOnConversation();
|
||||
this.template = dao.findExistingEntity(template.getId());
|
||||
loadQualityForms(this.template);
|
||||
loadAdvanceAssignments(this.template);
|
||||
loadAssociatedData(template);
|
||||
treeModel = new TemplatesTree(this.template);
|
||||
}
|
||||
|
||||
private void loadAssociatedData(OrderElementTemplate template) {
|
||||
loadAdvanceAssignments(template);
|
||||
loadQualityForms(template);
|
||||
}
|
||||
|
||||
private void loadQualityForms(OrderElementTemplate template) {
|
||||
for (QualityForm each : template.getQualityForms()) {
|
||||
each.getName();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue