com.elasticpath.domain
Interface Persistence

All Superinterfaces:
EpDomain, java.io.Serializable
All Known Subinterfaces:
Address, AppliedRule, Attribute, AttributeGroup, AttributeGroupAttribute, AttributeUsage, AttributeValue, AttributeValueGroup, AttributeValueWithType, Brand, CartItem, CartItemBean, Category, CategoryDeleted, CategoryType, CmUser, Customer, CustomerAddress, CustomerAuthentication, CustomerCreditCard, CustomerDeleted, CustomerGroup, CustomerRole, CustomerSession, DigitalAsset, DigitalAssetAudit, Entity, ImportJob, Inventory, InventoryAudit, LocaleDependantFields, LocalizedProperties, Order, OrderAddress, OrderNote, OrderNumberGenerator, OrderPayment, OrderReturn, OrderReturnSku, OrderShipment, OrderSku, Price, PriceTier, PriceTierAdaptor, Product, ProductAssociation, ProductCategory, ProductDeleted, ProductPrice, ProductSku, ProductSkuSpec, ProductType, PromotionRuleDelegate, PromotionRuleExceptions, Rule, RuleAction, RuleCondition, RuleElement, RuleEligibility, RuleException, RuleParameter, RuleSet, SfSearchLog, ShippingCostCalculationMethod, ShippingCostCalculationParameter, ShippingRegion, ShippingServiceLevel, ShippingServiceLevelBean, ShoppingCart, SkuOption, SkuOptionValue, SkuPrice, TaxCategory, TaxCode, TaxJurisdiction, TaxJurisdictionCategoryX, TopSeller, UserPermission, UserRole, ValueObject
All Known Implementing Classes:
AbstractAddressImpl, AbstractCartItemImpl, AbstractEntityImpl, AbstractPersistenceImpl, AbstractPriceImpl, AbstractRuleActionImpl, AbstractRuleElementImpl, AbstractRuleExceptionImpl, AbstractRuleImpl, AbstractSearchCriteriaImpl, AbstractShippingCostCalculationMethodImpl, AbstractValueObjectImpl, AppliedRuleImpl, AttributeGroupAttributeImpl, AttributeGroupImpl, AttributeImpl, AttributeUsageImpl, AttributeValueGroupImpl, AttributeValueImpl, BrandConditionImpl, BrandImpl, CartCategoryAmountDiscountActionImpl, CartCategoryPercentDiscountActionImpl, CartContainsItemsOfCategoryConditionImpl, CartCurrencyConditionImpl, CartItemBeanImpl, CartNFreeSkusActionImpl, CartNthProductPercentDiscountActionImpl, CartProductAmountDiscountActionImpl, CartProductPercentDiscountActionImpl, CartSkuAmountDiscountActionImpl, CartSkuPercentDiscountActionImpl, CartSubtotalAmountDiscountActionImpl, CartSubtotalConditionImpl, CartSubtotalDiscountActionImpl, CartSubtotalPercentDiscountActionImpl, CatalogSkuAmountDiscountActionImpl, CatalogSkuPercentDiscountActionImpl, CategoryDeletedImpl, CategoryExceptionImpl, CategoryImpl, CategorySearchCriteriaImpl, CategoryTypeImpl, CmUserImpl, CostPerUnitWeightMethodImpl, CustomerAddressImpl, CustomerAuthenticationImpl, CustomerCreditCardImpl, CustomerDeletedImpl, CustomerGroupEligibilityImpl, CustomerGroupImpl, CustomerImpl, CustomerProfileImpl, CustomerRoleImpl, CustomerSearchCriteriaImpl, CustomerSessionImpl, DigitalAssetAuditImpl, DigitalAssetImpl, EveryoneEligibilityImpl, ExistingCustomerEligibilityImpl, FirstTimeBuyerEligibilityImpl, FixedBaseAndCostPerUnitWeightMethodImpl, FixedBaseAndOrderTotalPercentageMethodImpl, FixedPriceMethodImpl, ImportJobImpl, InventoryAuditImpl, InventoryImpl, LocaleDependantFieldsImpl, LocalizedPropertiesImpl, OrderAddressImpl, OrderImpl, OrderNoteImpl, OrderNumberGeneratorImpl, OrderPaymentImpl, OrderReturnImpl, OrderReturnSkuImpl, OrderSearchCriteriaImpl, OrderShipmentImpl, OrderSkuImpl, OrderTotalPercentageMethodImpl, PriceTierAdaptorImpl, PriceTierImpl, ProductAmountDiscountActionImpl, ProductAssociationImpl, ProductCategoryConditionImpl, ProductCategoryImpl, ProductConditionImpl, ProductDeletedImpl, ProductExceptionImpl, ProductImpl, ProductInCartConditionImpl, ProductPercentDiscountActionImpl, ProductPriceImpl, ProductSearchCriteriaImpl, ProductSkuImpl, ProductSkuSpecImpl, ProductTypeImpl, PromotionRuleDelegateImpl, PromotionRuleExceptionsImpl, PromotionRuleImpl, RuleParameterImpl, RuleSetImpl, SfSearchLogImpl, ShippingAmountDiscountActionImpl, ShippingCostCalculationParameterImpl, ShippingPercentDiscountActionImpl, ShippingRegionImpl, ShippingServiceLevelBeanImpl, ShippingServiceLevelImpl, ShoppingCartImpl, ShoppingCartItemImpl, SkuExceptionImpl, SkuInCartConditionImpl, SkuOptionImpl, SkuOptionValueImpl, SkuPriceImpl, TaxCategoryImpl, TaxCodeImpl, TaxJurisdictionCategoryXImpl, TaxJurisdictionImpl, TopSellerImpl, UserPermissionImpl, UserRoleImpl, WishListItemImpl

