I would like to share some generic rules for OData creation in various real time development scenarios .
|Type of Entities
|File Upload Entity
- File upload entity should check media property and in addition to that redefine “Define” method in model provider class and needs to redefine create stream and get stream methods in data provider class.
- To implement batch procedure and make sure to implement code base create method, Change set begin and Change set end.
- In batch implementation process should not write “COMMIT” statement in create method , it means that system itself execute COMMIT statement by Change set begin and Change set end method implementations.
- Header and Item entity sets should has navigation property for triggering Deep entity method implementation.
- Header and Item entity sets should has navigation property and association with same name for $expand functionality (recommended to implement custom expand functionality to avoid the performance issue).
- OData service automatically call get entity method when execute create method, so that get entity needs to implemented to avoid such cases.
General Rules for Entity creation:
- Entity creation always recommended from developed RFC function module. So that fields mapping can done very easily without manual intervention.
- Key field should be there in input and output mapping in case of get entity implementation.
- Make sure that date field check nullable property.