Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * #%L
   * BroadleafCommerce Framework
   * %%
   * Copyright (C) 2009 - 2013 Broadleaf Commerce
   * %%
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
  * 
  *       http://www.apache.org/licenses/LICENSE-2.0
  * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * #L%
  */
 package org.broadleafcommerce.core.order.domain;
 
 
 import java.util.List;
 
 
 @Table(name = "BLC_FULFILLMENT_GROUP")
 @Cache(usage=., region="blOrderElements")
     {
         @AdminPresentationMergeOverride(name = "", mergeEntries =
                     @AdminPresentationMergeEntry(propertyType = ..,
                                                     booleanOverrideValue = true)),
         @AdminPresentationMergeOverride(name = "currency", mergeEntries =
             @AdminPresentationMergeEntry(propertyType = ..,
                         booleanOverrideValue = false)),
         @AdminPresentationMergeOverride(name = "personalMessage", mergeEntries = {
                 @AdminPresentationMergeEntry(propertyType = ..,
                         overrideValue = ....),
                 @AdminPresentationMergeEntry(propertyType = ..,
                         intOverrideValue = ....)
         }),
         @AdminPresentationMergeOverride(name = "address", mergeEntries = {
                 @AdminPresentationMergeEntry(propertyType = ..,
                         overrideValue = ....),
                 @AdminPresentationMergeEntry(propertyType = ..,
                         intOverrideValue = ....)
         }),
         @AdminPresentationMergeOverride(name = "address.isDefault", mergeEntries = {
                 @AdminPresentationMergeEntry(propertyType = ..,
                         booleanOverrideValue = true)
         }),
        @AdminPresentationMergeOverride(name = "address.isActive", mergeEntries = {
                @AdminPresentationMergeEntry(propertyType = ..,
                        booleanOverrideValue = true)
        }),
        @AdminPresentationMergeOverride(name = "address.isBusiness", mergeEntries = {
                @AdminPresentationMergeEntry(propertyType = ..,
                        booleanOverrideValue = true)
        }),
        @AdminPresentationMergeOverride(name = "phone", mergeEntries = {
                @AdminPresentationMergeEntry(propertyType = ..,
                        booleanOverrideValue = true)
        }),
        @AdminPresentationMergeOverride(name = "phone.phoneNumber", mergeEntries = {
                @AdminPresentationMergeEntry(propertyType = ..,
                        booleanOverrideValue = false),
                @AdminPresentationMergeEntry(propertyType = ..,
                        intOverrideValue = ...),
                @AdminPresentationMergeEntry(propertyType = ..,
                        overrideValue = "General"),
                @AdminPresentationMergeEntry(propertyType = ..,
                        overrideValue = "NOT_REQUIRED")
        })
    }
