wt.prefs
Class DBPrefEntry

java.lang.Object
  extended bywt.fc.WTObject
      extended bywt.enterprise.Simple
          extended bywt.prefs.DBPrefEntry
All Implemented Interfaces:
AccessControlled, BusinessInformation, DisplayIdentification, DomainAdministered, Externalizable, NetFactor, Notifiable, ObjectMappable, Ownable, Persistable, PrefEntry, Serializable

public class DBPrefEntry
extends Simple
implements PrefEntry, Ownable, Externalizable

Use the newDBPrefEntry static factory method(s), not the DBPrefEntry 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: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
private static SQLFunction concat
           
private  String context
           
static long EXTERNALIZATION_VERSION_UID
           
private static Object lock
           
private  String name
           
private  String node
           
protected static long OLD_FORMAT_VERSION_UID
           
private  Ownership ownership
           
private  String parent
           
private static String RESOURCE
           
private static ClassAttribute search_name
           
private static ClassAttribute search_node
           
private static ClassAttribute search_parent
           
private static ConstantExpression search_sep
           
(package private) static long serialVersionUID
           
private  String value
           
private static boolean VERBOSE
           
 
Fields inherited from class wt.enterprise.Simple
 
Fields inherited from class wt.fc.WTObject
CREATE_TIMESTAMP, MODIFY_TIMESTAMP
 
Fields inherited from interface wt.prefs.PrefEntry
CONTEXT, NAME, NODE, PARENT, VALUE
 
Fields inherited from interface wt.ownership.Ownable
OWNERSHIP
 
Fields inherited from interface wt.fc.Persistable
IDENTITY, PERSIST_INFO, TYPE
 
Fields inherited from interface wt.admin.DomainAdministered
DOMAIN_REF, INHERITED_DOMAIN
 
Fields inherited from interface wt.fc.BusinessInformation
BUSINESS_TYPE, IDENTITY
 
Fields inherited from interface wt.notify.Notifiable
EVENT_SET
 
Fields inherited from interface wt.identity.DisplayIdentification
DISPLAY_IDENTIFIER, DISPLAY_IDENTITY, DISPLAY_TYPE
 
Constructor Summary
DBPrefEntry()
           
 
Method Summary
protected  void appendWhere(QuerySpec qs, Class cls, String field, String cond, String val)
          AppendWhere used for the querying of objects.
 String[] children(String[] search_context)
          

Supported API: false
private  void contextValidate(String a_Context)
           
 void delete()
          

Supported API: false
 boolean equals(Object obj)
          Indicates whether the given object is equal to this object from a persistence perspective, by comparing the two objects ObjectIdentifiers.
static PrefEntry[] getAllEntries(String m_node, String[] m_context, String m_name)
          

Supported API: false
 String getConceptualClassname()
          Deprecated.  
 String getContext()
          Gets the value of the attribute: CONTEXT.
private  QuerySpec getIntermediaryQuerySpec(String[] search_context)
          Will create a Query Spec for all the Intermediary nodes
private  QuerySpec getLeafNodeQuerySpec(String[] search_context)
          Will return all the nodes that are leaf nodes of the current node.
 String getName()
          Gets the value of the attribute: NAME.
 String getNode()
          Gets the value of the attribute: NODE.
 Ownership getOwnership()
          Gets the object for the association that plays role: OWNERSHIP.
 String getParent()
          Gets the value of the attribute: PARENT.
private  QuerySpec getQuerySpec()
          This method will create a query spec for the DBPrefEntry.
private static QuerySpec getQuerySpec(String m_node, String[] m_context, String m_name)
           
private  QuerySpec getSearchQuerySpec(String aString, String[] aContext, boolean isLike)
          This method will build a query spect for this service class.
 String getValue()
          Gets the value of the attribute: VALUE.
 int hashCode()
          Returns a hash code for this object based upon its ObjectIdentifier.
protected  void initialize(String parent, String node, String context, String name, String value)
          Supports initialization, following construction of an instance.
private static void initializeQuery()
           
private  void nameValidate(String a_Name)
           
static DBPrefEntry newDBPrefEntry(String parent, String node, String context, String name, String value)
          

Supported API: false
private  void nodeValidate(String a_Node)
           