public interface Persistence
extends EpDomain

Represents domain objects need to be persisted.


Method Summary
 void executeBeforePersistAction()
          Interceptor to perform tasks before persisting changes.
 long getUidPk()
          Gets the unique identifier for this domain object.
 boolean isPersistent()
          true if the object has previously been persisted.
 void setDefaultValues()
          Set default values for those fields need default values and it's somehow expensive to create the default values for them, either from memory perspective or cpu perspective.
 void setUidPk(long uidPk)
          Sets the unique identifier for this domain model object.
 
Methods inherited from interface com.elasticpath.domain.EpDomain
getElasticPath, setElasticPath
 

Method Detail

executeBeforePersistAction

void executeBeforePersistAction()
Interceptor to perform tasks before persisting changes.


getUidPk

long getUidPk()
Gets the unique identifier for this domain object. This unique identifier is system-dependant. That means on differenct systems(like staging and production environments), different identifiers might be assigned to the same(from business perspective) domain object.

Notice: not all persistent domain objects has unique identifier. Some value objects don't have unique identifer. They are cascading loaded and updated through their parents.

Returns:
the unique identifier.

isPersistent

boolean isPersistent()
true if the object has previously been persisted.

Notice: not all persistent domain objects has unique identifier. Some value objects don't have unique identifer. They are cascading loaded and updated through their parents. It doesn't make sense to call this method on those value object.

Returns:
true if the object has previously been persisted.

setDefaultValues

void setDefaultValues()
Set default values for those fields need default values and it's somehow expensive to create the default values for them, either from memory perspective or cpu perspective. A good example of a memory expensive field will be a field with type Map. Another good example of a cpu expensive field will be a field like GUID, current date, etc. We prefer this way rather than using the domain object constructor. It doesn't make sense to set default values everytime when creating a new domain object, because most of the time the default value you set will be overwritten by hibernate immediately.


setUidPk

void setUidPk(long uidPk)
Sets the unique identifier for this domain model object.

Parameters:
uidPk - the new unique identifier.