com.sybase.uep.bobclient.data
Class OtherOperationModel

java.lang.Object
  extended by com.sybase.uep.bobclient.data.CommonMBOModel
      extended by com.sybase.uep.bobclient.data.MBOModel
          extended by com.sybase.uep.bobclient.data.OtherOperationModel

public class OtherOperationModel
extends MBOModel

Handle other operation related operation TODO: abstract MBOModel without so many useless methods

Author:
linsong

Field Summary
static java.lang.String OPERATION_SUFFIX
           
 
Fields inherited from class com.sybase.uep.bobclient.data.CommonMBOModel
_databaseMetaData, _log, _mboApp, _metaData, KEY, PENDING_OP_SCOPE_MBO, PENDING_OP_SCOPE_PACKAGE, PENDING_OP_SCOPE_SYNCGROUP, SYNCHRONIZATION_NORMAL, SYNCHRONIZATION_NOTIFICATION
 
Constructor Summary
OtherOperationModel(MBOModel mboModel, java.lang.String operationName)
           
 
Method Summary
 void currentSelectChanged()
          Fires CURRENT_SELECT_CHANGE_TYPE event.
 java.util.Vector find(Query q)
          Queries the MBOModel with Query q and returns the result
 java.util.Vector findAll()
           
 java.util.Vector findNamedQuery(java.lang.String namedQuery, java.util.Hashtable parameters)
          Queries the MBOModel by the named query name and returns the result
 MBOModel getMBOModel()
           
 java.lang.String getOperationName()
           
static java.lang.String getOtherOperationAlternateName(java.lang.String othrOperClazzName, java.lang.String mboName)
          To be used when getOtherOperationName is incorrect
static java.lang.String getOtherOperationClassName(java.lang.String mboName, java.lang.String operationName)
          class name as [mboname + Otheropertion + "Operation"]
 OtherOperationModel getOtherOperationModel(java.lang.String operationName)
           
 java.util.Hashtable getOtherOperationModelTable()
           
static java.lang.String getOtherOperationName(java.lang.String othrOperClazzName, java.lang.String mboName)
          A simple and often, but not always, accurate way to get the name of an other operation from its class and mbo names
 int getParameterMaxLength(java.lang.String parameterName, java.lang.String namedQuery)
           
 ObjectList getPendingObjects()
          Retrieve the list of pending operations for this OtherOperation object
 java.util.Vector getRelationshipData(java.lang.Object mbo, java.lang.String referenceName)
          Gets the data derived from a relationship.The caller takes the responsibility to make sure the metaData of mbo equals to _metaData.
 java.util.Vector getRelationshipDataFilterBy(java.lang.Object mbo, java.lang.String relation, Query q)
          Gets the data through relationship, and the Query q is used to filter the result data.
 int getSize(Query query)
          Queries the size of the total records in the MBOModel with Query q
 java.lang.Object getSK(java.lang.Object mbo)
          Gets the surrogate key of a given mbo instance
 MBOModelSyncParameters getSyncParameter()
          Get the synchronization parameters for this MBO
 void namedQueryChanged()
          Fires NAMED_QUERY_TYPE event.
 void namedQueryInitialized()
          Fires NAMED_QUERY_INITIALIZED_TYPE event.
 void parentSelectChanged()
          Fires PARENT_SELECT_CHANGE_TYPE event.
 void synchronize(SyncStatusListener syncStatusListener, int pendingOpScope)
          Synchronizes the MBO application with a sync status listener.
 
Methods inherited from class com.sybase.uep.bobclient.data.MBOModel
cancelPending, cancelPendingObjects, clearSyncParameter, deleteFromModel, getLastOperation, getLogs, getProfileRefID, getReflectionManager, getSynchronizationGroup, getValue, isDeleted, isDirty, isNew, isSynchronized, newMBOInstance, refresh, relationshipChanged, saveUpdate, setValue, size, submitPending, submitPendingObjects
 
Methods inherited from class com.sybase.uep.bobclient.data.CommonMBOModel
addModelChangeListener, deleteDatabase, fireModelChanged, fireSyncEvent, fireSyncEvent, getDataType, getID, getLastSynchronized, getLogger, getLogs, getMetaData, getName, getPackageName, getSynchronizationGroup, getSynchronizationProfile, getSynchronizationProfile, getType, invoke, invoke, loginToSync, registerCallbackHandler, removeModelChangeListener, startBackgroundSynchronization, startBackgroundSynchronization, submitPendingOperations, submitPendingOperations, synchronize, synchronize, syncSyncGroup, syncSyncGroupNoSubmit, uploadLogs
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OPERATION_SUFFIX

public static java.lang.String OPERATION_SUFFIX
Constructor Detail

OtherOperationModel

public OtherOperationModel(MBOModel mboModel,
                           java.lang.String operationName)
Method Detail

getMBOModel

public MBOModel getMBOModel()
Returns:
parent MBOModel

getOperationName

public java.lang.String getOperationName()
Returns:
the name of operation

getOtherOperationClassName

public static java.lang.String getOtherOperationClassName(java.lang.String mboName,
                                                          java.lang.String operationName)
