com.sap.ip.me.api.persist.core
Interface PersistenceContainer


public interface PersistenceContainer

The PersistenceContainer is the object needed by PersistableEntity. It holds all attribute values and links transiently during runtime. PersistableEntity should only be used as wrapper around the PersistenceContainer.

Author:
SAP AG

Method Summary
 void addMultipleLink(int idx, PersistableEntity link)
          Add a new Link entry to the multiple link at given index of the PersistedObject.
 java.lang.Object getAttribute(int idx)
          Gets the value of the attribute a given index
 java.lang.Object getAttribute(int idx, int mult)
          Gets the value of the attribute a given index
 java.lang.String getClasstype()
          Gets the classtype supported by this PersistenceContainer
 java.lang.String getKey()
          Gets the entityKey attribute of the PersistedObject object
 MeIterator getMultipleLink(int idx)
           
 PersistableEntity getMultipleLink(int idx, int mult)
          Returns the multiple link at the given index.
 PersistableEntity getSingleLink(int idx)
          get the link at index idx as an Entity
 boolean isMultipleLink(int idx)
          return the number of links available for the given index
 void removeAllMultipleLink(int idx)
          clear all links at given index
 void removeMultipleLink(int idx, int mult)
          removes the multiple link at given index Each item in this linkwith an index greater or equal to the specified index is shifted downward to have an index one smaller than the value it had previously.
 void removeSingleLink(int idx)
          Clears the link.
 void setAttribute(int idx, int mult, java.lang.Object object)
          Sets the attribute attribute of the PersistedObject object
 void setAttribute(int idx, java.lang.Object object)
          Sets the attribute attribute of the PersistedObject object
 void setEntity(PersistableEntity entity)
          set the entity belonging to this PersistenceContainer
 void setMultipleLink(int idx, int mult, PersistableEntity link)
          Sets a multiple link entry at the given index of the PersistedObject.
 void setSingleLink(int idx, PersistableEntity link)
          Sets the link attribute of the PersistedObject object
 int sizeAttribute()
          return the number of attributes
 int sizeAttribute(int idx)
          return the size of the multiple link attribute
 int sizeLink()
          return the number of link attributes
 int sizeLink(int idx)
          Returns the size of the multiple link attribute.
 

Method Detail

getClasstype

public java.lang.String getClasstype()
Gets the classtype supported by this PersistenceContainer

Returns:
The classtype value

getKey

public java.lang.String getKey()
Gets the entityKey attribute of the PersistedObject object

Returns:
The entityKey value

setEntity

public void setEntity(PersistableEntity entity)
set the entity belonging to this PersistenceContainer

Parameters:
entity - the PersistableEntity object

getAttribute

public java.lang.Object getAttribute(int idx)
Gets the value of the attribute a given index

Parameters:
idx - The parameter index
Returns:
The attribute value
Throws:
java.lang.IndexOutOfBoundsException - if idx is out of bound
java.lang.IllegalArgumentException - if link at idx is not single

getAttribute

public java.lang.Object getAttribute(int idx,
                                     int mult)
Gets the value of the attribute a given index

Parameters:
idx - The parameter index
mult - the multiple index
Returns:
The attribute value
Throws:
java.lang.IndexOutOfBoundsException - if idx or mult is out of bound
java.lang.IllegalArgumentException - if link at idx is not multiple

setAttribute

public void setAttribute(int idx,
                         java.lang.Object object)
Sets the attribute attribute of the PersistedObject object

Parameters:
object - The new attribute value
idx - The new attribute value
Throws:
PersistenceException - Description of the Exception
java.lang.IndexOutOfBoundsException - if index is out of bound
java.lang.IllegalArgumentException - if link at idx is not single

setAttribute

public void setAttribute(int idx,
                         int mult,
                         java.lang.Object object)
Sets the attribute attribute of the PersistedObject object

Parameters:
idx - The attribute index
mult - The multiple index
object - The new attribute value
Throws:
PersistenceException - Description of the Exception
java.lang.IndexOutOfBoundsException - if idx or mult is out of bound
java.lang.IllegalArgumentException - if link at idx is not multiple

sizeAttribute