private  void parentValidate(String a_Parent)
           
 void persist()
          

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(DBPrefEntry thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 PrefEntry retrieve()
          This method will perform the retrieval of Preference Information (if appropriate) for the given PrefEntry from the back-end store.
 PrefEntry[] retrieveAll()
          This method will perform the retrieval of Preference Information (if appropriate) for the given PrefEntry from the back-end store.
 ArrayList search(String search, String[] contexts, boolean isLike)
          This will search the Preference Entry for the search string.
 void setContext(String a_Context)
          Sets the value of the attribute: CONTEXT.
 void setName(String a_Name)
          Sets the value of the attribute: NAME.
 void setNode(String a_Node)
          Sets the value of the attribute: NODE.
 void setOwnership(Ownership a_Ownership)
          Sets the object for the association that plays role: OWNERSHIP.
 void setParent(String a_Parent)
          Sets the value of the attribute: PARENT.
 void setValue(String a_Value)
          Sets the value of the attribute: VALUE.
 void update()
          This method should force an update on the PrefEntry information to the backing-store according to the current state of the PrefEntry

Supported API: false
private  void valueValidate(String a_Value)
           
 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.enterprise.Simple
getBusinessType, getDomainRef, getEventSet, getIdentity, initialize, isInheritedDomain, readVersion, setDomainRef, setEventSet, setInheritedDomain
 
Methods inherited from class wt.fc.WTObject
checkAttributes, duplicate, finalize, getClassInfo, getCreateTimestamp, getDisplayIdentifier, getDisplayIdentity, getDisplayType, getModifyTimestamp, getPersistInfo, getType, readVersion, setPersistInfo, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface wt.fc.Persistable
checkAttributes, getIdentity, getPersistInfo, getType, setPersistInfo
 
Methods inherited from interface wt.fc.NetFactor
getClassInfo
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

parent

private String parent

name

private String name

value

private String value

node

private String node

context

private String context

ownership

private Ownership ownership

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

VERBOSE

private static boolean VERBOSE

concat

private static SQLFunction concat

search_parent

private static ClassAttribute search_parent

search_node

private static ClassAttribute search_node

search_name

private static ClassAttribute search_name

search_sep

private static final ConstantExpression search_sep

lock

private static Object lock
Constructor Detail

DBPrefEntry

public DBPrefEntry()
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 Simple
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 Simple
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(DBPrefEntry 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 Simple
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 Simple
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

newDBPrefEntry

public static DBPrefEntry newDBPrefEntry(String parent,
                                         String node,
                                         String context,
                                         String name,
                                         String value)
                                  throws WTException


Supported API: false

Parameters:
parent -
node -
context -
name -
value -
Returns:
DBPrefEntry
Throws:
WTException

initialize

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

Supported API: false

Parameters:
parent -
node -
context -
name -
value -
Throws:
WTException

getAllEntries

public static PrefEntry[] getAllEntries(String m_node,
                                        String[] m_context,
                                        String m_name)
                                 throws WTException


Supported API: false

Parameters:
m_node -
m_context -
m_name -
Returns:
PrefEntry[]
Throws:
WTException

getParent

public String getParent()
Gets the value of the attribute: PARENT.

Supported API: false

Specified by:
getParent in interface PrefEntry
Returns:
String

setParent

public void setParent(String a_Parent)
               throws WTPropertyVetoException
Sets the value of the attribute: PARENT.

Supported API: false

Specified by:
setParent in interface PrefEntry
Parameters:
a_Parent -
Throws:
WTPropertyVetoException

parentValidate

private void parentValidate(String a_Parent)
                     throws WTPropertyVetoException
Parameters:
a_Parent -
Throws:
WTPropertyVetoException

getName

public String getName()
Gets the value of the attribute: NAME.

Supported API: false

Specified by:
getName in interface PrefEntry
Returns:
String

setName

public void setName(String a_Name)
             throws WTPropertyVetoException
Sets the value of the attribute: NAME.

Supported API: false

Specified by:
setName in interface PrefEntry
Parameters:
a_Name -
Throws:
WTPropertyVetoException

nameValidate

private void nameValidate(String a_Name)
                   throws WTPropertyVetoException
Parameters:
a_Name -
Throws:
WTPropertyVetoException

getValue

public String getValue()
Gets the value of the attribute: VALUE.

Supported API: false

Specified by:
getValue in interface PrefEntry
Returns:
String

setValue

public void setValue(String a_Value)
              throws WTPropertyVetoException
Sets the value of the attribute: VALUE.

Supported API: false

Specified by:
setValue in interface PrefEntry
Parameters:
a_Value -
Throws:
WTPropertyVetoException

valueValidate

private void valueValidate(String a_Value)
                    throws WTPropertyVetoException
Parameters:
a_Value -
Throws:
WTPropertyVetoException

getNode

public String getNode()
Gets the value of the attribute: NODE.

Supported API: false

Specified by:
getNode in interface PrefEntry
Returns:
String

setNode

public void setNode(String a_Node)
             throws WTPropertyVetoException
Sets the value of the attribute: NODE.

Supported API: false

Specified by:
setNode in interface PrefEntry
Parameters:
a_Node -
Throws:
WTPropertyVetoException

nodeValidate

private void nodeValidate(String a_Node)
                   throws WTPropertyVetoException
Parameters:
a_Node -
Throws:
WTPropertyVetoException

getContext

public String getContext()
Gets the value of the attribute: CONTEXT.

Supported API: false

Specified by:
getContext in interface PrefEntry
Returns:
String

setContext

public void setContext(String a_Context)
                throws WTPropertyVetoException
Sets the value of the attribute: CONTEXT.

Supported API: false

Specified by:
setContext in interface PrefEntry
Parameters:
a_Context -
Throws:
WTPropertyVetoException

contextValidate

private void contextValidate(String a_Context)
                      throws WTPropertyVetoException
Parameters:
a_Context -
Throws:
WTPropertyVetoException

retrieve

public PrefEntry retrieve()
This method will perform the retrieval of Preference Information (if appropriate) for the given PrefEntry from the back-end store.

Supported API: false

Specified by:
retrieve in interface PrefEntry
Returns:
PrefEntry

update

public void update()
            throws WTException
This method should force an update on the PrefEntry information to the backing-store according to the current state of the PrefEntry

Supported API: false

Specified by:
update in interface PrefEntry
Throws:
WTException

persist

public void persist()


Supported API: false

Specified by:
persist in interface PrefEntry

delete

public void delete()


Supported API: false

Specified by:
delete in interface PrefEntry

retrieveAll

public PrefEntry[] retrieveAll()
This method will perform the retrieval of Preference Information (if appropriate) for the given PrefEntry from the back-end store. All entries will be retrieved (since the name could be null)

Supported API: false

Specified by:
retrieveAll in interface PrefEntry
Returns:
PrefEntry[]

children

public String[] children(String[] search_context)


Supported API: false

Specified by:
children in interface PrefEntry
Parameters:
search_context - The context(s) to search the children for
Returns:
String[]

search

public ArrayList search(String search,
                        String[] contexts,
                        boolean isLike)
                 throws WTException
This will search the Preference Entry for the search string. The string will be enclosed with '%' as a wildcard. Also '%' may appear elsewhere in the string indicating a wildcard. if two '%%' appear this represents an actual '%' character. This method should return an ArrayList of matching PrefSearch objects. If there are no items then the ArrayList should be empty but not null PrefSearch API can be found in the Javadoc.

Supported API: false

Specified by:
search in interface PrefEntry
Parameters:
search - The string to search for
contexts - The list of search contexts to use for the search.
isLike - Whether the search is a LIKE search or exact match
Returns:
ArrayList
Throws:
WTException

getOwnership

public Ownership getOwnership()
Gets the object for the association that plays role: OWNERSHIP. The persistent state for an Ownable object is maintained via the Ownership object. Access to information for the Ownership object should be done via methods on the OwnershipHelper.

Supported API: false

Specified by:
getOwnership in interface Ownable
Returns:
Ownership

setOwnership

public void setOwnership(Ownership a_Ownership)
Sets the object for the association that plays role: OWNERSHIP. The persistent state for an Ownable object is maintained via the Ownership object. Access to information for the Ownership object should be done via methods on the OwnershipHelper.

Supported API: false

Specified by:
setOwnership in interface Ownable
Parameters:
a_Ownership -

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 Simple
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 Simple
Returns:
int

appendWhere

protected void appendWhere(QuerySpec qs,
                           Class cls,
                           String field,
                           String cond,
                           String val)
                    throws WTException
AppendWhere used for the querying of objects.

Throws:
WTException

getIntermediaryQuerySpec

private QuerySpec getIntermediaryQuerySpec(String[] search_context)
                                    throws WTException
Will create a Query Spec for all the Intermediary nodes

Parameters:
search_context - The searching contexts.
Throws:
WTException

getQuerySpec

private static QuerySpec getQuerySpec(String m_node,
                                      String[] m_context,
                                      String m_name)
                               throws WTException
Throws:
WTException

getQuerySpec

private QuerySpec getQuerySpec()
                        throws WTException
This method will create a query spec for the DBPrefEntry.

Throws:
WTException

getLeafNodeQuerySpec

private QuerySpec getLeafNodeQuerySpec(String[] search_context)
                                throws WTException
Will return all the nodes that are leaf nodes of the current node.

Parameters:
search_context - The contexts to search
Throws:
WTException

getSearchQuerySpec

private QuerySpec getSearchQuerySpec(String aString,
                                     String[] aContext,
                                     boolean isLike)
                              throws WTException
This method will build a query spect for this service class.

Parameters:
aString - The string to search for.
aContext - The context for the search
isLike - Whether the search is a LIKE or EQUALS search
Returns:
QuerySpec The created query spec.
Throws:
WTException

initializeQuery

private static void initializeQuery()