wt.fc
Class SemanticKey

java.lang.Object
  extended bywt.fc.WTObject
      extended bywt.fc.SemanticKey
All Implemented Interfaces:
DisplayIdentification, Externalizable, NetFactor, ObjectMappable, Persistable, Serializable
Direct Known Subclasses:
AbsCollectionCriteriaKey, BaseCriterionDefMasterKey, ChangeKey, DataFormatKey, DerivedImageKey, EffContextKey, EPMDocumentMasterKey, EPMWorkspaceKey, ESITargetKey, ManagedBaselineKey, MaturityKey, SubFolderLinkConstraint, WfProcessTemplateKey, WTDocumentMasterKey, WTPartMasterKey, WTUnitMasterKey

public class SemanticKey
extends WTObject
implements Externalizable

The SemanticKey class helps to ensure the uniqueness constraint on object's identity. This is accomplished by storing persistently a unique string representing the identity.

Use the newSemanticKey static factory method(s), not the SemanticKey constructor, to construct instances of this class. Instances must be constructed using the static factory(s), in order to ensure proper initialization of the instance.



Supported API: true

Extendable: true

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
static long EXTERNALIZATION_VERSION_UID
           
private  String key
           
protected static String KEY
          Label for the attribute; String representing the identity of an object.
private static int KEY_UPPER_LIMIT
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
private  ObjectReference theUniquelyIdentifiedReference
           
static String UNIQUELY_IDENTIFIED
          Label for the attribute.
static String UNIQUELY_IDENTIFIED_REFERENCE
          Label for the attribute.
 
Fields inherited from class wt.fc.WTObject
CREATE_TIMESTAMP, MODIFY_TIMESTAMP
 
Fields inherited from interface wt.fc.Persistable
IDENTITY, PERSIST_INFO, TYPE
 
Fields inherited from interface wt.identity.DisplayIdentification
DISPLAY_IDENTIFIER, DISPLAY_IDENTITY, DISPLAY_TYPE
 
Constructor Summary
SemanticKey()
           
 
Method Summary
 boolean equals(Object obj)
          Indicates whether the given object is equal to this object from a persistence perspective, by comparing the two objects ObjectIdentifiers.
 String getConceptualClassname()
          Deprecated.  
protected  String getKey()
          Gets the value of the attribute: KEY.
 UniquelyIdentified getUniquelyIdentified()
          Gets the object for the association that plays role: UNIQUELY_IDENTIFIED.
 ObjectReference getUniquelyIdentifiedReference()
          Gets the value of the attribute: UNIQUELY_IDENTIFIED_REFERENCE.
 int hashCode()
          Returns a hash code for this object based upon its ObjectIdentifier.
protected  void initialize(String identity)
          Supports initialization, following construction of an instance.
private  void keyValidate(String a_Key)
           
static SemanticKey newSemanticKey(String identity)
          

