use of org.broadleafcommerce.common.persistence.PostLoaderDao in project BroadleafCommerce by BroadleafCommerce.
the class BundleOrderItemImpl method getProductBundle.
@Override
public ProductBundle getProductBundle() {
if (deproxiedProductBundle == null) {
PostLoaderDao postLoaderDao = DefaultPostLoaderDao.getPostLoaderDao();
if (postLoaderDao != null && productBundle.getId() != null) {
Long id = productBundle.getId();
deproxiedProductBundle = postLoaderDao.find(ProductBundleImpl.class, id);
} else if (productBundle instanceof HibernateProxy) {
deproxiedProductBundle = HibernateUtils.deproxy(productBundle);
} else {
deproxiedProductBundle = productBundle;
}
}
return deproxiedProductBundle;
}
use of org.broadleafcommerce.common.persistence.PostLoaderDao in project BroadleafCommerce by BroadleafCommerce.
the class DiscreteOrderItemImpl method getSku.
@Override
public Sku getSku() {
if (deproxiedSku == null) {
PostLoaderDao postLoaderDao = DefaultPostLoaderDao.getPostLoaderDao();
if (postLoaderDao != null && sku.getId() != null) {
Long id = sku.getId();
deproxiedSku = postLoaderDao.find(SkuImpl.class, id);
} else if (sku instanceof HibernateProxy) {
deproxiedSku = HibernateUtils.deproxy(sku);
} else {
deproxiedSku = sku;
}
}
return deproxiedSku;
}
use of org.broadleafcommerce.common.persistence.PostLoaderDao in project BroadleafCommerce by BroadleafCommerce.
the class DiscreteOrderItemImpl method getProduct.
@Override
public Product getProduct() {
if (deproxiedProduct == null) {
PostLoaderDao postLoaderDao = DefaultPostLoaderDao.getPostLoaderDao();
if (product != null && postLoaderDao != null && product.getId() != null) {
Long id = product.getId();
deproxiedProduct = postLoaderDao.find(ProductImpl.class, id);
} else if (product instanceof HibernateProxy) {
deproxiedProduct = HibernateUtils.deproxy(product);
} else {
deproxiedProduct = product;
}
}
return deproxiedProduct;
}
use of org.broadleafcommerce.common.persistence.PostLoaderDao in project BroadleafCommerce by BroadleafCommerce.
the class SkuBundleItemImpl method getBundle.
@Override
public ProductBundle getBundle() {
// the bundle is lazy loaded).
if (deproxiedBundle == null) {
PostLoaderDao postLoaderDao = DefaultPostLoaderDao.getPostLoaderDao();
Long id = bundle.getId();
if (postLoaderDao != null && id != null) {
deproxiedBundle = postLoaderDao.findSandboxEntity(ProductBundleImpl.class, id);
} else if (bundle instanceof HibernateProxy) {
deproxiedBundle = HibernateUtils.deproxy(bundle);
} else {
deproxiedBundle = bundle;
}
}
if (deproxiedBundle instanceof HibernateProxy) {
deproxiedBundle = HibernateUtils.deproxy(bundle);
}
return deproxiedBundle;
}
use of org.broadleafcommerce.common.persistence.PostLoaderDao in project BroadleafCommerce by BroadleafCommerce.
the class SkuBundleItemImpl method getSku.
@Override
public Sku getSku() {
// the sku is lazy loaded).
if (deproxiedSku == null) {
PostLoaderDao postLoaderDao = DefaultPostLoaderDao.getPostLoaderDao();
Long id = sku.getId();
if (postLoaderDao != null && id != null) {
deproxiedSku = postLoaderDao.findSandboxEntity(SkuImpl.class, id);
} else if (sku instanceof HibernateProxy) {
deproxiedSku = HibernateUtils.deproxy(sku);
} else {
deproxiedSku = sku;
}
}
if (deproxiedSku instanceof HibernateProxy) {
deproxiedSku = HibernateUtils.deproxy(sku);
}
return deproxiedSku;
}
Aggregations