Search in sources :

Example 16 with PostLoaderDao

use of org.broadleafcommerce.common.persistence.PostLoaderDao in project BroadleafCommerce by BroadleafCommerce.

the class OrderItemImpl method getCategory.

@Override
public Category getCategory() {
    if (deproxiedCategory == null) {
        PostLoaderDao postLoaderDao = DefaultPostLoaderDao.getPostLoaderDao();
        if (category != null && postLoaderDao != null && category.getId() != null) {
            Long id = category.getId();
            deproxiedCategory = postLoaderDao.find(CategoryImpl.class, id);
        } else if (category != null && category instanceof HibernateProxy) {
            deproxiedCategory = HibernateUtils.deproxy(category);
        } else {
            deproxiedCategory = category;
        }
    }
    return deproxiedCategory;
}
Also used : CategoryImpl(org.broadleafcommerce.core.catalog.domain.CategoryImpl) DefaultPostLoaderDao(org.broadleafcommerce.common.persistence.DefaultPostLoaderDao) PostLoaderDao(org.broadleafcommerce.common.persistence.PostLoaderDao) HibernateProxy(org.hibernate.proxy.HibernateProxy) AdminPresentationMergeOverride(org.broadleafcommerce.common.presentation.override.AdminPresentationMergeOverride)

Aggregations

DefaultPostLoaderDao (org.broadleafcommerce.common.persistence.DefaultPostLoaderDao)16 PostLoaderDao (org.broadleafcommerce.common.persistence.PostLoaderDao)16 HibernateProxy (org.hibernate.proxy.HibernateProxy)16 AdminPresentationMergeOverride (org.broadleafcommerce.common.presentation.override.AdminPresentationMergeOverride)5 RequiredOverride (org.broadleafcommerce.common.presentation.RequiredOverride)2 SkuImpl (org.broadleafcommerce.core.catalog.domain.SkuImpl)2 CategoryImpl (org.broadleafcommerce.core.catalog.domain.CategoryImpl)1 ProductBundleImpl (org.broadleafcommerce.core.catalog.domain.ProductBundleImpl)1 ProductImpl (org.broadleafcommerce.core.catalog.domain.ProductImpl)1 OfferImpl (org.broadleafcommerce.core.offer.domain.OfferImpl)1