Class InMemoryCartEntry
java.lang.Object
de.hybris.platform.util.BridgeAbstraction
de.hybris.platform.jalo.Item
de.hybris.platform.jalo.ExtensibleItem
de.hybris.platform.jalo.c2l.LocalizableItem
de.hybris.platform.jalo.GenericItem
de.hybris.platform.jalo.order.GeneratedAbstractOrderEntry
de.hybris.platform.jalo.order.AbstractOrderEntry
de.hybris.platform.jalo.order.GeneratedCartEntry
de.hybris.platform.jalo.order.CartEntry
de.hybris.platform.servicelayer.internal.jalo.order.GeneratedInMemoryCartEntry
de.hybris.platform.servicelayer.internal.jalo.order.InMemoryCartEntry
- All Implemented Interfaces:
JaloOnlyItem,Serializable,Comparable
Specific in-memory
CartEntry implementation required by InMemoryCart. This item is not backed by
database and exists only inside its owning cart. Apart from that it can be used as normal cart entry.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class de.hybris.platform.jalo.GenericItem
GenericItem.GenericItemImplNested classes/interfaces inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LocalizableItem.LocalizableItemImplNested classes/interfaces inherited from class de.hybris.platform.jalo.ExtensibleItem
ExtensibleItem.ExtensibleItemImplNested classes/interfaces inherited from class de.hybris.platform.jalo.Item
Item.AttributeFilter, Item.AttributeMode, Item.CachedGetter, Item.CachedSetter, Item.ItemAttributeMap, Item.ItemConstraint, Item.ItemImpl, Item.JaloCachedComputationException -
Field Summary
Fields inherited from class de.hybris.platform.servicelayer.internal.jalo.order.GeneratedInMemoryCartEntry
DEFAULT_INITIAL_ATTRIBUTES, ORDERHANDLERFields inherited from class de.hybris.platform.jalo.order.AbstractOrderEntry
DISCOUNTVALUES, ENTRY_NUMBER, TAXVALUESFields inherited from class de.hybris.platform.jalo.order.GeneratedAbstractOrderEntry
BASEPRICE, CALCULATED, DISCOUNTVALUESINTERNAL, ENTRYGROUPNUMBERS, ENTRYNUMBER, GIVEAWAY, INFO, ORDER, PRODUCT, QUANTITY, REJECTED, TAXVALUESINTERNAL, TOTALPRICE, UNITFields inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LANGUAGE_FALLBACK_ENABLEDFields inherited from class de.hybris.platform.jalo.Item
_CREATION_TIME_INTERNAL, _MODIFIED_TIME_INTERNAL, accessorLog, CREATION_TIME, DISABLE_ATTRIBUTE_CHECK, DISABLE_ITEMCHECK_BEFORE_REMOVABLE, EVEN, FEATURE_ACCESSMAP_QUALIFIER, HJMPTS, INITIAL_CREATION_FLAG, isJaloOnly, MODIFIED_TIME, NEGATIVE, NOT_FOUND, OWNER, PK, POSITIVE, SAVE_FROM_SERVICE_LAYER, staticTransientObjects, TYPEFields inherited from class de.hybris.platform.util.BridgeAbstraction
impl, tenant -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ItemcreateItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes) Has to be implemented for each concrete subtype of item.doGetAttribute(SessionContext ctx, String attrQualifier) Custom attribute access as part ofJaloOnlyItemcontract.voiddoSetAttribute(SessionContext ctx, String attrQualifier, Object value) Custom attribute access as part ofJaloOnlyItemcontract.Overwritten to provide in-memory implementation.Generated method - Getter of theAbstractOrderEntry.discountValuesInternalattribute.Overwritten to provide in-memory implementation.getInfo(SessionContext ctx) Overwritten to provide in-memory implementation.protected Item.ItemAttributeMapgetNonInitialAttributes(SessionContext ctx, Item.ItemAttributeMap allAttributes) The default implementation ofGenericItem.getNonInitialAttributes(SessionContext, Item.ItemAttributeMap)assures that the 'registered initial' propertiesGenericItem.getInitialProperties(JaloSession, Item.ItemAttributeMap)will be removed from the 'non initial map'.getOrder(SessionContext ctx) Overwritten to provide in-memory implementation.getProduct(SessionContext ctx) Overwritten to provide in-memory implementation.Overwritten to provide in-memory implementation.Generated method - Getter of theAbstractOrderEntry.taxValuesInternalattribute.Overwritten to provide in-memory implementation.getUnit(SessionContext ctx) Overwritten to provide in-memory implementation.Overwritten to provide in-memory implementation.isGiveAway(SessionContext ctx) Overwritten to provide in-memory implementation.isRejected(SessionContext ctx) Overwritten to provide in-memory implementation.final ComposedTypeProvides composed as part ofJaloOnlyItemcontract.final DateProvides creation time as part ofJaloOnlyItemcontract.final DateProvides modification time as part ofJaloOnlyItemcontract.final PKProvides PK part ofJaloOnlyItemcontract.voidCustom removal logic as part ofJaloOnlyItemcontract.voidsetBasePrice(SessionContext ctx, double price) Overwritten to provide in-memory implementation.voidsetCalculated(SessionContext ctx, boolean calculated) Overwritten to provide in-memory implementation.voidsetDiscountValuesInternal(SessionContext ctx, String value) Generated method - Setter of theAbstractOrderEntry.discountValuesInternalattribute.protected voidsetEntryNumberDirect(int nr) Changes entry number directly.voidsetGiveAway(SessionContext ctx, boolean giveaway) Overwritten to provide in-memory implementation.voidsetInfo(SessionContext ctx, String info) Overwritten to provide in-memory implementation.voidOverwritten to provide in-memory implementation.voidsetOrder(SessionContext ctx, AbstractOrder order) Generated method - Setter of theAbstractOrderEntry.orderattribute.voidsetProduct(SessionContext ctx, Product p) Overwritten to provide in-memory implementation.voidsetQuantity(SessionContext ctx, long qtd) Overwritten to provide in-memory implementation.voidsetRejected(SessionContext ctx, boolean rejected) Overwritten to provide in-memory implementation.voidsetTaxValuesInternal(SessionContext ctx, String value) Generated method - Setter of theAbstractOrderEntry.taxValuesInternalattribute.voidsetTotalPrice(SessionContext ctx, double price) Overwritten to provide in-memory implementation.voidsetUnit(SessionContext ctx, Unit unit) Overwritten to provide in-memory implementation.Methods inherited from class de.hybris.platform.servicelayer.internal.jalo.order.GeneratedInMemoryCartEntry
getDefaultAttributeModesMethods inherited from class de.hybris.platform.jalo.order.AbstractOrderEntry
addAllDiscountValues, addAllDiscountValues, addAllDisocuntValues, addAllTaxValues, addAllTaxValues, addDiscountValue, addDiscountValue, addTaxValue, addTaxValue, applyDiscounts, calculate, calculateTotals, compareTo, findDiscounts, findPrice, findTaxes, getDiscountValues, getDiscountValues, getTaxValues, getTaxValues, recalculate, remove, removeAllDiscountValues, removeAllDiscountValues, removeAllTaxValues, removeAllTaxValues, removeDiscountValue, removeDiscountValue, removeTaxValue, removeTaxValue, removeWithoutOrderNotification, resetAllValues, setBasePrice, setChanged, setDiscountValues, setDiscountValues, setEntryNumber, setGiveAway, setQuantity, setRejected, setTaxValues, setTaxValues, toStringMethods inherited from class de.hybris.platform.jalo.order.GeneratedAbstractOrderEntry
getBasePrice, getBasePriceAsPrimitive, getBasePriceAsPrimitive, getDiscountValuesInternal, getEntryGroupNumbers, getEntryGroupNumbers, getEntryNumber, getEntryNumberAsPrimitive, getEntryNumberAsPrimitive, getInfo, getOrder, getProduct, getQuantity, getQuantityAsPrimitive, getQuantityAsPrimitive, getTaxValuesInternal, getTotalPrice, getTotalPriceAsPrimitive, getTotalPriceAsPrimitive, getUnit, isCalculated, isCalculatedAsPrimitive, isCalculatedAsPrimitive, isGiveAway, isGiveAwayAsPrimitive, isGiveAwayAsPrimitive, isRejected, isRejectedAsPrimitive, isRejectedAsPrimitive, setBasePrice, setBasePrice, setCalculated, setCalculated, setCalculated, setDiscountValuesInternal, setEntryGroupNumbers, setEntryGroupNumbers, setEntryNumber, setEntryNumber, setEntryNumber, setGiveAway, setGiveAway, setInfo, setOrder, setProduct, setQuantity, setQuantity, setRejected, setRejected, setTaxValuesInternal, setTotalPrice, setTotalPrice, setTotalPrice, setUnitMethods inherited from class de.hybris.platform.jalo.GenericItem
getImplementation, getInitialProperties, getRelatedItems, getRelatedItems, setRelatedItemsMethods inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
getAllLocalizedProperties, getAllLocalizedProperties, getAllLocalizedProperties, getAllLocalizedProperties, getAllValuesSessionContext, getLocalizedProperty, getLocalizedProperty, getLocalizedPropertyInternal, getLocalizedPropertyNames, getLocalizedPropertyNames, hasLanguage, isEmptyValue, isFallbackEnabled, removeLocalizedProperty, removeLocalizedProperty, setAllLocalizedProperties, setAllLocalizedProperties, setLocalizedProperty, setLocalizedPropertyMethods inherited from class de.hybris.platform.jalo.ExtensibleItem
createNonClassAccessor, getAllProperties, getAllProperties, getProperty, getProperty, getPropertyNames, getPropertyNames, removeProperty, removeProperty, setAllProperties, setAllProperties, setProperty, setPropertyMethods inherited from class de.hybris.platform.jalo.Item
addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addNegativePermission, addPermission, addPositivePermission, assureExtensionsLoaded, changeTypeAfterCreation, checkConstraint, checkItemPermission, checkMandatoryAttribute, checkMandatoryAttribute, checkPermission, checkPermission, checkRemovable, clearPermission, ctx, doAfterRemove, doBeforeRemove, equals, getAccessorFor, getAllAttributes, getAllAttributes, getAllAttributes, getAllAttributes, getAllAttributesInternal, getAllLinkedItems, getAndCheckCacheBoundItem, getAttribute, getAttribute, getCacheBoundItem, getComposedType, getComposedTypePK, getCreationTime, getCurrentlyRemovingCount, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItemsCount, getLinkedItemsCount, getLinkedItemsCount, getModificationTime, getNegativePermissions, getOwner, getPartOfRemovedSessionMarker, getPermissionMap, getPermissions, getPersistenceVersion, getPK, getPositivePermissions, getRestrictedPrincipals, getSession, getSyncObject, getTenant, getTransientObject, getTransientObjectMap, hashCode, hasRegisteredClassAccessorFor, internal_registerClassAccessorFor, internal_registerNonClassAccessorFor, invalidateLocalCaches, isAlive, isCacheBound, isCurrentlyRemoving, isCurrentlyRemoving, isEmptyRelationValue, isInCreate, isInstanceOf, isItemCheckBeforeRemoveableDisabled, isMarkModifiedDisabled, isRelationLocalizationFallbackEnabled, newInstance, notifyExtensionsAfterItemCreation, notifyExtensionsBeforeItemCreation, notifyItemRemoval, notifyManagerAboutItemRemoval, readResolve, registerAccessFor, registerAccessFor, registerJaloInvalidationListeners, remove, removeItemCollection, removeItemCollection, removeLinkedItems, removeLinkedItems, removeLinkedItems, removeLinkedItems, removeLinks, removePartOfItems, removePartOfItems, setAllAttributes, setAllAttributes, setAllAttributesInternal, setAllLinkedItems, setAllLinkedItems, setAllLinkedItems, setAllLinkedItems, setAttribute, setAttribute, setAttributeFromString, setAttributeFromString, setCacheBound, setComposedType, setCreationTime, setImplementation, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setNonInitialAttributes, setOwner, setPermissionsByMap, setTransientObject, setUseTA, suppressRelation, useTA, writeReplaceMethods inherited from class de.hybris.platform.util.BridgeAbstraction
setTenant
-
Constructor Details
-
InMemoryCartEntry
public InMemoryCartEntry()
-
-
Method Details
-
createItem
protected Item createItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes) throws JaloBusinessException Description copied from class:ItemHas to be implemented for each concrete subtype of item. This method is responsible for creating a new item instance ( by calling managers, ejb homes, etc. ) duringComposedType.newInstance(Map).In case this method uses any of the attribute values during creation it is required to override
Item.getNonInitialAttributes(SessionContext, ItemAttributeMap)too.
Sn example:public static final String MY_ATTRIBUTE = "someAttribute"; ... protected Item createItem(SessionContext ctx, ComposedType type, Map allAttributes ) throws JaloBusinessException { MyManager man = ... return man.createMyItem( (String)allAttributes.get(MY_ATTRIBUTE) ); // here MY_ATTRIBUTE is used for creation, so it must not be set again } protected Map getNonInitialAttributes( SessionContext ctx, Map allAttributes ) { // let superclass remove its own initial attributes Map ret = super.getNonInitialAttributes( ctx, allAttributes ); // remove MY_ATTRIBUTE from all attributes since if has already been set ret.remove(MY_ATTRIBUTE); return ret; }- Overrides:
createItemin classGeneratedInMemoryCartEntry- Parameters:
ctx- the current session context which this item is created withintype- the actual item type ( since subtypes may not provide a own jalo class this may be different from the type which this method was implemented for )- Returns:
- the new item instance
- Throws:
JaloBusinessException- indicates an error during creation - any changes will be rollbacked
-
getNonInitialAttributes
protected Item.ItemAttributeMap getNonInitialAttributes(SessionContext ctx, Item.ItemAttributeMap allAttributes) Description copied from class:GenericItemThe default implementation ofGenericItem.getNonInitialAttributes(SessionContext, Item.ItemAttributeMap)assures that the 'registered initial' propertiesGenericItem.getInitialProperties(JaloSession, Item.ItemAttributeMap)will be removed from the 'non initial map'.- Overrides:
getNonInitialAttributesin classGenericItem- Parameters:
ctx- session context with language = NULLallAttributes- aItemAttributeMapcontaning attribute values.- Returns:
- a
ItemAttributeMapcontaining all attribute values, which belong to non-initial attributes.
-
provideComposedType
Provides composed as part ofJaloOnlyItemcontract. Never call directly- Specified by:
provideComposedTypein interfaceJaloOnlyItem- Returns:
- ComposedType of this item
-
provideCreationTime
Provides creation time as part ofJaloOnlyItemcontract. Never call directly- Specified by:
provideCreationTimein interfaceJaloOnlyItem- Returns:
- creation time date of this item
-
provideModificationTime
Provides modification time as part ofJaloOnlyItemcontract. Never call directly- Specified by:
provideModificationTimein interfaceJaloOnlyItem- Returns:
- modification time date of this item
-
providePK
Provides PK part ofJaloOnlyItemcontract. Never call directly- Specified by:
providePKin interfaceJaloOnlyItem- Returns:
- PK of this item
-
removeJaloOnly
Custom removal logic as part ofJaloOnlyItemcontract. Never call directly- Specified by:
removeJaloOnlyin interfaceJaloOnlyItem- Throws:
ConsistencyCheckException- to signal that this item removal failed
-
doGetAttribute
public Object doGetAttribute(SessionContext ctx, String attrQualifier) throws JaloInvalidParameterException, JaloSecurityException Custom attribute access as part ofJaloOnlyItemcontract. Never call directly- Specified by:
doGetAttributein interfaceJaloOnlyItem- Parameters:
ctx- the session contextattrQualifier- the qualifier of the requested attribute- Returns:
- the attribute value
- Throws:
JaloInvalidParameterException- in case no value could be read for this attributeJaloSecurityException
-
doSetAttribute
public void doSetAttribute(SessionContext ctx, String attrQualifier, Object value) throws JaloInvalidParameterException, JaloSecurityException, JaloBusinessException Custom attribute access as part ofJaloOnlyItemcontract. Never call directly- Specified by:
doSetAttributein interfaceJaloOnlyItem- Parameters:
ctx- the session contextattrQualifier- the qualifier of the requested attributevalue- the new attribute value- Throws:
JaloInvalidParameterException- in case the value could not be written for this attributeJaloSecurityException- in case the session user is not allowed to write this attributeJaloBusinessException- in case any other error occured
-
getOrder
Overwritten to provide in-memory implementation. SeeAbstractOrderEntry.getOrder(SessionContext)for details.- Overrides:
getOrderin classAbstractOrderEntry- Parameters:
ctx- can be used for cached access object may be outdated!- Returns:
- the
AbstractOrderthis abstract order entry is associated to
-
setOrder
Description copied from class:GeneratedAbstractOrderEntryGenerated method - Setter of theAbstractOrderEntry.orderattribute.- Overrides:
setOrderin classAbstractOrderEntryorder- the order
-
getProduct
Overwritten to provide in-memory implementation. SeeGeneratedAbstractOrderEntry.getProduct(SessionContext)for details.- Overrides:
getProductin classGeneratedAbstractOrderEntry- Returns:
- the product
-
setProduct
Overwritten to provide in-memory implementation. SeeAbstractOrderEntry.setProduct(SessionContext, Product)for details.- Overrides:
setProductin classAbstractOrderEntry- Parameters:
ctx- can be used for cached access object may be outdated!p- the product
-
getQuantity
Overwritten to provide in-memory implementation. SeeGeneratedAbstractOrderEntry.getQuantity(SessionContext)for details.- Overrides:
getQuantityin classGeneratedAbstractOrderEntry- Returns:
- the quantity
-
setQuantity
Overwritten to provide in-memory implementation. SeeGeneratedAbstractOrderEntry.setQuantity(SessionContext, long)for details.- Overrides:
setQuantityin classGeneratedAbstractOrderEntryqtd- the quantity
-
getUnit
Overwritten to provide in-memory implementation. SeeGeneratedAbstractOrderEntry.getUnit(SessionContext)for details.- Overrides:
getUnitin classGeneratedAbstractOrderEntry- Returns:
- the unit
-
setUnit
Overwritten to provide in-memory implementation. SeeAbstractOrderEntry.setUnit(SessionContext, Unit)for details.- Overrides:
setUnitin classAbstractOrderEntry- Parameters:
ctx- can be used for cached access object may be outdated!unit- the unit
-
getInfo
Overwritten to provide in-memory implementation. SeeGeneratedAbstractOrderEntry.getInfo(SessionContext)for details.- Overrides:
getInfoin classGeneratedAbstractOrderEntry- Returns:
- the info
-
setInfo
Overwritten to provide in-memory implementation. SeeGeneratedAbstractOrderEntry.setInfo(SessionContext, String)for details.- Overrides:
setInfoin classGeneratedAbstractOrderEntryinfo- the info
-
getBasePrice
Overwritten to provide in-memory implementation. SeeGeneratedAbstractOrderEntry.getBasePrice(SessionContext)for details.- Overrides:
getBasePricein classGeneratedAbstractOrderEntry- Returns:
- the basePrice
-
setBasePrice
Overwritten to provide in-memory implementation. SeeGeneratedAbstractOrderEntry.setBasePrice(SessionContext, double)for details.- Overrides:
setBasePricein classGeneratedAbstractOrderEntryprice- the basePrice
-
getTotalPrice
Overwritten to provide in-memory implementation. SeeGeneratedAbstractOrderEntry.getTotalPrice(SessionContext)for details.- Overrides:
getTotalPricein classGeneratedAbstractOrderEntry- Returns:
- the totalPrice
-
setTotalPrice
Overwritten to provide in-memory implementation. SeeGeneratedAbstractOrderEntry.setTotalPrice(SessionContext, double)for details.- Overrides:
setTotalPricein classGeneratedAbstractOrderEntryprice- the totalPrice
-
getTaxValuesInternal
Description copied from class:GeneratedAbstractOrderEntryGenerated method - Getter of theAbstractOrderEntry.taxValuesInternalattribute.- Overrides:
getTaxValuesInternalin classGeneratedAbstractOrderEntry- Returns:
- the taxValuesInternal
-
setTaxValuesInternal
Description copied from class:GeneratedAbstractOrderEntryGenerated method - Setter of theAbstractOrderEntry.taxValuesInternalattribute.- Overrides:
setTaxValuesInternalin classGeneratedAbstractOrderEntryvalue- the taxValuesInternal
-
getDiscountValuesInternal
Description copied from class:GeneratedAbstractOrderEntryGenerated method - Getter of theAbstractOrderEntry.discountValuesInternalattribute.- Overrides:
getDiscountValuesInternalin classGeneratedAbstractOrderEntry- Returns:
- the discountValuesInternal
-
setDiscountValuesInternal
Description copied from class:GeneratedAbstractOrderEntryGenerated method - Setter of theAbstractOrderEntry.discountValuesInternalattribute.- Overrides:
setDiscountValuesInternalin classGeneratedAbstractOrderEntryvalue- the discountValuesInternal
-
isCalculated
Overwritten to provide in-memory implementation. SeeAbstractOrderEntry.isCalculated(SessionContext)for details.- Overrides:
isCalculatedin classAbstractOrderEntry- Parameters:
ctx- can be used for cached access value may be outdated!- Returns:
trueif this entry is calculated
-
setCalculated
Overwritten to provide in-memory implementation. SeeGeneratedAbstractOrderEntry.setCalculated(SessionContext, boolean)for details.- Overrides:
setCalculatedin classGeneratedAbstractOrderEntrycalculated- the calculated
-
isGiveAway
Overwritten to provide in-memory implementation. SeeAbstractOrderEntry.isGiveAway(SessionContext)for details.- Overrides:
isGiveAwayin classAbstractOrderEntry- Parameters:
ctx- can be used for cached access value may be outdated!- Returns:
trueif this entry is calculated
-
setGiveAway
Overwritten to provide in-memory implementation. SeeGeneratedAbstractOrderEntry.setGiveAway(SessionContext, boolean)for details.- Overrides:
setGiveAwayin classGeneratedAbstractOrderEntrygiveaway- the giveAway
-
isRejected
Overwritten to provide in-memory implementation. SeeAbstractOrderEntry.isRejected(SessionContext)for details.- Overrides:
isRejectedin classAbstractOrderEntry- Parameters:
ctx- can be used for cached access value may be outdated!- Returns:
truethe rejected flag
-
setRejected
Overwritten to provide in-memory implementation. SeeGeneratedAbstractOrderEntry.setRejected(SessionContext, boolean)for details.- Overrides:
setRejectedin classGeneratedAbstractOrderEntryrejected- the rejected
-
getEntryNumber
Overwritten to provide in-memory implementation. SeeGeneratedAbstractOrderEntry.getEntryNumber()for details.- Overrides:
getEntryNumberin classGeneratedAbstractOrderEntry- Returns:
- the entryNumber
-
setEntryNumberDirect
protected void setEntryNumberDirect(int nr) Description copied from class:AbstractOrderEntryChanges entry number directly.- Overrides:
setEntryNumberDirectin classAbstractOrderEntry- Parameters:
nr- the new entry number
-
setModificationTime
Overwritten to provide in-memory implementation. SeeItem.setModificationTime(Date)for details.- Overrides:
setModificationTimein classItem
-