.lazyLoad(
articleType,
new LazyLoadArticleTypeEnum[] { LazyLoadArticleTypeEnum.ARTICLE_TYPE_ARTICLE_TYPE });
Set<ArticleTypeArticleType> articleRefs = articleType
.getArticleTypeArticleTypes();
OrderLine orderLine;
Set<OrderLineAttribute> orderLineAttributes;
Set<OrderLine> orderLineRefs = new HashSet<OrderLine>();
if (articleRefs != null) {
for (ArticleTypeArticleType articleRef : articleRefs) {
orderLine = OrderLine
.getInstance(
(Order) presentationModelPackable
.getBufferedValue(ICostableModel.PROPERTY_ORDER),
articleRef.getArticleTypeRef(),
orderLineMain,
(Deviation) presentationModelPackable
.getBufferedValue(ICostableModel.PROPERTY_DEVIATION));
ArticleType articleTypeRef = articleRef.getArticleTypeRef();
articleTypeManager
.lazyLoad(
articleTypeRef,
new LazyLoadArticleTypeEnum[] { LazyLoadArticleTypeEnum.ATTRIBUTE });
Set<ArticleTypeAttribute> attributes = articleTypeRef
.getArticleTypeAttributes();
if (attributes != null) {
orderLineAttributes = new HashSet<OrderLineAttribute>();
for (ArticleTypeAttribute attribute : attributes) {
orderLineAttributes.add(new OrderLineAttribute(null,
orderLine, null, null, attribute, null, null,
attribute.getAttribute().getName()));
}
openAttributeView(orderLine, orderLineAttributes);
orderLine.setOrderLineAttributes(orderLineAttributes);
setOrderLineRefs(articleRef.getArticleTypeRef(), orderLine);
}
orderLineRefs.add(orderLine);
orderLine.setArticlePath(orderLine.getGeneratedArticlePath());
}
orderLineMain.setOrderLines(orderLineRefs);
}
}