Package com.smartgwt.client.docs
Interface HbBeans
public interface HbBeans
Beans and the DSRequest / DSResponse
This section relates to JPA and Hibernate datasources and describes how submitted data is used and what to expect inDSResponse if Smartclient is integrated with Hibernate
using "Pre-existing beans" approach (see HibernateIntegration
for details). Note that "beanless" integration mode is completely omitted here, since in
that case data is represented by Maps instead of Beans.
Data sent in DSRequest
In case of add or update operationsDSRequest data is used to populate associated
Bean: - add - new
Beanis created and filled with submitted data - update - existing
Beanis retrieved and then submitted data is set overwriting existing values
DataSource.setProperties(...) server-side API, which performs automatic
conversions of any types that can reasonably be auto-converted, supports inner beans and
recursive data structures, see server-side javadocs for details.
Data returned in DSResponse
In case of getting access to DSResponse (for example, by manually executing DSRequest in a DMI), DSResponse data can be accessed by callingDSResponse.getData() server-side API. See what data will be returned depending on
operation type and other
circumstances:
| Operation type | DSResponse data |
| Fetch | Generally fetch operation will return List of Beans or empty
List if no records were found. However some features, if used, do break this rule:
|
| Add | Add operation will return created
Bean. |
| Update | If multiple
records update is allowed (see OperationBinding.allowMultiUpdate and MultiUpdatePolicy}),
then update operation will return List of Beans, or empty
List if no records were actually updated. If multiple records update is not
allowed, then update operation will return updated Bean, or null if
record was not updated (for example, in case if it does not exist). |
| Remove | If multiple records update is allowed, then remove operation
will always return null. If multi records update is not allowed, then remove
operation will return a Map holding field/value pairs for Primary Key fields of the record
requested to be removed, no matter if the record was actually removed. Consult
DSResponse.getAffectedRows() server-side API to see if the record was removed, or
how many records were removed in case of multiple records removal. |