public class PromotionPolicyJDBCPersistenceManager extends com.ibm.commerce.marketing.promotion.persistence.JDBCPersistenceManager implements PromotionPolicyPersistenceManager
XML Snippet for PromotionPolicyJDBCPersistenceManager:
<PromotionPolicyJDBCPersistenceManager impl="com.ibm.commerce.marketing.promotion.policy.PromotionPolicyJDBCPersistenceManager">
<InitialCacheSize>64</InitialCacheSize>
<MaxCacheSize>1024</MaxCacheSize>
</PromotionPolicyJDBCPersistenceManager>
| Constructor and Description |
|---|
PromotionPolicyJDBCPersistenceManager()
Default Constructor for PromotionPolicyJDBCPersistenceManager.
|
PromotionPolicyJDBCPersistenceManager(java.sql.Connection con)
Constructor for PromotionPolicyJDBCPersistenceManager.
|
| Modifier and Type | Method and Description |
|---|---|
void |
create(PromotionPolicy policy)
Create a new promotion policy.
|
PromotionPolicyKey[] |
findGlobalPolicyKeysByStore(StoreKey key)
Finds all global promotion policies within a store
|
PromotionPolicyKey[] |
findPolicyKeysByGroupAndStatus(com.ibm.commerce.marketing.promotion.group.PromotionGroupKey gkey,
int status)
Finds promotion policies based on the group with which they are associated and their status
|
void |
fromXML(org.w3c.dom.Node anXMLNode)
Transforms an XML node into a real Object.
|
int |
getCacheInitialSize()
Gets initial cache size
|
int |
getCacheMaxSize()
Gets maximum cache size
|
void |
initCache()
Initials the cache.
|
PromotionPolicy |
load(PromotionPolicyKey key)
Finds promotion policy by promotion policy key.
|
java.lang.Number |
lookup(Key key)
Find policy by key.
|
java.lang.Number |
nextNumericKey()
Returns the next primary key value
|
void |
reload(PromotionPolicyKey key)
Invalidates the cache for one promotion policy.
|
void |
reloadAll()
Invalidates all policies currently in the cache.
|
void |
remove(PromotionPolicy policy)
This removing is referring to marked for deletion.
|
Key |
reverseLookup(java.lang.Number keyValue)
Find promotion policy by numeric key.
|
void |
save(PromotionPolicy policy)
Save promotion policy.
|
void |
setCacheInitialSize(int i)
Sets initial cache size
|
void |
setCacheMaxSize(int i)
Sets maximum cache size
|
java.lang.String |
toXML()
Converts any object into an XML format representation.
|
public PromotionPolicyJDBCPersistenceManager(java.sql.Connection con)
con - database connectionpublic PromotionPolicyJDBCPersistenceManager()
public void reload(PromotionPolicyKey key)
reload in interface PromotionPolicyPersistenceManagerkey - to the promotion policyPromotionPolicyPersistenceManager.reload(PromotionPolicyKey)public void reloadAll()
reloadAll in interface PromotionPolicyPersistenceManagerPromotionPolicyPersistenceManager.reloadAll()public PromotionPolicy load(PromotionPolicyKey key) throws PersistenceObjectNotFoundException, PersistenceObjectReadException
load in interface PromotionPolicyPersistenceManagerPromotionPolicyKey - keyPersistenceObjectNotFoundException - when the object identified by the key is not foundPersistenceObjectReadException - when fails to load this objectPromotionPolicyPersistenceManager.load(PromotionPolicyKey)public void create(PromotionPolicy policy) throws PersistenceObjectAlreadyExistsException, PersistenceCreateException
create in interface PromotionPolicyPersistenceManagerPromotionPolicy - policy The promotion policy to create in the database.PersistenceObjectAlreadyException - when the object to create as identified by the key already existsPersistenceCreateException - when fails to create this objectPersistenceObjectAlreadyExistsException - when the object to create as identified by the key already existsPromotionPolicyPersistenceManager.create(PromotionPolicy)public void remove(PromotionPolicy policy) throws PersistenceObjectNotFoundException, PersistenceRemoveException
remove in interface PromotionPolicyPersistenceManagerPromotionPolicy - proPersistenceObjectNotFoundException - when the object identified by the key is not foundPersistenceRemoveException - when fails to remove this objectcom.ibm.commerce.marketing.promotion.policy.PromotionPolicyPersistenceManager#delete(PromotionPolicy)public void save(PromotionPolicy policy) throws PersistenceObjectNotFoundException, PersistenceObjectWriteException
save in interface PromotionPolicyPersistenceManagerPromotionPolicy - policyPersistenceObjectNotFoundException - when the object identified by the key is not foundPersistenceObjectWriteException - when fails to write to this objectPromotionPolicyPersistenceManager.save(PromotionPolicy)public java.lang.Number lookup(Key key)
lookup in interface KeyResolverkey - is the Key for lookup.KeyResolver.lookup(Key)public Key reverseLookup(java.lang.Number keyValue)
reverseLookup in interface KeyResolverkeyValue - is a number representing the key.KeyResolver.reverseLookup(Number)public java.lang.Number nextNumericKey()
nextNumericKey in interface PromotionPolicyPersistenceManagerpublic PromotionPolicyKey[] findGlobalPolicyKeysByStore(StoreKey key)
findGlobalPolicyKeysByStore in interface PromotionPolicyPersistenceManagerkey - identifies the storePromotionPolicyPersistenceManager.findGlobalPolicyKeysByStore(StoreKey)public PromotionPolicyKey[] findPolicyKeysByGroupAndStatus(com.ibm.commerce.marketing.promotion.group.PromotionGroupKey gkey, int status)
findPolicyKeysByGroupAndStatus in interface PromotionPolicyPersistenceManagergkey - the key of the group with which the policies are associated.status - the status of the policiesPromotionPolicyPersistenceManager.findPolicyKeysByGroupAndStatus(PromotionGroupKey,
int)public java.lang.String toXML()
throws XMLizationException
toXML in interface XMLizableXMLizationException - when this process failsXMLizable.toXML()public void fromXML(org.w3c.dom.Node anXMLNode)
throws DeXMLizationException
fromXML in interface XMLizableanXMLNode - The node that represents an XMLizable objectDeXMLizationException - when this process failsXMLizable.fromXML(Node)public void setCacheInitialSize(int i)
i - the initial cache sizepublic void setCacheMaxSize(int i)
i - the maximum cache sizepublic int getCacheInitialSize()
public int getCacheMaxSize()
public void initCache()