com.stratelia.webactiv.util
Class WAPrimaryKey

java.lang.Object
  extended by com.stratelia.webactiv.util.WAPrimaryKey
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
AnswerPK, AttachmentPK, AxisPK, CommentPK, CommentPK, ContactPK, CoordinatePK, DocumentPK, DocumentVersionPK, ForeignPK, IdPK, InfoPK, NodeI18NPK, NodePK, PublicationPK, QuestionContainerPK, QuestionPK, QuestionResultPK, ScorePK, SimpleDocumentPK, TagCloudPK, TreeNodePK, UsedAxisPK, ValuePK

public abstract class WAPrimaryKey
extends Object
implements Serializable, Cloneable

The webactiv primary key for a entity bean defines :

Version:
1.0
Author:
Nicolas Eysseric
See Also:
Serialized Form

Field Summary
 String componentName
          The component name in the space
 String id
          The row id in the table defined by getTableName()
 String space
          The space where is implemented the entity
 
Constructor Summary
WAPrimaryKey(String id)
          Constructor which set only the id
WAPrimaryKey(String id, String componentId)
           
WAPrimaryKey(String id, String space, String componentName)
          Constructor which set id, space and component name
WAPrimaryKey(String id, WAPrimaryKey pk)
          Constructor which set the id The WAPrimaryKey provides space and component name
 
Method Summary
 WAPrimaryKey clone()
           
abstract  boolean equals(Object obj)
          This method must be specialized - Check if an another object is equal to this object
 String getComponentName()
          Get the component name of this object
 String getId()
          Get the row id of this object
 String getInstanceId()
           
 String getRootTableName()
          Return the object root table name
 String getSpace()
          Get the space of this object
 String getSpaceId()
           
 String getTableName()
          Get the database table name where the object is stored
 String getTableName(String space, String componentName)
          Get the database table name where the object is stored
 int hashCode()
          Returns a hash code for the key
 void setComponentName(String componentName)
          Set the component name of this object
 void setId(String val)
          Set the row id of this object
 void setSpace(String space)
          Set the space of this object
 String toString()
          Converts the contents of the key into a readable String.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

id

public String id
The row id in the table defined by getTableName()

Since:
1.0
See Also:
getTableName()

space

public String space
The space where is implemented the entity

Since:
1.0

componentName

public String componentName
The component name in the space

Since:
1.0
Constructor Detail

WAPrimaryKey

public WAPrimaryKey(String id)
Constructor which set only the id

Since:
1.0
See Also:
id

WAPrimaryKey

public WAPrimaryKey(String id,
                    String space,
                    String componentName)
Constructor which set id, space and component name

Since:
1.0
See Also:
id, space, componentName

WAPrimaryKey

public WAPrimaryKey(String id,
                    String componentId)

WAPrimaryKey

public WAPrimaryKey(String id,
                    WAPrimaryKey pk)
Constructor which set the id The WAPrimaryKey provides space and component name

Since:
1.0
Method Detail

equals

public abstract boolean equals(Object obj)
This method must be specialized - Check if an another object is equal to this object

Overrides:
equals in class Object
Parameters:
obj - the object to compare to this WAPrimaryKey
Returns:
true if obj is equals to this object
Since:
1.0

getRootTableName

public String getRootTableName()
Return the object root table name

Returns:
the root table name of the object (exemple : Publication, Node, ...)
Since:
1.0

getId

public String getId()
Get the row id of this object

Returns:
the id
Since:
1.0
See Also:
id

setId

public void setId(String val)
Set the row id of this object

Parameters:
val - the row id
Since:
1.0
See Also:
id

getSpace

public String getSpace()
Get the space of this object

Returns:
the space
Since:
1.0
See Also:
space

setSpace

public void setSpace(String space)
Set the space of this object

Parameters:
space - the space
Since:
1.0
See Also:
space

getComponentName

public String getComponentName()
Get the component name of this object

Returns:
the component name
Since:
1.0
See Also:
componentName

setComponentName

public void setComponentName(String componentName)
Set the component name of this object

Parameters:
componentName - the component name
Since:
1.0
See Also:
componentName

getTableName

public String getTableName()
Get the database table name where the object is stored

Returns:
the database table name where the object is stored : space + componentName + rootTableName (ex : ED1KmeliaPublication)
Since:
1.0
See Also:
space, componentName, getRootTableName()

getTableName

public String getTableName(String space,
                           String componentName)
Get the database table name where the object is stored

Parameters:
space - a space name
componentName - a component name
Returns:
the database table name where the object is stored : space + componentName + rootTableName (ex : ED1KmeliaPublication)
Since:
1.0

toString

public String toString()
Converts the contents of the key into a readable String.

Overrides:
toString in class Object
Returns:
The string representation of this object

hashCode

public int hashCode()
Returns a hash code for the key

Overrides:
hashCode in class Object
Returns:
A hash code for this object

getSpaceId

public String getSpaceId()

getInstanceId

public String getInstanceId()

clone

public WAPrimaryKey clone()
Overrides:
clone in class Object


Copyright © 2016 Silverpeas. All Rights Reserved.