|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sybase.uep.bobclient.data.CommonMBOModel
com.sybase.uep.bobclient.data.MBOModel
public class MBOModel
MBOModel is the access layer to MBO application. It provides wrapper methods to
retrieve data from MBO application as well as insert/update/delete data.
IModelChangeListener
instances could be registered to MBOModel as
listeners. Each time when the model is changed, listeners will receive notification.
And there is only one MBOModel instance created for each MBO application.
Note: Current implementation is based on the assumption that the java package name for object API always equals to MBO package name defined in AFX.
Field Summary |
---|
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 | |
---|---|
protected |
MBOModel()
|
|
MBOModel(java.lang.String id)
Constructor |
Method Summary | |
---|---|
void |
cancelPending(java.lang.Object mbo)
Restores the original state of the MBO instance.The caller takes the responsibility to make sure the metaData of mbo equals to _metaData. |
void |
cancelPendingObjects()
Cancel all the pending operations for this MBO object |
void |
clearSyncParameter()
Resets synchronization parameter to null |
void |
currentSelectChanged()
Fires CURRENT_SELECT_CHANGE_TYPE event. |
void |
deleteFromModel(java.lang.Object mbo)
Deletes the given mbo from MBO application. |
java.util.Vector |
find(Query q)
Queries the MBOModel with Query q and returns the result |
java.util.Vector |
findNamedQuery(java.lang.String namedQuery,
java.util.Hashtable parameters)
Queries the MBOModel by the named query name and returns the result |
java.lang.String |
getLastOperation(java.lang.Object mbo)
Gets this MBO application's last called operation. |
static LogRecord[] |
getLogs(java.lang.String packageName,
Query q)
Get operation logs |
OtherOperationModel |
getOtherOperationModel(java.lang.String operationName)
|
java.util.Hashtable |
getOtherOperationModelTable()
|
ObjectList |
getPendingObjects()
Retrieve the list of pending operations for this MBO object |
java.lang.String |
getProfileRefID()
Get the mobile application reference ID |
protected ReflectionManager |
getReflectionManager()
Get the reflection manager |
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 |
java.lang.String |
getSynchronizationGroup()
Obtains the synchronization group registered by this MBO; Returns null if no synchronization group found |
MBOModelSyncParameters |
getSyncParameter()
Get the synchronization parameters for this MBO |
java.lang.Object |
getValue(java.lang.Object mbo,
java.lang.String attributeName)
Gets the attribute value from a given MBO instance. |
boolean |
isDeleted(java.lang.Object mbo)
Checks if the MBO object has been deleted since last synchronization.The caller takes the responsibility to make sure the metaData of mbo equals to _metaData. |
boolean |
isDirty(java.lang.Object mbo)
Checks if the MBO object has been updated since last synchronization.The caller takes the responsibility to make sure the metaData of mbo equals to _metaData. |
boolean |
isNew(java.lang.Object mbo)
Checks if the MBO object is a new created one since last synchronization.The caller takes the responsibility to make sure the metaData of mbo equals to _metaData. |
boolean |
isSynchronized()
Gets whether this MBO application has been synchronized. |
void |
namedQueryChanged()
Fires NAMED_QUERY_TYPE event. |
void |
namedQueryInitialized()
Fires NAMED_QUERY_INITIALIZED_TYPE event. |
java.lang.Object |
newMBOInstance()
Creates a new MBO instance for this MBO application. |
void |
parentSelectChanged()
Fires PARENT_SELECT_CHANGE_TYPE event. |
void |
refresh(java.lang.Object mbo)
Refresh the given mbo. |
void |
relationshipChanged()
Fires the relationship change event |
void |
saveUpdate(java.lang.Object mbo)
Saves the changes to MBO application. |
void |
setValue(java.lang.Object mbo,
java.lang.String attributeName,
java.lang.Object value)
Sets the attribute value for a given MBO instance. |
int |
size()
Returns mbo data size. |
void |
submitPending(java.lang.Object mbo)
Submit the pending change of the mobile business object (ready for sending to server). |
void |
submitPendingObjects()
Submits all the pending operations for this MBO object. |
void |
synchronize(SyncStatusListener syncStatusListener,
int pendingOpScope)
Synchronizes the MBO application with a sync status listener. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected MBOModel()
public MBOModel(java.lang.String id)
id
- Method Detail |
---|
protected ReflectionManager getReflectionManager()
public java.lang.Object newMBOInstance()
public java.util.Vector find(Query q) throws java.lang.Exception
Query
q and returns the result
q,
- Query instance that is used for searching.
Vector
that contains MBO instances. Return an empty
vector if no data is found.
NoSuchOperationException
- if find(Query q) is not defined in mbo.
java.lang.Exception
public int size()
public java.util.Vector findNamedQuery(java.lang.String namedQuery, java.util.Hashtable parameters) throws java.lang.Exception
namedQuery
- String
value for the named query method nameparameters
- Hashtable
value for the list of parameters
Vector
value for the result set.
NoSuchOperationException
- if namedQuery is not defined in mbo.
java.lang.Exception
public ObjectList getPendingObjects()
ObjectList
list of MBO objectsObjectList
public void cancelPendingObjects()
public void submitPending(java.lang.Object mbo)
mbo
- mobile business object instancepublic void submitPendingObjects()
public void deleteFromModel(java.lang.Object mbo)
mbo
- MBO instance to delete from MBO application
NoSuchOperationException
- if delete() is not defined in mbo.public boolean isDirty(java.lang.Object mbo)
mbo
-
NoSuchOperationException
- if isDirty() is not defined in mbo.public boolean isDeleted(java.lang.Object mbo)
mbo
-
NoSuchOperationException
- if isDelete() is not defined in mbo.public boolean isNew(java.lang.Object mbo)
mbo
-
public MBOModelSyncParameters getSyncParameter()
public static LogRecord[] getLogs(java.lang.String packageName, Query q)
packageName
- - package nameq
- - query object
public java.util.Vector getRelationshipData(java.lang.Object mbo, java.lang.String referenceName)
mbo
- referenceName
-
NoSuchOperationException
- if no matched operation in mbo.public java.lang.Object getSK(java.lang.Object mbo)
mbo
- public void refresh(java.lang.Object mbo)
mbo
- public java.lang.String getProfileRefID()
getProfileRefID
in class CommonMBOModel
public java.util.Vector getRelationshipDataFilterBy(java.lang.Object mbo, java.lang.String relation, Query q)
Query
q is used to
filter the result data.
mbo
- the parent mbo to retrieve the child datarelation
- relationship nameq
- query
NoSuchOperationException
public int getSize(Query query)
Query
q
q,
- Query instance that is used for searching.
NoSuchOperationException
- if getSize(Query q) is not defined in mbo.public void saveUpdate(java.lang.Object mbo)
mbo
- the changed MBO instance
NoSuchOperationException
- if save() is not defined in mbo.public java.lang.Object getValue(java.lang.Object mbo, java.lang.String attributeName)
mbo
- attributeName
-
NoSuchOperationException
- if attribute name is not defined in mbo.public void setValue(java.lang.Object mbo, java.lang.String attributeName, java.lang.Object value)
mbo
- attributeName
-
NoSuchOperationException
- if attribute name is not defined in mbo.public void cancelPending(java.lang.Object mbo)
mbo
-
NoSuchOperationException
- if cancelPending() is not defined in mbo.public void parentSelectChanged()
public void relationshipChanged()
public void currentSelectChanged()
public void namedQueryChanged()
public void namedQueryInitialized()
public void synchronize(SyncStatusListener syncStatusListener, int pendingOpScope) throws java.lang.Exception
synchronize
in class CommonMBOModel
syncStatusListener
- - Sync status listenerpendingOpScope
- - @see CommonMBOModel.PENDING_OP_SCOPE_SYNCGROUP
, CommonMBOModel.PENDING_OP_SCOPE_MBO
, CommonMBOModel.PENDING_OP_SCOPE_PACKAGE
NoSuchOperationException
- if synchronize() is not defined in
corresponding database class.
java.lang.Exception
public boolean isSynchronized()
isSynchronized
in class CommonMBOModel
public java.lang.String getSynchronizationGroup()
CommonMBOModel
getSynchronizationGroup
in class CommonMBOModel
public java.lang.String getLastOperation(java.lang.Object mbo)
mbo
- Object
value for the mbo
String
value for last called operation name.public java.util.Hashtable getOtherOperationModelTable()
public OtherOperationModel getOtherOperationModel(java.lang.String operationName)
public void clearSyncParameter()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |