EntityImpl is the implementation class of EntityObject which represents a row which currently there in EntityObject Cache. The row may be a row from a database table or a new Row which is created from the Application.
There are a few methods which there in EntityImpl and they are quite useful in the development.
1. public void create (): This method is called whenever a new row is created from the Application. Here we can implement logic to set default values that are needed when a row is created.
2. public void doDML(int operation, TransactionEvent e): This method is called whenever there is any kind of DML operation is going on in the Row. It contains a parameter operation that represents which kind of operation is being done. The operations can be
DML_INSERT: Insert operation is being done.
DML_UPDATE: Update on the Entity Row is being done
DML_DELETE: Delete operation is being done.
3. public void remove(): This method is called whenever a row is deleted for removed from the EntityObject.
There are a few methods which there in EntityImpl and they are quite useful in the development.
1. public void create (): This method is called whenever a new row is created from the Application. Here we can implement logic to set default values that are needed when a row is created.
Example Logic which can be implemented:
Suppose you need to store the information about when and by which user a row is being Created. You can implement the logic here. Here in this method, you can write the code to set UserId and CreateDate, the values will be set at the creation of the Row itself.2. public void doDML(int operation, TransactionEvent e): This method is called whenever there is any kind of DML operation is going on in the Row. It contains a parameter operation that represents which kind of operation is being done. The operations can be
DML_INSERT: Insert operation is being done.
DML_UPDATE: Update on the Entity Row is being done
DML_DELETE: Delete operation is being done.
Example Logic which can be implemented:
On any update of the Row, we can implement the logic to set the Modified Username and Modified date of the row3. public void remove(): This method is called whenever a row is deleted for removed from the EntityObject.
No comments:
Post a Comment