Supported API: false
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
 void readExternal(PersistentRetrieveIfc input)
          Used by Persistent Data Service to populate the persistent attributes of this class from a persistent store.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(SemanticKey thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
protected  void setKey(String a_Key)
          Sets the value of the attribute: KEY.
 void setUniquelyIdentified(UniquelyIdentified a_UniquelyIdentified)
          Sets the object for the association that plays role: UNIQUELY_IDENTIFIED.
 void setUniquelyIdentifiedReference(ObjectReference a_UniquelyIdentifiedReference)
          Sets the value of the attribute: UNIQUELY_IDENTIFIED_REFERENCE.
private  void theUniquelyIdentifiedReferenceValidate(ObjectReference a_UniquelyIdentifiedReference)
           
 String toString()
          

Supported API: false
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 void writeExternal(PersistentStoreIfc output)
          Used by Persistent Data Service to obtain the values of the persistent attributes of this class, so they can be written to a persistent store.
 
Methods inherited from class wt.fc.WTObject
checkAttributes, duplicate, finalize, getClassInfo, getCreateTimestamp, getDisplayIdentifier, getDisplayIdentity, getDisplayType, getIdentity, getModifyTimestamp, getPersistInfo, getType, initialize, readVersion, setPersistInfo
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

KEY

protected static final String KEY
Label for the attribute; String representing the identity of an object. It is required that different identities be mapped to different strings. This can be accomplished for example, by concatenating the attributes that constitute the identity, separating the component attributes by an adequate separator. An adequate separator is one that is guaranteed not to occur inside the attributes.

Supported API: false

See Also:
Constant Field Values

KEY_UPPER_LIMIT

private static int KEY_UPPER_LIMIT

key

private String key

UNIQUELY_IDENTIFIED

public static final String UNIQUELY_IDENTIFIED
Label for the attribute.

Supported API: false

See Also:
Constant Field Values

UNIQUELY_IDENTIFIED_REFERENCE

public static final String UNIQUELY_IDENTIFIED_REFERENCE
Label for the attribute.

Supported API: false

See Also:
Constant Field Values

theUniquelyIdentifiedReference

private ObjectReference theUniquelyIdentifiedReference

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values
Constructor Detail

SemanticKey

public SemanticKey()
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class WTObject
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class WTObject
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(SemanticKey thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(PersistentStoreIfc output)
                   throws SQLException,
                          DatastoreException
Used by Persistent Data Service to obtain the values of the persistent attributes of this class, so they can be written to a persistent store.

(Not intended for general use.)

Supported API: false

Specified by:
writeExternal in interface ObjectMappable
Overrides:
writeExternal in class WTObject
Parameters:
output -
Throws:
SQLException
DatastoreException

readExternal

public void readExternal(PersistentRetrieveIfc input)
                  throws SQLException,
                         DatastoreException
Used by Persistent Data Service to populate the persistent attributes of this class from a persistent store.

(Not intended for general use.)

Supported API: false

Specified by:
readExternal in interface ObjectMappable
Overrides:
readExternal in class WTObject
Parameters:
input -
Throws:
SQLException
DatastoreException

getConceptualClassname

public String getConceptualClassname()
Deprecated.  

Returns the conceptual (modeled) name for the class.

Supported API: false

Specified by:
getConceptualClassname in interface NetFactor
Returns:
String

getKey

protected String getKey()
Gets the value of the attribute: KEY. String representing the identity of an object. It is required that different identities be mapped to different strings. This can be accomplished for example, by concatenating the attributes that constitute the identity, separating the component attributes by an adequate separator. An adequate separator is one that is guaranteed not to occur inside the attributes.

Supported API: false

Returns:
String

setKey

protected void setKey(String a_Key)
               throws WTPropertyVetoException
Sets the value of the attribute: KEY. String representing the identity of an object. It is required that different identities be mapped to different strings. This can be accomplished for example, by concatenating the attributes that constitute the identity, separating the component attributes by an adequate separator. An adequate separator is one that is guaranteed not to occur inside the attributes.

Supported API: false

Parameters:
a_Key -
Throws:
WTPropertyVetoException

keyValidate

private void keyValidate(String a_Key)
                  throws WTPropertyVetoException
Parameters:
a_Key -
Throws:
WTPropertyVetoException

getUniquelyIdentified

public UniquelyIdentified getUniquelyIdentified()
Gets the object for the association that plays role: UNIQUELY_IDENTIFIED.

Supported API: false

Returns:
UniquelyIdentified

setUniquelyIdentified

public void setUniquelyIdentified(UniquelyIdentified a_UniquelyIdentified)
                           throws WTPropertyVetoException,
                                  WTException
Sets the object for the association that plays role: UNIQUELY_IDENTIFIED.

Supported API: false

Parameters:
a_UniquelyIdentified -
Throws:
WTPropertyVetoException
WTException

getUniquelyIdentifiedReference

public ObjectReference getUniquelyIdentifiedReference()
Gets the value of the attribute: UNIQUELY_IDENTIFIED_REFERENCE.

Supported API: false

Returns:
ObjectReference

setUniquelyIdentifiedReference

public void setUniquelyIdentifiedReference(ObjectReference a_UniquelyIdentifiedReference)
                                    throws WTPropertyVetoException
Sets the value of the attribute: UNIQUELY_IDENTIFIED_REFERENCE.

Supported API: false

Parameters:
a_UniquelyIdentifiedReference -
Throws:
WTPropertyVetoException

theUniquelyIdentifiedReferenceValidate

private void theUniquelyIdentifiedReferenceValidate(ObjectReference a_UniquelyIdentifiedReference)
                                             throws WTPropertyVetoException
Parameters:
a_UniquelyIdentifiedReference -
Throws:
WTPropertyVetoException

newSemanticKey

public static SemanticKey newSemanticKey(String identity)
                                  throws WTException


Supported API: false

Parameters:
identity -
Returns:
SemanticKey
Throws:
WTException

initialize

protected void initialize(String identity)
                   throws WTException
Supports initialization, following construction of an instance. Invoked by "new" factory having the same signature.

Supported API: false

Parameters:
identity -
Throws:
WTException

toString

public String toString()


Supported API: false

Overrides:
toString in class WTObject
Returns:
String

equals

public boolean equals(Object obj)
Indicates whether the given object is equal to this object from a persistence perspective, by comparing the two objects ObjectIdentifiers. Changed or stale copies are still considered equal by this method. Delegates to PersistenceHelper.equals(Persistable,Object).

Warning: Certain core Windchill operations may depend upon equals being ObjectIdentifier-based. Changes to the default implementation should be done with care, if at all.

Supported API: false

Overrides:
equals in class WTObject
Parameters:
obj -
Returns:
boolean

hashCode

public int hashCode()
Returns a hash code for this object based upon its ObjectIdentifier. Delegates to PersistenceHelper.hashCode(Persistable).

Warning: Certain core Windchill operations may depend upon hashCode being ObjectIdentifier-based. Changes to the default implementation should be done with care, if at all.

Supported API: false

Overrides:
hashCode in class WTObject
Returns:
int