@AdminPresentationClass(populateToOneFields = ., friendlyName = "FulfillmentGroupImpl_baseFulfillmentGroup")
})
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(generator = "FulfillmentGroupId")
        name="FulfillmentGroupId",
        strategy="org.broadleafcommerce.common.persistence.IdOverrideTableGenerator",
        parameters = {
            @Parameter(name="segment_value", value="FulfillmentGroupImpl"),
            @Parameter(name="entity_name", value="org.broadleafcommerce.core.order.domain.FulfillmentGroupImpl")
        }
    )
    @Column(name = "FULFILLMENT_GROUP_ID")
    protected Long id;
    @Column(name = "REFERENCE_NUMBER")
    @Index(name="FG_REFERENCE_INDEX", columnNames={"REFERENCE_NUMBER"})
    @AdminPresentation(friendlyName = "FulfillmentGroupImpl_FG_Reference_Number", order=..,
            groupOrder = ...)
    protected String referenceNumber;
    @Column(name = "METHOD")
    @Index(name="FG_METHOD_INDEX", columnNames={"METHOD"})
    @AdminPresentation(excluded = true)
    @Deprecated
    protected String method;
    
    @Column(name = "SERVICE")
    @Index(name="FG_SERVICE_INDEX", columnNames={"SERVICE"})
    @AdminPresentation(excluded = true)
    @Deprecated
    protected String service;
    @Column(name = "RETAIL_PRICE", precision=19, scale=5)
    @AdminPresentation(friendlyName = "FulfillmentGroupImpl_Retail_Shipping_Price", order=..,
            group = ..., groupOrder = ...,
            tab = ..., tabOrder = ...,
            fieldType=.)
    @Column(name = "SALE_PRICE", precision=19, scale=5)
    @AdminPresentation(friendlyName = "FulfillmentGroupImpl_Sale_Shipping_Price", order=..,
            group = ..., groupOrder = ...,
            tab = ..., tabOrder = ...,
            fieldType=.)
    protected BigDecimal saleFulfillmentPrice;
    @Column(name = "PRICE", precision=19, scale=5)
    @AdminPresentation(friendlyName = "FulfillmentGroupImpl_Shipping_Price", order=..,
            group = ..., groupOrder = ...,
            tab = ..., tabOrder = ...,
            fieldType=.)
    protected BigDecimal fulfillmentPrice;
    @Column(name = "TYPE")
    @AdminPresentation(friendlyName = "FulfillmentGroupImpl_FG_Type", order=..,
            fieldType=.,
            broadleafEnumeration="org.broadleafcommerce.core.order.service.type.FulfillmentType",
            prominent = true, gridOrder = 3000)
    protected String type;
    @Column(name = "TOTAL_TAX", precision=19, scale=5)
    @AdminPresentation(friendlyName = "FulfillmentGroupImpl_FG_Total_Tax", order=..,
            group = ..., groupOrder = ...,
            tab = ..., tabOrder = ...,
            fieldType=.)
    protected BigDecimal totalTax;
    
    @Column(name = "TOTAL_ITEM_TAX", precision=19, scale=5)
    @AdminPresentation(friendlyName = "FulfillmentGroupImpl_FG_Total_Item_Tax", order=..,
            group = ..., groupOrder = ...,
            tab = ..., tabOrder = ...,
            fieldType=.)
    protected BigDecimal totalItemTax;
    
    @Column(name = "TOTAL_FEE_TAX", precision=19, scale=5)
    @AdminPresentation(friendlyName = "FulfillmentGroupImpl_FG_Total_Fee_Tax", order=..,
            group = ..., groupOrder = ...,
            tab = ..., tabOrder = ...,
            fieldType=.)
    protected BigDecimal totalFeeTax;
    
    @Column(name = "TOTAL_FG_TAX", precision=19, scale=5)
    @AdminPresentation(friendlyName = "FulfillmentGroupImpl_FG_Total_FG_Tax", order=..,
            group = ..., groupOrder = ...,
            tab = ..., tabOrder = ...,
            fieldType=.)
    @Column(name = "DELIVERY_INSTRUCTION")
    @AdminPresentation(friendlyName = "FulfillmentGroupImpl_FG_Delivery_Instruction", order=..)
    protected String deliveryInstruction;
    @Column(name = "IS_PRIMARY")
    @Index(name="FG_PRIMARY_INDEX", columnNames={"IS_PRIMARY"})
    @AdminPresentation(friendlyName = "FulfillmentGroupImpl_Primary_FG", order=..)
    protected boolean primary = false;
    @Column(name = "MERCHANDISE_TOTAL", precision=19, scale=5)
    @AdminPresentation(friendlyName = "FulfillmentGroupImpl_FG_Merchandise_Total", order=..,
            group = ..., groupOrder = ...,
            tab = ..., tabOrder = ...,
            fieldType=.)
    protected BigDecimal merchandiseTotal;
    @Column(name = "TOTAL", precision=19, scale=5)
    @AdminPresentation(friendlyName = "FulfillmentGroupImpl_FG_Total", order=..,
            group = ..., groupOrder = ...,
            tab = ..., tabOrder = ...,
            fieldType= ., prominent = true, gridOrder = 2000)
    protected BigDecimal total;
    @Column(name = "STATUS")
    @Index(name="FG_STATUS_INDEX", columnNames={"STATUS"})
    @AdminPresentation(friendlyName = "FulfillmentGroupImpl_FG_Status", order=..,
            fieldType=.,
            broadleafEnumeration="org.broadleafcommerce.core.order.service.type.FulfillmentGroupStatusType",
            prominent = true, gridOrder = 4000)
    protected String status;
    
    @Column(name = "SHIPPING_PRICE_TAXABLE")
    @AdminPresentation(friendlyName = "FulfillmentGroupImpl_Shipping_Price_Taxable", order=..,
            group = ..., groupOrder = ...,
            tab = ..., tabOrder = ...)
    
    @ManyToOne(targetEntity = FulfillmentOptionImpl.class, cascade = {..})
    @JoinColumn(name = "FULFILLMENT_OPTION_ID")
    
    @ManyToOne(targetEntity = OrderImpl.class, optional=false)
    @JoinColumn(name = "ORDER_ID")
    @Index(name="FG_ORDER_INDEX", columnNames={"ORDER_ID"})
    @AdminPresentation(excluded = true)
    protected Order order;
    
    @Column(name = "FULFILLMENT_GROUP_SEQUNCE")
    protected Integer sequence;
    @ManyToOne(targetEntity = AddressImpl.class, cascade = {..})
    @JoinColumn(name = "ADDRESS_ID")
    @Index(name="FG_ADDRESS_INDEX", columnNames={"ADDRESS_ID"})
    protected Address address;

    

