Class PDTRow
- java.lang.Object
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable
- Direct Known Subclasses:
GeneratedAbstractDiscountRow,GeneratedPriceRow,GeneratedTaxRow
public abstract class PDTRow extends GeneratedPDTRow
Abstract Superclass of our price , tax and discount rule classes PriceRow, TaxRow and DiscountRow. Here the basic matching fields are defined: product, product price group, user and user group.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.GenericItem
GenericItem.GenericItemImpl
-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LocalizableItem.LocalizableItemImpl
-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.ExtensibleItem
ExtensibleItem.ExtensibleItemImpl
-
Nested 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 Modifier and Type Field Description static java.lang.StringALL_PRODUCT_GROUPSField ALL_PRODUCT_GROUPSstatic ProductALL_PRODUCTSField ALL_PRODUCTSstatic java.lang.StringALL_USER_GROUPSField ALL_USER_GROUPSstatic UserALL_USERSField ALL_USERSstatic java.lang.StringDATE_RANGEDeprecated.since agesstatic java.lang.StringDATERANGEDeprecated.since agesstatic java.lang.StringEND_TIMEDeprecated.since agesstatic java.lang.StringSTART_TIMEDeprecated.since ages-
Fields inherited from class de.hybris.platform.europe1.jalo.GeneratedPDTRow
DEFAULT_INITIAL_ATTRIBUTES, ENDTIME, PG, PRODUCT, PRODUCTID, PRODUCTMATCHQUALIFIER, STARTTIME, UG, USER, USERMATCHQUALIFIER
-
Fields inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LANGUAGE_FALLBACK_ENABLED
-
Fields 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, TYPE
-
Fields inherited from class de.hybris.platform.util.BridgeAbstraction
impl, tenant
-
-
Constructor Summary
Constructors Constructor Description PDTRow()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected ItemcreateItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes)Has to be implemented for each concrete subtype of item.CustomergetCustomer()Deprecated.since ages - please use getUser() instead.CustomergetCustomer(SessionContext ctx)Deprecated.since ages - please use getUser(SessionContext) instead.EnumerationValuegetCustomerGroup()Deprecated.since ages - please use getUserGroup instead.EnumerationValuegetCustomerGroup(SessionContext ctx)Deprecated.since ages - please use getUserGroup instead.EnumerationValuegetCustomerPriceGroup()Deprecated.since ages - please use getCustomerGroup() insteadEnumerationValuegetCustomerPriceGroup(SessionContext ctx)Deprecated.since ages - please use getUserGroup( SessionContext ctx) insteadStandardDateRangegetDateRange()StandardDateRangegetDateRange(SessionContext ctx)The range of time which this row is valid within.protected java.lang.LonggetInitialProductMatchField(Item.ItemAttributeMap allAttributes)protected java.lang.LonggetInitialUserMatchField(Item.ItemAttributeMap allAttributes)EnumerationValuegetProductGroup()Specified the product price group this rule is assigned to.EnumerationValuegetProductGroup(SessionContext ctx)EnumerationValuegetProductPriceGroup()Deprecated.since ages - please use getProductGroup() insteadEnumerationValuegetProductPriceGroup(SessionContext ctx)Deprecated.since ages - please use getProductGroup( SessionContext ctx ) insteadEnumerationValuegetUserGroup()The user group which this rule is assigned to.EnumerationValuegetUserGroup(SessionContext ctx)SeegetUserGroup().protected voidmarkProductModified()Marks the product which this row (might) belong to modified.voidremove(SessionContext ctx)Removes this item.protected voidremoveLinks()Superclass method overridden to skip searching for links during removal of a PDTRow.voidsetDateRange(SessionContext ctx, StandardDateRange dateRange)Method setDateRangevoidsetDateRange(StandardDateRange dateRange)protected voidsetPg(SessionContext ctx, EnumerationValue value)Whenever a non-null PG is set the product attribute is cleared.protected voidsetProduct(SessionContext ctx, Product value)Whenever a non-null product is set the PG attribute is cleared.voidsetProductId(SessionContext ctx, java.lang.String value)Generated method - Setter of thePDTRow.productIdattribute.voidsetProductMatchQualifier(SessionContext ctx, java.lang.Long value)Overwritten to disallow changing this calculated field from outside this classjava.lang.ObjectsetProperty(SessionContext ctx, java.lang.String name, java.lang.Object value)Overwritten to mark owning product as modified each time a property of this row has been changed.voidsetUg(SessionContext ctx, EnumerationValue value)Whenever a non-null UG is set the user attribute is cleared.voidsetUser(SessionContext ctx, User value)Whenever a non-null user is set the UG attribute is cleared.voidsetUserMatchQualifier(SessionContext ctx, java.lang.Long value)Overwritten to disallow changing this calculated field from outside this classprotected voidupdateProductMatchField()protected voidupdateUserMatchField()-
Methods inherited from class de.hybris.platform.europe1.jalo.GeneratedPDTRow
getDefaultAttributeModes, getEndTime, getEndTime, getPg, getPg, getProduct, getProduct, getProductId, getProductId, getProductMatchQualifier, getProductMatchQualifier, getProductMatchQualifierAsPrimitive, getProductMatchQualifierAsPrimitive, getStartTime, getStartTime, getUg, getUg, getUser, getUser, getUserMatchQualifier, getUserMatchQualifier, getUserMatchQualifierAsPrimitive, getUserMatchQualifierAsPrimitive, setEndTime, setEndTime, setPg, setProduct, setProductId, setProductMatchQualifier, setProductMatchQualifier, setProductMatchQualifier, setStartTime, setStartTime, setUg, setUser, setUserMatchQualifier, setUserMatchQualifier, setUserMatchQualifier
-
Methods inherited from class de.hybris.platform.jalo.GenericItem
getImplementation, getInitialProperties, getNonInitialAttributes, getRelatedItems, setRelatedItems
-
Methods 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, setLocalizedProperty
-
Methods inherited from class de.hybris.platform.jalo.ExtensibleItem
createNonClassAccessor, getAllProperties, getAllProperties, getProperty, getProperty, getPropertyNames, getPropertyNames, removeProperty, removeProperty, setAllProperties, setAllProperties, setProperty
-
Methods 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, compareTo, 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, 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, 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, setModificationTime, setNonInitialAttributes, setOwner, setPermissionsByMap, setTransientObject, setUseTA, toString, useTA, writeReplace
-
Methods inherited from class de.hybris.platform.util.BridgeAbstraction
setTenant
-
-
-
-
Field Detail
-
DATERANGE
@Deprecated public static final java.lang.String DATERANGE
Deprecated.since ages- See Also:
- Constant Field Values
-
DATE_RANGE
@Deprecated public static final java.lang.String DATE_RANGE
Deprecated.since ages- See Also:
- Constant Field Values
-
START_TIME
@Deprecated public static final java.lang.String START_TIME
Deprecated.since ages- See Also:
- Constant Field Values
-
END_TIME
@Deprecated public static final java.lang.String END_TIME
Deprecated.since ages- See Also:
- Constant Field Values
-
ALL_PRODUCTS
public static final Product ALL_PRODUCTS
Field ALL_PRODUCTS
-
ALL_PRODUCT_GROUPS
public static final java.lang.String ALL_PRODUCT_GROUPS
Field ALL_PRODUCT_GROUPS
-
ALL_USERS
public static final User ALL_USERS
Field ALL_USERS
-
ALL_USER_GROUPS
public static final java.lang.String ALL_USER_GROUPS
Field ALL_USER_GROUPS
-
-
Method Detail
-
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 classGenericItem- 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
-
setProductMatchQualifier
public void setProductMatchQualifier(SessionContext ctx, java.lang.Long value)
Overwritten to disallow changing this calculated field from outside this class- Overrides:
setProductMatchQualifierin classGeneratedPDTRowvalue- the productMatchQualifier
-
setUserMatchQualifier
public void setUserMatchQualifier(SessionContext ctx, java.lang.Long value)
Overwritten to disallow changing this calculated field from outside this class- Overrides:
setUserMatchQualifierin classGeneratedPDTRowvalue- the userMatchQualifier
-
getInitialProductMatchField
protected java.lang.Long getInitialProductMatchField(Item.ItemAttributeMap allAttributes)
-
getInitialUserMatchField
protected java.lang.Long getInitialUserMatchField(Item.ItemAttributeMap allAttributes)
-
updateProductMatchField
protected void updateProductMatchField()
-
updateUserMatchField
protected void updateUserMatchField()
-
setProduct
protected void setProduct(SessionContext ctx, Product value)
Whenever a non-null product is set the PG attribute is cleared.- Overrides:
setProductin classGeneratedPDTRowvalue- the product
-
setProductId
public void setProductId(SessionContext ctx, java.lang.String value)
Description copied from class:GeneratedPDTRowGenerated method - Setter of thePDTRow.productIdattribute.- Overrides:
setProductIdin classGeneratedPDTRowvalue- the productId
-
setUser
public void setUser(SessionContext ctx, User value)
Whenever a non-null user is set the UG attribute is cleared.- Overrides:
setUserin classGeneratedPDTRowvalue- the user
-
setPg
protected void setPg(SessionContext ctx, EnumerationValue value)
Whenever a non-null PG is set the product attribute is cleared.- Overrides:
setPgin classGeneratedPDTRowvalue- the pg
-
setUg
public void setUg(SessionContext ctx, EnumerationValue value)
Whenever a non-null UG is set the user attribute is cleared.- Overrides:
setUgin classGeneratedPDTRowvalue- the ug
-
removeLinks
protected void removeLinks()
Superclass method overridden to skip searching for links during removal of a PDTRow. PDTRows are not linked!- Overrides:
removeLinksin classItem
-
getProductPriceGroup
@Deprecated public EnumerationValue getProductPriceGroup()
Deprecated.since ages - please use getProductGroup() insteadSpecified the product price group this rule is assigned to. This field is only of interest if no product was specified.Please note that by now product price groups are not managed by the hybris Platform, and therefore are only Strings.nullis a valid value and means that all groups are matched, while an empty String will result in an invisible PriceRow as it is only matching the "empty String" product price group.
-
getProductGroup
public EnumerationValue getProductGroup()
Specified the product price group this rule is assigned to. This field is only of interest if no product was specified.Please note that by now product price groups are not managed by the hybris Platform, and therefore are only Strings.nullis a valid value and means that all groups are matched, while an empty String will result in an invisible PriceRow as it is only matching the "empty String" product price group.
-
getProductPriceGroup
@Deprecated public EnumerationValue getProductPriceGroup(SessionContext ctx)
Deprecated.since ages - please use getProductGroup( SessionContext ctx ) instead- Parameters:
ctx-
-
getProductGroup
public EnumerationValue getProductGroup(SessionContext ctx)
- Parameters:
ctx-
-
getCustomer
@Deprecated public Customer getCustomer()
Deprecated.since ages - please use getUser() instead.The customer this rule is assigned to. Ifnullis set all customers are meant. If one is specified the customer price group field is not evaluated.
-
getCustomer
@Deprecated public Customer getCustomer(SessionContext ctx)
Deprecated.since ages - please use getUser(SessionContext) instead.SeegetCustomer().- Parameters:
ctx-
-
getCustomerPriceGroup
@Deprecated public EnumerationValue getCustomerPriceGroup()
Deprecated.since ages - please use getCustomerGroup() insteadThe customer price group which this rule is assigned to. This applies only if no customer is specified. Please note that by now customer price groups are not managed by the hybris Platform, and therefore are only Strings.nullis a valid value and means that all groups are matched.
-
getCustomerGroup
@Deprecated public EnumerationValue getCustomerGroup()
Deprecated.since ages - please use getUserGroup instead.The customer price group which this rule is assigned to. This applies only if no customer is specified. Please note that by now customer price groups are not managed by the hybris Platform, and therefore are only Strings.nullis a valid value and means that all groups are matched.
-
getUserGroup
public EnumerationValue getUserGroup()
The user group which this rule is assigned to. This applies only if no user is specified. Please note that by now user groups are not managed by the hybris Platform, and therefore are only Strings.nullis a valid value and means that all groups are matched.
-
getCustomerPriceGroup
@Deprecated public EnumerationValue getCustomerPriceGroup(SessionContext ctx)
Deprecated.since ages - please use getUserGroup( SessionContext ctx) instead- Parameters:
ctx-
-
getCustomerGroup
@Deprecated public EnumerationValue getCustomerGroup(SessionContext ctx)
Deprecated.since ages - please use getUserGroup instead.SeegetCustomerGroup().- Parameters:
ctx-
-
getUserGroup
public EnumerationValue getUserGroup(SessionContext ctx)
SeegetUserGroup().- Parameters:
ctx-
-
getDateRange
public StandardDateRange getDateRange()
-
getDateRange
public StandardDateRange getDateRange(SessionContext ctx)
The range of time which this row is valid within. If null the row is always valid.
-
setDateRange
public void setDateRange(StandardDateRange dateRange)
-
setDateRange
public void setDateRange(SessionContext ctx, StandardDateRange dateRange)
Method setDateRange- Parameters:
ctx-dateRange-
-
remove
public void remove(SessionContext ctx) throws ConsistencyCheckException
Description copied from class:ItemRemoves this item.This method is using the following attributes of the given SessionContext:
CacheUsage Language StagingMethod n/a (this is a setter method) no, language doesn't matter for removal yes if called on a StageableItem, no otherwise
- Overrides:
removein classItem- Parameters:
ctx- A SessionContext object- Throws:
ConsistencyCheckException- if this item could not be removed for some reason
-
setProperty
public java.lang.Object setProperty(SessionContext ctx, java.lang.String name, java.lang.Object value)
Overwritten to mark owning product as modified each time a property of this row has been changed.- Overrides:
setPropertyin classExtensibleItem- Parameters:
ctx- A SessionContext objectname- the name (key) of the propertyvalue- the value- Returns:
- the property that was bound to the name or
nullif there was no property.
-
markProductModified
protected void markProductModified()
Marks the product which this row (might) belong to modified. This method is called upon all modifications done to a PDTRow to allow proper product modification status.
This functionality can be enabled / disabled using two config settings. First you can enabled / disable it using the session attribute
Europe1Constants.PDTROW_MARK_PRODUCT_MODIFIEDto true / false. If this session attribute is set to true, the product will be marked as modified independent of the other config setting. If set to false, the config property pdtrow.mark.product.modified configured in your local.properties will be evaluated, if set to true, the product will be marked modified, if set to false the mark as modified will be skipped.By default this feature is disabled (no session attribute set (-> false) and the default value in project.properties is set to false.
-
-