class name as [mboname + Otheropertion + "Operation"]

Returns:

getOtherOperationName

public static java.lang.String getOtherOperationName(java.lang.String othrOperClazzName,
                                                     java.lang.String mboName)
A simple and often, but not always, accurate way to get the name of an other operation from its class and mbo names

Parameters:
othrOperClazzName -
mboName -
Returns:

getOtherOperationAlternateName

public static java.lang.String getOtherOperationAlternateName(java.lang.String othrOperClazzName,
                                                              java.lang.String mboName)
To be used when getOtherOperationName is incorrect

Parameters:
othrOperClazzName -
mboName -
Returns:

find

public java.util.Vector find(Query q)
Description copied from class: MBOModel
Queries the MBOModel with Query q and returns the result

Overrides:
find in class MBOModel
Returns:
a Vector that contains MBO instances. Return an empty vector if no data is found.

findNamedQuery

public java.util.Vector findNamedQuery(java.lang.String namedQuery,
                                       java.util.Hashtable parameters)
Description copied from class: MBOModel
Queries the MBOModel by the named query name and returns the result

Overrides:
findNamedQuery in class MBOModel
Parameters:
namedQuery - String value for the named query method name
parameters - Hashtable value for the list of parameters
Returns:
Vector value for the result set.

findAll

public java.util.Vector findAll()

getPendingObjects

public ObjectList getPendingObjects()
Retrieve the list of pending operations for this OtherOperation object

Overrides:
getPendingObjects in class MBOModel
Returns:
ObjectList list of OtherOperation objects
See Also:
ObjectList

getSyncParameter

public MBOModelSyncParameters getSyncParameter()
Description copied from class: MBOModel
Get the synchronization parameters for this MBO

Overrides:
getSyncParameter in class MBOModel
Returns:
MBOModelSyncParameters object

getRelationshipData

public java.util.Vector getRelationshipData(java.lang.Object mbo,
                                            java.lang.String referenceName)
Description copied from class: MBOModel
Gets the data derived from a relationship.The caller takes the responsibility to make sure the metaData of mbo equals to _metaData. For example, caller should not try to use a Customer MBOModel to get the relationship data from a SalesOrder instance

Overrides:
getRelationshipData in class MBOModel

getSK

public java.lang.Object getSK(java.lang.Object mbo)
Description copied from class: MBOModel
Gets the surrogate key of a given mbo instance

Overrides:
getSK in class MBOModel
Parameters:
mbo -
Returns:

getRelationshipDataFilterBy

public java.util.Vector getRelationshipDataFilterBy(java.lang.Object mbo,
                                                    java.lang.String relation,
                                                    Query q)
Description copied from class: MBOModel
Gets the data through relationship, and the Query q is used to filter the result data.

Overrides:
getRelationshipDataFilterBy in class MBOModel
Parameters:
mbo - the parent mbo to retrieve the child data
relation - relationship name
q - query
Returns:
the data matches the query

getSize

public int getSize(Query query)
Description copied from class: MBOModel
Queries the size of the total records in the MBOModel with Query q

Overrides:
getSize in class MBOModel
Returns:
the count of the records

getParameterMaxLength

public int getParameterMaxLength(java.lang.String parameterName,
                                 java.lang.String namedQuery)

parentSelectChanged

public void parentSelectChanged()
Description copied from class: MBOModel
Fires PARENT_SELECT_CHANGE_TYPE event.

Overrides:
parentSelectChanged in class MBOModel

currentSelectChanged

public void currentSelectChanged()
Description copied from class: MBOModel
Fires CURRENT_SELECT_CHANGE_TYPE event.

Overrides:
currentSelectChanged in class MBOModel

namedQueryChanged

public void namedQueryChanged()
Description copied from class: MBOModel
Fires NAMED_QUERY_TYPE event.

Overrides:
namedQueryChanged in class MBOModel

namedQueryInitialized

public void namedQueryInitialized()
Description copied from class: MBOModel
Fires NAMED_QUERY_INITIALIZED_TYPE event.

Overrides:
namedQueryInitialized in class MBOModel

synchronize

public void synchronize(SyncStatusListener syncStatusListener,
                        int pendingOpScope)
                 throws java.lang.Exception
Description copied from class: MBOModel
Synchronizes the MBO application with a sync status listener.

Overrides:
synchronize in class MBOModel
Parameters:
syncStatusListener - - Sync status listener
pendingOpScope - - @see CommonMBOModel.PENDING_OP_SCOPE_SYNCGROUP, CommonMBOModel.PENDING_OP_SCOPE_MBO, CommonMBOModel.PENDING_OP_SCOPE_PACKAGE
Throws:
NoSuchOperationException - if synchronize( SyncStatusListener ) is not defined in corresponding database class.
java.lang.Exception

getOtherOperationModel

public OtherOperationModel getOtherOperationModel(java.lang.String operationName)
Overrides:
getOtherOperationModel in class MBOModel

getOtherOperationModelTable

public java.util.Hashtable getOtherOperationModelTable()
Overrides:
getOtherOperationModelTable in class MBOModel