Package de.hybris.platform.util
Class OneToManyHandler<T extends Item>
- java.lang.Object
-
- de.hybris.platform.util.OneToManyHandler<T>
-
- Direct Known Subclasses:
BidirectionalOneToManyHandler
public class OneToManyHandler<T extends Item> extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringforeignKeyAttrprotected java.lang.StringhandlerMode
-
Constructor Summary
Constructors Constructor Description OneToManyHandler(java.lang.String targetItemType, boolean partOf, java.lang.String foreignKeyAttr, java.lang.String orderNumberAttr, boolean reorderable, boolean asc)OneToManyHandler(java.lang.String targetItemType, boolean partOf, java.lang.String foreignKeyAttr, java.lang.String orderNumberAttr, boolean reorderable, boolean asc, int typeOfCollection)OneToManyHandler(java.lang.String targetItemType, boolean partOf, java.lang.String foreignKeyAttr, java.lang.String orderNumberAttr, boolean reorderable, boolean asc, int typeOfCollection, java.lang.String conditionQuery)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddValue(SessionContext ctx, Item key, T toLink)java.lang.StringgetConditionQuery()java.lang.StringgetForeignKeyAttr()intgetNextOrderNumber(SessionContext ctx, Item key)java.lang.StringgetOrderNumberAttr()java.util.Collection<T>getValues(SessionContext ctx, Item key)booleanisPartOf()booleanisReOrderable()voidnewInstance(SessionContext ctx, Item.ItemAttributeMap attributes)voidnotifyKeyRemoval(SessionContext ctx, Item key)voidremoveValue(SessionContext ctx, Item key, T linked)SearchResultsearchForLinkedItems(PK pk)protected voidsetForeignKeyValue(SessionContext ctx, Item key, T toLink)sets a foreign key propertyforeignKeyAttrfor source item Tprotected voidsetPosAttributeValue(SessionContext ctx, T toLink, int index)sets a _pos attribute (orderNumberAttr) related forforeignKeyAttrfor source item TvoidsetValues(SessionContext ctx, Item key, java.util.Collection<T> values)protected booleansetValuesInternal(SessionContext ctx, Item key, java.util.Collection<T> values)protected booleanuseLegacyMode()If returns true.OneToManyHandler<T>withRelationQualifier(java.lang.String qualifier)
-
-
-
Constructor Detail
-
OneToManyHandler
public OneToManyHandler(java.lang.String targetItemType, boolean partOf, java.lang.String foreignKeyAttr, java.lang.String orderNumberAttr, boolean reorderable, boolean asc)
-
OneToManyHandler
public OneToManyHandler(java.lang.String targetItemType, boolean partOf, java.lang.String foreignKeyAttr, java.lang.String orderNumberAttr, boolean reorderable, boolean asc, int typeOfCollection)
-
OneToManyHandler
public OneToManyHandler(java.lang.String targetItemType, boolean partOf, java.lang.String foreignKeyAttr, java.lang.String orderNumberAttr, boolean reorderable, boolean asc, int typeOfCollection, java.lang.String conditionQuery)
-
-
Method Detail
-
useLegacyMode
protected boolean useLegacyMode()
If returns true. The regular set attributesetForeignKeyValue(SessionContext, Item, Item)is called, otherwise a positioning logic is used while setting reference, this affects relative position in ordered collections.
-
searchForLinkedItems
public SearchResult searchForLinkedItems(PK pk)
-
getValues
public java.util.Collection<T> getValues(SessionContext ctx, Item key)
-
getNextOrderNumber
public int getNextOrderNumber(SessionContext ctx, Item key)
-
setValuesInternal
protected boolean setValuesInternal(SessionContext ctx, Item key, java.util.Collection<T> values)
-
setValues
public void setValues(SessionContext ctx, Item key, java.util.Collection<T> values)
-
addValue
public void addValue(SessionContext ctx, Item key, T toLink)
-
newInstance
public void newInstance(SessionContext ctx, Item.ItemAttributeMap attributes)
-
setForeignKeyValue
protected void setForeignKeyValue(SessionContext ctx, Item key, T toLink) throws JaloSecurityException, JaloBusinessException
sets a foreign key propertyforeignKeyAttrfor source item T
-
setPosAttributeValue
protected void setPosAttributeValue(SessionContext ctx, T toLink, int index) throws JaloSecurityException, JaloBusinessException
sets a _pos attribute (orderNumberAttr) related forforeignKeyAttrfor source item T
-
removeValue
public void removeValue(SessionContext ctx, Item key, T linked)
-
notifyKeyRemoval
public void notifyKeyRemoval(SessionContext ctx, Item key)
-
getForeignKeyAttr
public java.lang.String getForeignKeyAttr()
-
getOrderNumberAttr
public java.lang.String getOrderNumberAttr()
-
isReOrderable
public boolean isReOrderable()
-
isPartOf
public boolean isPartOf()
-
getConditionQuery
public java.lang.String getConditionQuery()
-
withRelationQualifier
public OneToManyHandler<T> withRelationQualifier(java.lang.String qualifier)
-
-