com.wavemaker.runtime.service
Interface LiveDataService

All Known Implementing Classes:
AbstractLiveDataService

public interface LiveDataService

This interface defines a LiveData/CRUD service. These services must provide standard CRUD operations (Create, Read, Update, Delete) to the client.

Version:
$Rev: 29063 $ - $Date: 2010-04-29 17:56:29 -0700 (Thu, 29 Apr 2010) $
Author:
small

Method Summary
 void delete(java.lang.Object o)
          Delete the object.
 java.lang.Object insert(java.lang.Object o)
          Insert the object, and return the same object (which may be updated as a result of the insert operation).
 com.wavemaker.runtime.service.TypedServiceReturn read(com.wavemaker.json.type.TypeDefinition type, java.lang.Object o, com.wavemaker.runtime.service.PropertyOptions propertyOptions, com.wavemaker.runtime.service.PagingOptions pagingOptions)
          LiveData interface's read() operation.
 java.lang.Object update(java.lang.Object o)
          Update the parameter, and return the same object (may be updated as a result of the update operation).
 

Method Detail

read

com.wavemaker.runtime.service.TypedServiceReturn read(com.wavemaker.json.type.TypeDefinition type,
                                                      java.lang.Object o,
                                                      com.wavemaker.runtime.service.PropertyOptions propertyOptions,
                                                      com.wavemaker.runtime.service.PagingOptions pagingOptions)
                                                      throws java.lang.Exception
LiveData interface's read() operation. This should read data from the object 'o' (if not null) or from a type specified from type (if o is null), according to the rules found in propertyOptions and returning results according to pagingOptions.

Parameters:
type - The type of data to be returned (ignored if argument o is not null, and this will be the same as o.getClass()).
o - The object to read parameters based on (takes precedence over type).
propertyOptions - Specifies what properties to load.
pagingOptions - Specifies how much to load.
Returns:
There are several choices for return types:
  • An instance of TypedServiceReturn, containing a LiveDataServiceResponse object with paging or other information.
  • An instance of TypedServiceReturn, containing the raw Object to be returned to the client with no paging information.
In either of those cases, the type information is optional, but recommended. If type information is included, it must be from the root of the type tree. If a LiveDataServiceResponse is being returned, the type information must contain those fields.
Throws:
java.lang.Exception

update

java.lang.Object update(java.lang.Object o)
                        throws java.lang.Exception
Update the parameter, and return the same object (may be updated as a result of the update operation).

Parameters:
o - The object to update.
Returns:
The updated object (this may be changed as the result of the update).
Throws:
java.lang.Exception

insert

java.lang.Object insert(java.lang.Object o)
                        throws java.lang.Exception
Insert the object, and return the same object (which may be updated as a result of the insert operation).

Parameters:
o - The object to insert.
Returns:
The object, after insertion; this may have been changed as a result of the update.
Throws:
java.lang.Exception

delete

void delete(java.lang.Object o)
            throws java.lang.Exception
Delete the object.

Parameters:
o - The object to delete.
Throws:
java.lang.Exception