Deprecated:
uses the phonePrimary property on AddressImpl instead
    @ManyToOne(targetEntity = PhoneImpl.class, cascade = {..})
    @JoinColumn(name = "PHONE_ID")
    @Index(name="FG_PHONE_INDEX", columnNames={"PHONE_ID"})
    @Deprecated
    protected Phone phone;
    
    @ManyToOne(targetEntity = PersonalMessageImpl.class, cascade = { . })
    @JoinColumn(name = "PERSONAL_MESSAGE_ID")
    @Index(name="FG_MESSAGE_INDEX", columnNames={"PERSONAL_MESSAGE_ID"})
    protected PersonalMessage personalMessage;
    
    @OneToMany(mappedBy = "fulfillmentGroup", targetEntity = FulfillmentGroupItemImpl.class, cascade = .,
            orphanRemoval = true)
    @Cache(usage=., region="blOrderElements")
    @AdminPresentationCollection(friendlyName="FulfillmentGroupImpl_Items",
            tab = ..., tabOrder = ...)
    
    @OneToMany(mappedBy = "fulfillmentGroup", targetEntity = FulfillmentGroupFeeImpl.class, cascade = { . },
            orphanRemoval = true)
    @Cache(usage = ., region = "blOrderElements")
    @AdminPresentationCollection(friendlyName="FulfillmentGroupImpl_Fees",
            tab = ..., tabOrder = ...)
        
    @OneToMany(mappedBy = "fulfillmentGroup", targetEntity = CandidateFulfillmentGroupOfferImpl.class, cascade = { . },
            orphanRemoval = true)
    @Cache(usage=., region="blOrderElements")
    @OneToMany(mappedBy = "fulfillmentGroup", targetEntity = FulfillmentGroupAdjustmentImpl.class, cascade = { . },
            orphanRemoval = true)
    @Cache(usage=., region="blOrderElements")
    @AdminPresentationCollection(friendlyName="FulfillmentGroupImpl_Adjustments",
            tab = ..., tabOrder = ...)
    
    @OneToMany(fetch = ., targetEntity = TaxDetailImpl.class, cascade = { . }, orphanRemoval = true)
    @JoinTable(name = "BLC_FG_FG_TAX_XREF", joinColumns = @JoinColumn(name = "FULFILLMENT_GROUP_ID"),
            inverseJoinColumns = @JoinColumn(name = "TAX_DETAIL_ID"))
    @Cache(usage=., region="blOrderElements")
    protected List<TaxDetailtaxes = new ArrayList<TaxDetail>();
    @Column(name = "SHIPPING_OVERRIDE")
    protected Boolean shippingOverride;
    @Override
    public Long getId() {
        return ;
    }
    @Override
    public void setId(Long id) {
        this. = id;
    }
    @Override
    public Order getOrder() {
        return ;
    }
    @Override
    public void setOrder(Order order) {
        this. = order;
    }
    @Override
        return ;
    }
    @Override
    public void setFulfillmentOption(FulfillmentOption fulfillmentOption) {
        this. = fulfillmentOption;
    }
    @Override
    public String getReferenceNumber() {
        return ;
    }
    @Override
    public void setReferenceNumber(String referenceNumber) {
        this. = referenceNumber;
    }
    @Override
        return ;
    }
    
    @Override
        List<DiscreteOrderItemdiscreteOrderItems = new ArrayList<DiscreteOrderItem>();
        for (FulfillmentGroupItem fgItem : ) {
            OrderItem orderItem = fgItem.getOrderItem();
            if (orderItem instanceof BundleOrderItem) {
                BundleOrderItemImpl bundleOrderItem = (BundleOrderItemImpl)orderItem;
                for (DiscreteOrderItem discreteOrderItem : bundleOrderItem.getDiscreteOrderItems()) {
                    discreteOrderItems.add(discreteOrderItem);
                }
            } else if (orderItem instanceof DiscreteOrderItem) {
                DiscreteOrderItem discreteOrderItem = (DiscreteOrderItem)orderItem;
                discreteOrderItems.add(discreteOrderItem);
            }
        }
        return discreteOrderItems;
    }
    @Override
    public void setFulfillmentGroupItems(List<FulfillmentGroupItemfulfillmentGroupItems) {
        this. = fulfillmentGroupItems;
    }
    @Override
    public void addFulfillmentGroupItem(FulfillmentGroupItem fulfillmentGroupItem) {
        if (this. == null) {
            this. = new Vector<FulfillmentGroupItem>();
        }
        this..add(fulfillmentGroupItem);
    }
    @Override
    public Address getAddress() {
        return ;
    }
    @Override
    public void setAddress(Address address) {
        this. = address;
    }

    

Deprecated:
use the phonePrimary property on the related Address instead
    @Deprecated
    @Override
    public Phone getPhone() {
        return ;
    }

    

Deprecated:
use the phonePrimary property on the related Address instead
    @Deprecated
    @Override
    public void setPhone(Phone phone) {
        this. = phone;
    }
    @Override
    @Deprecated
    public String getMethod() {
        return ;
    }
    @Override
    @Deprecated
    public void setMethod(String fulfillmentMethod) {
        this. = fulfillmentMethod;
    }
    @Override
    public Money getRetailFulfillmentPrice() {
        return  == null ? null :
                BroadleafCurrencyUtils.getMoney(getOrder().getCurrency());
    }
    @Override
    public void setRetailFulfillmentPrice(Money retailFulfillmentPrice) {
        this. = Money.toAmount(retailFulfillmentPrice);
    }
    @Override
    public Money getRetailShippingPrice() {
        return getRetailFulfillmentPrice();
    }
    @Override
    public void setRetailShippingPrice(Money retailShippingPrice) {
        setRetailFulfillmentPrice(retailShippingPrice);
    }
    @Override
    public FulfillmentType getType() {
        return FulfillmentType.getInstance();
    }
    @Override
    public void setType(FulfillmentType type) {
        this. = type == null ? null : type.getType();
    }
    @Override
        .add(candidateOffer);
    }
    @Override
        return ;
    }
    @Override
        this. = candidateOffers;
    }
    @Override
    public void removeAllCandidateOffers() {
        if ( != null) {
            for (CandidateFulfillmentGroupOffer offer : ) {
                offer.setFulfillmentGroup(null);
            }
            .clear();
        }
    }
    @Override
        return this.;
    }
    
    @Override
        Money adjustmentsValue = BroadleafCurrencyUtils.getMoney(.getOrder().getCurrency());
        for (FulfillmentGroupAdjustment adjustment : ) {
            adjustmentsValue = adjustmentsValue.add(adjustment.getValue());
        }
        return adjustmentsValue;
    }
    @Override
    public void removeAllAdjustments() {
        if ( != null) {
            for (FulfillmentGroupAdjustment adjustment : ) {
                adjustment.setFulfillmentGroup(null);
            }
            .clear();
        }
    }
    @Override
    public void setFulfillmentGroupAdjustments(List<FulfillmentGroupAdjustmentfulfillmentGroupAdjustments) {
        this. = fulfillmentGroupAdjustments;
    }
    @Override
    public Money getSaleFulfillmentPrice() {
        return  == null ? null : BroadleafCurrencyUtils.getMoney(,
                getOrder().getCurrency());
    }
    @Override
    public void setSaleFulfillmentPrice(Money saleFulfillmentPrice) {
        this. = Money.toAmount(saleFulfillmentPrice);
    }
    @Override
    public Money getSaleShippingPrice() {
        return getSaleFulfillmentPrice();
    }
    @Override
    public void setSaleShippingPrice(Money saleShippingPrice) {
        setSaleFulfillmentPrice(saleShippingPrice);
    }
    @Override
    public Money getFulfillmentPrice() {
        return  == null ? null : BroadleafCurrencyUtils.getMoney(,
                getOrder().getCurrency());
    }
    @Override
    public void setFulfillmentPrice(Money fulfillmentPrice) {
        this. = Money.toAmount(fulfillmentPrice);
    }
    @Override
    public Money getShippingPrice() {
        return getFulfillmentPrice();
    }
    @Override
    public void setShippingPrice(Money shippingPrice) {
        setFulfillmentPrice(shippingPrice);
    }
    
    @Override
    public List<TaxDetailgetTaxes() {
        return ;
    }
    @Override
    public void setTaxes(List<TaxDetailtaxes) {
        this. = taxes;
    }
    @Override
    public Money getTotalTax() {
        return  == null ? null : BroadleafCurrencyUtils.getMoney(getOrder().getCurrency());
    }
    @Override
    public void setTotalTax(Money totalTax) {
        this. = Money.toAmount(totalTax);
    }
    
    @Override
    public Money getTotalItemTax() {
        return  == null ? null : BroadleafCurrencyUtils.getMoney(getOrder().getCurrency());
    }
    @Override
    public void setTotalItemTax(Money totalItemTax) {
        this. = Money.toAmount(totalItemTax);
    }
    @Override
    public Money getTotalFeeTax() {
        return  == null ? null : BroadleafCurrencyUtils.getMoney(getOrder().getCurrency());
    }
    @Override
    public void setTotalFeeTax(Money totalFeeTax) {
        this. = Money.toAmount(totalFeeTax);
    }
    @Override
        return  == null ? null : BroadleafCurrencyUtils.getMoney(,
                getOrder().getCurrency());
    }
    @Override
    public void setTotalFulfillmentGroupTax(Money totalFulfillmentGroupTax) {
        this. = Money.toAmount(totalFulfillmentGroupTax);
    }
    @Override
    public String getDeliveryInstruction() {
        return ;
    }
    @Override
    public void setDeliveryInstruction(String deliveryInstruction) {
        this. = deliveryInstruction;
    }
    @Override
        return ;
    }
    @Override
    public void setPersonalMessage(PersonalMessage personalMessage) {
        this. = personalMessage;
    }
    @Override
    public boolean isPrimary() {
        return ;
    }
    @Override
    public void setPrimary(boolean primary) {
        this. = primary;
    }
    @Override
    public Money getMerchandiseTotal() {
        return  == null ? null : BroadleafCurrencyUtils.getMoney(,
                getOrder().getCurrency());
    }
    @Override
    public void setMerchandiseTotal(Money merchandiseTotal) {
        this. = Money.toAmount(merchandiseTotal);
    }
    @Override
    public Money getTotal() {
        return  == null ? null : BroadleafCurrencyUtils.getMoney(getOrder().getCurrency());
    }
    @Override
    public void setTotal(Money orderTotal) {
        this. = Money.toAmount(orderTotal);
    }
    
    @Override
        return FulfillmentGroupStatusType.getInstance();
    }
    @Override
    public void setStatus(FulfillmentGroupStatusType status) {
        this. = status.getType();
    }
    @Override
        return ;
    }
    @Override
    public void setFulfillmentGroupFees(List<FulfillmentGroupFeefulfillmentGroupFees) {
        this. = fulfillmentGroupFees;
    }
    @Override
    public void addFulfillmentGroupFee(FulfillmentGroupFee fulfillmentGroupFee) {
        if ( == null) {
             = new ArrayList<FulfillmentGroupFee>();
        }
        .add(fulfillmentGroupFee);
    }
    @Override
    public void removeAllFulfillmentGroupFees() {
        if ( != null) {
            .clear();
        }
    }
    @Override
    public Boolean isShippingPriceTaxable() {
        return ;
    }
    @Override
    public void setIsShippingPriceTaxable(Boolean isShippingPriceTaxable) {
        this. = isShippingPriceTaxable;
    }
    @Override
    public void setSequence(Integer sequence) {
        this. = sequence;
    }
    @Override
    public Integer getSequence() {
        return this.;
    }
    @Override
    @Deprecated
    public String getService() {
        return ;
    }
    @Override
    @Deprecated
    public void setService(String service) {
        this. = service;
    }
    @Override
    public String getCurrencyCode() {
        if (getOrder().getCurrency() != null) {
            return getOrder().getCurrency().getCurrencyCode();
        }
        return null;
    }
    @Override
    public Boolean getShippingOverride() {
        return  == null ? false : ;
    }
    @Override
    public void setShippingOverride(Boolean shippingOverride) {
        this. = shippingOverride;
    }
    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + (( == null) ? 0 : .hashCode());
        result = prime * result + (( == null) ? 0 : .hashCode());
        return result;
    }
    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        FulfillmentGroupImpl other = (FulfillmentGroupImplobj;
        if ( != null && other.id != null) {
            return .equals(other.id);
        }
        if ( == null) {
            if (other.address != null) {
                return false;
            }
        } else if (!.equals(other.address)) {
            return false;
        }
        if ( == null) {
            if (other.fulfillmentGroupItems != null) {
                return false;
            }
        } else if (!.equals(other.fulfillmentGroupItems)) {
            return false;
        }
        return true;
    }
    public static class Presentation {
        public static class Tab {
            public static class Name {
                public static final String Items = "FulfillmentGroupImpl_Items_Tab";
                public static final String Pricing = "FulfillmentGroupImpl_Pricing_Tab";
                public static final String Address = "FulfillmentGroupImpl_Address_Tab";
                public static final String Advanced = "FulfillmentGroupImpl_Advanced_Tab";
            }
            public static class Order {
                public static final int Items = 2000;
                public static final int Pricing = 3000;
                public static final int Address = 4000;
                public static final int Advanced = 5000;
            }
        }
        public static class Group {
            public static class Name {
                public static final String Pricing = "FulfillmentGroupImpl_Pricing";
            }
            public static class Order {
                public static final int General = 1000;
                public static final int Pricing = 2000;
            }
        }
        public static class FieldOrder {
            public static final int REFNUMBER = 3000;
            public static final int STATUS = 4000;
            public static final int TYPE = 5000;
            public static final int DELIVERINSTRUCTION = 6000;
            public static final int PRIMARY = 7000;
            public static final int PHONE = 8000;
            public static final int RETAIL = 1000;
            public static final int SALE = 2000;
            public static final int PRICE = 3000;
            public static final int ITEMTAX = 4000;
            public static final int FEETAX = 5000;
            public static final int FGTAX = 6000;
            public static final int TOTALTAX = 7000;
            public static final int MERCHANDISETOTAL = 8000;
            public static final int TOTAL = 9000;
            public static final int TAXABLE = 10000;
        }
    }