Search in sources :

Example 1 with PostLoaderDao

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

the class CandidateOrderOfferImpl method getOffer.

@Override
public Offer getOffer() {
    if (deproxiedOffer == null) {
        PostLoaderDao postLoaderDao = DefaultPostLoaderDao.getPostLoaderDao();
        if (postLoaderDao != null && offer.getId() != null) {
            Long id = offer.getId();
            deproxiedOffer = postLoaderDao.find(OfferImpl.class, id);
        } else if (offer instanceof HibernateProxy) {
            deproxiedOffer = HibernateUtils.deproxy(offer);
        } else {
            deproxiedOffer = offer;
        }
    }
    return deproxiedOffer;
}
Also used : DefaultPostLoaderDao(org.broadleafcommerce.common.persistence.DefaultPostLoaderDao) PostLoaderDao(org.broadleafcommerce.common.persistence.PostLoaderDao) HibernateProxy(org.hibernate.proxy.HibernateProxy)

Example 2 with PostLoaderDao

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

the class OrderAdjustmentImpl method getOffer.

@Override
public Offer getOffer() {
    if (deproxiedOffer == null) {
        PostLoaderDao postLoaderDao = DefaultPostLoaderDao.getPostLoaderDao();
        if (postLoaderDao != null && offer.getId() != null) {
            Long id = offer.getId();
            deproxiedOffer = postLoaderDao.find(OfferImpl.class, id);
        } else if (offer instanceof HibernateProxy) {
            deproxiedOffer = HibernateUtils.deproxy(offer);
        } else {
            deproxiedOffer = offer;
        }
    }
    return deproxiedOffer;
}
Also used : DefaultPostLoaderDao(org.broadleafcommerce.common.persistence.DefaultPostLoaderDao) PostLoaderDao(org.broadleafcommerce.common.persistence.PostLoaderDao) HibernateProxy(org.hibernate.proxy.HibernateProxy) AdminPresentationMergeOverride(org.broadleafcommerce.common.presentation.override.AdminPresentationMergeOverride)

Example 3 with PostLoaderDao

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

the class CandidateFulfillmentGroupOfferImpl method getOffer.

@Override
public Offer getOffer() {
    if (deproxiedOffer == null) {
        PostLoaderDao postLoaderDao = DefaultPostLoaderDao.getPostLoaderDao();
        if (postLoaderDao != null && offer.getId() != null) {
            Long id = offer.getId();
            deproxiedOffer = postLoaderDao.find(OfferImpl.class, id);
        } else if (offer instanceof HibernateProxy) {
            deproxiedOffer = HibernateUtils.deproxy(offer);
        } else {
            deproxiedOffer = offer;
        }
    }
    return deproxiedOffer;
}
Also used : DefaultPostLoaderDao(org.broadleafcommerce.common.persistence.DefaultPostLoaderDao) PostLoaderDao(org.broadleafcommerce.common.persistence.PostLoaderDao) HibernateProxy(org.hibernate.proxy.HibernateProxy)

Example 4 with PostLoaderDao

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

the class OrderItemQualifierImpl method getOffer.

@Override
public Offer getOffer() {
    if (deproxiedOffer == null) {
        PostLoaderDao postLoaderDao = DefaultPostLoaderDao.getPostLoaderDao();
        if (postLoaderDao != null && offer.getId() != null) {
            Long id = offer.getId();
            deproxiedOffer = postLoaderDao.find(OfferImpl.class, id);
        } else if (offer instanceof HibernateProxy) {
            deproxiedOffer = HibernateUtils.deproxy(offer);
        } else {
            deproxiedOffer = offer;
        }
    }
    return deproxiedOffer;
}
Also used : OfferImpl(org.broadleafcommerce.core.offer.domain.OfferImpl) DefaultPostLoaderDao(org.broadleafcommerce.common.persistence.DefaultPostLoaderDao) PostLoaderDao(org.broadleafcommerce.common.persistence.PostLoaderDao) HibernateProxy(org.hibernate.proxy.HibernateProxy)

Example 5 with PostLoaderDao

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

the class BundleOrderItemImpl 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;
}
Also used : SkuImpl(org.broadleafcommerce.core.catalog.domain.SkuImpl) DefaultPostLoaderDao(org.broadleafcommerce.common.persistence.DefaultPostLoaderDao) PostLoaderDao(org.broadleafcommerce.common.persistence.PostLoaderDao) HibernateProxy(org.hibernate.proxy.HibernateProxy)

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