Package de.hybris.platform.persistence
Class ItemEJB
java.lang.Object
de.hybris.platform.persistence.ItemEJB
- All Implemented Interfaces:
EntityInstance,EntityProxy,HomeProxy,ItemHome,ItemPermissionFacade,ItemRemote
- Direct Known Subclasses:
ExtensibleItemEJB
public abstract class ItemEJB
extends Object
implements EntityInstance, ItemRemote, ItemHome, ItemPermissionFacade
ItemEJB is responsible for holding a primary key generating a new primary key having a typecode
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected EntityInstanceContextentity context accessible for subclasses if this is an entitybeanprotected static final booleanprotected static final boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcheckItemPermission(PK principalPK, PK permissionPK) The return value for checkPermission(...) if no permission was set, or positive and negative settings were found.intcheckOwnGlobalPermission(PK permissionPK) protected voidprotected final voidcopyComposedTypeFromTemplate(ItemRemote template) protected voidcreateFromTemplate(ItemRemote template) sets data from template item.protected PKdoCreateInternal(PK pk, ComposedTypeRemote type, ItemRemote template) is responsible for assigning Item with a unique primary key and a given type.protected voiddoPostCreateInternal(PK pkBase, ComposedTypeRemote type, ItemRemote template) home method implhome method implvoidejbHomeLoadItemData(ResultSet resultSet) voidejbLoad()voidvoidejbStore()abstract longprotected Objectprotected Objectthe returned cached value may be unmodifiableprotected Objectwill return the cached value if it has already been computed, or null otherwiseprotected final Collection<Object>getCachedValuesStartingWith(String qualifierPrefix) protected final ItemCacheKeygetCacheKey(Object quali) protected abstract Map<Object,ItemCacheKey> abstract Dateprotected ComposedTypeRemotegetGlobalPermissionPKs(boolean negative) abstract longprotected abstract Stringinstance method implabstract Dateprotected final ItemCacheKeygetOwner()abstract PKabstract Stringinstance method implgetPermissionPKs(PK principalPK, boolean negative) getPK()abstract PKgetPrincipalToBooleanListMap(List<PK> rightPKs) finds all restricted principals for a given list of user rights.abstract PKbooleanhasJNDIName(String jndiName) protected booleanUsed by HJMP to optimize calls toejbStore().abstract booleanSpecial method indicating that the entity instance is currently within its ejbCreate() state and has not been written to database yet.voidloadItemData(ResultSet resultSet) still experimental - dont useprotected voidlogACLCacheChange(ACLCache aclChache) booleanprotected voidpostCreateFromTemplate(ItemRemote template) sets (postcreate - )data from template item.static StringDoubles each occurence of a single quotation mark (').voidremove()protected voidcalled by HJMP only !!!booleanremoveGlobalPermission(PK permissionPK) booleanremoveGlobalPermissions(Collection<PermissionContainer> permissions) booleanremovePermission(PK principalPK, PK permissionPK) booleanremovePermissions(Collection<PermissionContainer> permissions) abstract voidsetACLTimestampInternal(long timestamp) voidvoidsetCreationTime(Date date) abstract voidvoidStores entityContext inentityContext.booleansetGlobalPermission(PK permissionPK, boolean negative) booleansetGlobalPermissions(Collection<PermissionContainer> permissions) voidsetModifiedTime(Date timestamp) protected voidsetModifiedTimestamp(Date timestamp) abstract voidvoidsetNeedsStoring(boolean needsStoring) voidsetOwner(ItemRemote owner) abstract voidsetOwnerPkString(PK pk) voidsetOwnerRef(ItemPropertyValue ownerRef) booleansetPermission(PK principalPK, PK permissionPK, boolean negative) booleansetPermissions(Collection<PermissionContainer> permissions) abstract voidsetPkString(PK pk) voidchanges restricted principals for a given list of user rights.abstract voidsetTypePkString(PK pk) protected booleanskipRemovePermission(ACLCache acl, PK principalPK, PK permissionPK) protected booleanskipSetPermission(ACLCache acl, PK principalPK, PK permissionPK, boolean negative) protected voidoverride if you use own ItemCacheKeys which may contain changed data.protected voidtypeChanged(PK oldTypePK, PK newTypePK) protected abstract inttypeCode()booleanwasModifiedSince(Date time) protected booleancalled by HJMP only !!!Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.hybris.platform.persistence.framework.EntityInstance
ejbFindByPrimaryKeyMethods inherited from interface de.hybris.platform.persistence.ItemHome
findAll, findByPKList, findByType, findChangedAfter
-
Field Details
-
READ
protected static final boolean READ- See Also:
-
WRITE
protected static final boolean WRITE- See Also:
-
entityContext
entity context accessible for subclasses if this is an entitybean
-
-
Constructor Details
-
ItemEJB
public ItemEJB()
-
-
Method Details
-
getPkString
- Specified by:
getPkStringin interfaceItemRemote
-
setPkString
-
getCreationTimestampInternal
-
setCreationTimestampInternal
-
getACLTimestampInternal
public abstract long getACLTimestampInternal() -
setACLTimestampInternal
public abstract void setACLTimestampInternal(long timestamp) -
getModifiedTimestampInternal
-
setModifiedTimestampInternal
-
getTypePkString
-
setTypePkString
-
getOwnerPkString
-
setOwnerPkString
-
getHJMPTS
public abstract long getHJMPTS()- Specified by:
getHJMPTSin interfaceItemRemote
-
isBeforeCreate
public abstract boolean isBeforeCreate()Special method indicating that the entity instance is currently within its ejbCreate() state and has not been written to database yet. -
getPK
- Specified by:
getPKin interfaceEntityProxy
-
getTypeKey
- Specified by:
getTypeKeyin interfaceItemRemote
-
quoteSQLStringLiteralForQuery
Doubles each occurence of a single quotation mark (').- Parameters:
str-- Returns:
- String
-
ejbHomeLoadItemData
-
typeCode
protected abstract int typeCode()- Returns:
- a unique typecode for this item type. Used for wrapping entity beans to the jalo layer.
-
doCreateInternal
is responsible for assigning Item with a unique primary key and a given type. -
createFromTemplate
sets data from template item. override in all subclasses which define new fields! -
copyComposedTypeFromTemplate
-
postCreateFromTemplate
sets (postcreate - )data from template item. override in all subclasses which define new fields! -
doPostCreateInternal
-
removeACLEntries
protected void removeACLEntries()called by HJMP only !!! -
writeACLEntries
protected boolean writeACLEntries()called by HJMP only !!! -
setEntityContext
Stores entityContext inentityContext. Do not call method yourself!- Specified by:
setEntityContextin interfaceEntityInstance
-
getEntityContext
- Specified by:
getEntityContextin interfaceEntityInstance
-
ejbStore
public void ejbStore()- Specified by:
ejbStorein interfaceEntityInstance
-
ejbLoad
public void ejbLoad()- Specified by:
ejbLoadin interfaceEntityInstance
-
hasModifiedCaches
protected boolean hasModifiedCaches()Used by HJMP to optimize calls toejbStore(). Dont use elsewhere!This method just checks if a ACL cache is present and needs storing.
- Returns:
- true if this item instance owns modified caches which need to be stored
-
ejbRemove
public void ejbRemove()- Specified by:
ejbRemovein interfaceEntityInstance
-
clearEntityCaches
protected void clearEntityCaches() -
getCreationTime
- Specified by:
getCreationTimein interfaceItemRemote
-
setCreationTime
- Specified by:
setCreationTimein interfaceItemRemote
-
getModifiedTime
- Specified by:
getModifiedTimein interfaceItemRemote
-
setModifiedTime
- Specified by:
setModifiedTimein interfaceItemRemote
-
setModifiedTimestamp
-
wasModifiedSince
- Specified by:
wasModifiedSincein interfaceItemRemote
-
getComposedType
- Specified by:
getComposedTypein interfaceItemRemote
-
setComposedType
- Specified by:
setComposedTypein interfaceItemRemote- Throws:
EJBInvalidParameterException
-
typeChanged
-
getDefaultType
- Throws:
EJBItemNotFoundException
-
getOwner
- Specified by:
getOwnerin interfaceItemRemote
-
setOwner
- Specified by:
setOwnerin interfaceItemRemote
-
setOwnerRef
- Specified by:
setOwnerRefin interfaceItemRemote
-
storeCaches
protected void storeCaches()override if you use own ItemCacheKeys which may contain changed data. Please not that at this time you MUST NOT write any CMP field since item data might already be stored! dont forget to call super.storeCaches() so that superclass caches are stored correctly. -
getCacheKeyMap
-
getCachedValueForReading
the returned cached value may be unmodifiable -
getCachedValueForModification
-
getCachedValueForReadingIfAvailable
will return the cached value if it has already been computed, or null otherwise -
getCachedValuesStartingWith
-
getCacheKey
-
getOrAddCacheKey
-
getRestrictedPrincipalPKs
- Specified by:
getRestrictedPrincipalPKsin interfaceItemPermissionFacade
-
getPrincipalToBooleanListMap
Description copied from interface:ItemPermissionFacadefinds all restricted principals for a given list of user rights. further each principal is mapped to a row caontaining its setting regarding the user right at this position- Specified by:
getPrincipalToBooleanListMapin interfaceItemPermissionFacade- Parameters:
rightPKs- the user right pks to get principals and permissions for- Returns:
- a map { principalPK -> [ Boolean.TRUE == negative | Boolean.FALSE == positive | null == not set]
-
setPrincipalToBooleanListMap
public void setPrincipalToBooleanListMap(List<PK> rightPKs, Map<PK, List<Boolean>> principalPKToBooleanListMap) throws EJBSecurityExceptionDescription copied from interface:ItemPermissionFacadechanges restricted principals for a given list of user rights.- Specified by:
setPrincipalToBooleanListMapin interfaceItemPermissionFacade- Parameters:
rightPKs- the user right pks to get principals and permissions forprincipalPKToBooleanListMap- a map { principalPK -> [ Boolean.TRUE | Boolean.FALSE | null ]- Throws:
EJBSecurityException
-
skipSetPermission
-
setPermission
public boolean setPermission(PK principalPK, PK permissionPK, boolean negative) throws EJBSecurityException - Specified by:
setPermissionin interfaceItemPermissionFacade- Throws:
EJBSecurityException
-
setPermissions
public boolean setPermissions(Collection<PermissionContainer> permissions) throws EJBSecurityException - Specified by:
setPermissionsin interfaceItemPermissionFacade- Throws:
EJBSecurityException
-
skipRemovePermission
-
removePermission
- Specified by:
removePermissionin interfaceItemPermissionFacade- Throws:
EJBSecurityException
-
removePermissions
public boolean removePermissions(Collection<PermissionContainer> permissions) throws EJBSecurityException - Specified by:
removePermissionsin interfaceItemPermissionFacade- Throws:
EJBSecurityException
-
checkItemPermission
The return value for checkPermission(...) if no permission was set, or positive and negative settings were found.- Specified by:
checkItemPermissionin interfaceItemPermissionFacade
-
getPermissionPKs
- Specified by:
getPermissionPKsin interfaceItemPermissionFacade
-
logACLCacheChange
-
ejbHomeGetItemTableName
home method impl -
getItemTableNameImpl
instance method impl -
ejbHomeGetOwnJNDIName
home method impl -
hasJNDIName
- Specified by:
hasJNDINamein interfaceItemRemote
-
getOwnJNDIName
instance method impl- Specified by:
getOwnJNDINamein interfaceItemHome- Returns:
- the item's JNDI name
-
needsStoring
public boolean needsStoring()- Specified by:
needsStoringin interfaceEntityInstance
-
setNeedsStoring
public void setNeedsStoring(boolean needsStoring) - Specified by:
setNeedsStoringin interfaceEntityInstance
-
remove
- Specified by:
removein interfaceItemRemote- Throws:
YEJBExceptionYRemoveException
-
loadItemData
Description copied from interface:ItemHomestill experimental - dont use- Specified by:
loadItemDatain interfaceItemHome
-
checkOwnGlobalPermission
- Specified by:
checkOwnGlobalPermissionin interfaceItemPermissionFacade
-
getGlobalPermissionPKs
- Specified by:
getGlobalPermissionPKsin interfaceItemPermissionFacade
-
setGlobalPermission
- Specified by:
setGlobalPermissionin interfaceItemPermissionFacade- Throws:
EJBSecurityException
-
setGlobalPermissions
public boolean setGlobalPermissions(Collection<PermissionContainer> permissions) throws EJBSecurityException - Specified by:
setGlobalPermissionsin interfaceItemPermissionFacade- Throws:
EJBSecurityException
-
removeGlobalPermission
- Specified by:
removeGlobalPermissionin interfaceItemPermissionFacade- Throws:
EJBSecurityException
-
removeGlobalPermissions
public boolean removeGlobalPermissions(Collection<PermissionContainer> permissions) throws EJBSecurityException - Specified by:
removeGlobalPermissionsin interfaceItemPermissionFacade- Throws:
EJBSecurityException
-