public int sizeAttribute()
return the number of attributes

Returns:
the number of attributes

sizeAttribute

public int sizeAttribute(int idx)
return the size of the multiple link attribute

Returns:
the size or 1 if not multiple
Throws:
java.lang.IndexOutOfBoundsException - if idx or mult is out of bound

getSingleLink

public PersistableEntity getSingleLink(int idx)
get the link at index idx as an Entity

Parameters:
idx - the link index
Throws:
java.lang.IndexOutOfBoundsException - is out of bound
java.lang.IllegalArgumentException - if link at idx is not single

setSingleLink

public void setSingleLink(int idx,
                          PersistableEntity link)
Sets the link attribute of the PersistedObject object

Parameters:
idx - the link index
link - The new link value
Throws:
PersistenceException - if link cannot set
java.lang.IndexOutOfBoundsException - is out of bound
java.lang.IllegalArgumentException - if link at idx is not single

removeSingleLink

public void removeSingleLink(int idx)
Clears the link. Silencly ignore if link is not set.

Parameters:
idx - the link index
Throws:
java.lang.IndexOutOfBoundsException - is out of bound
java.lang.IllegalArgumentException - if link at idx is not single

getMultipleLink

public PersistableEntity getMultipleLink(int idx,
                                         int mult)
Returns the multiple link at the given index.

Use carefully, because it triggers lazy loading of all link entries into memory with jdbc persistence!

Parameters:
idx - the link index
mult - the multiple index
Throws:
java.lang.IndexOutOfBoundsException - if idx or mult is out of bound
java.lang.IllegalArgumentException - if link at idx is not multiple

setMultipleLink

public void setMultipleLink(int idx,
                            int mult,
                            PersistableEntity link)
Sets a multiple link entry at the given index of the PersistedObject.

Use carefully, because it triggers lazy loading of all link entries into memory with jdbc persistence!

Parameters:
idx - the link index
mult - the multiple index
link - the new link value
Throws:
PersistenceException - Description of the Exception
java.lang.IndexOutOfBoundsException - if idx or mult is out of bound
java.lang.IllegalArgumentException - if link at idx is not multiple

addMultipleLink

public void addMultipleLink(int idx,
                            PersistableEntity link)
Add a new Link entry to the multiple link at given index of the PersistedObject.

Use carefully, because it triggers lazy loading of all link entries into memory with jdbc persistence!

Parameters:
idx - the link index
link - The new link value
Throws:
PersistenceException - Description of the Exception
java.lang.IndexOutOfBoundsException - if idx or mult is out of bound
java.lang.IllegalArgumentException - if link at idx is not multiple

removeMultipleLink

public void removeMultipleLink(int idx,
                               int mult)
removes the multiple link at given index Each item in this linkwith an index greater or equal to the specified index is shifted downward to have an index one smaller than the value it had previously. The size of this link is decreased by 1. The index must be a value greater than or equal to 0 and less than the current size of the vector.

Parameters:
idx - the link index
mult - the multiple index
Throws:
java.lang.IndexOutOfBoundsException - if idx or mult is out of bound
java.lang.IllegalArgumentException - if link at idx is not multiple

removeAllMultipleLink

public void removeAllMultipleLink(int idx)
clear all links at given index

Parameters:
idx - the link index
Throws:
java.lang.IndexOutOfBoundsException - if idx or mult is out of bound

sizeLink

public int sizeLink()
return the number of link attributes

Returns:
the size or 0 if no link is available

sizeLink

public int sizeLink(int idx)
Returns the size of the multiple link attribute.

Use carefully, because it triggers lazy loading of all link entries into memory with jdbc persistence!

Returns:
the size or 0 if no link is available
Throws:
java.lang.IndexOutOfBoundsException - if idx or mult is out of bound

isMultipleLink

public boolean isMultipleLink(int idx)
return the number of links available for the given index

Parameters:
idx - the link index
Returns:
true if the given index is a mutliple link
Throws:
java.lang.IndexOutOfBoundsException - if idx or mult is out of bound

getMultipleLink

public MeIterator getMultipleLink(int idx)


Copyright © 2005 SAP AG. All Rights Reserved.