CRUD Operations

The acronym CRUD refers to all the major functions that are implemented by relational databases. A mapping of the CRUD operations to the corresponding Operations supported by the Framework is –as follows:

Operation

SQL

Equivalent Support in DAF

Create

INSERT

DatabaseConstants.INSERT
DatabaseConstants.BATCH_INSERT

Read / Retrieve / Search

SELECT

DatabaseConstants.SELECT

Update / Modify

UPDATE

DatabaseConstants.UPDATE
DatabaseConstants.BATCH_UPDATE

Delete / Destroy

DELETE

DatabaseConstants.DELETE

Multiple

EXEC (Stored Procedure)

DatabaseConstants.EXECUTE_SP_NO_RETURN_NO_OUT
DatabaseConstants.EXECUTE_SP_NO_RETURN_ONLY_OUT
DatabaseConstants.EXECUTE_SP_ONLY_RETURN_NO_OUT
DatabaseConstants.EXECUTE_SP_RETURN_AND_OUT


For all the examples, the operations are around a simple table as –follows:

create or replace table EMPLOYEE 
( EMP_ID VARCHAR2(10) NOT NULL,
EMP_NAME VARCHAR2(100) NOT NULL,
DOB DATE NOT NULL,
MOB_NO VARCHAR2(15)
); 


The following convention is used for the DML locator for the examples -

Data Access Map Key : Module Name (EMPLOYEE)
Operation Extension : Application Name (MYAPP)


Needless to say, all the operations that involve data manipulation needs to be run within a transaction boundary. The DAF does not mandate usage of transactions; rather it tries to enlist itself into a transaction that may have already been started. The default configuration done by the framework is to enable the enlisting. This would mean that as an end application, you have the liberty to place your transaction boundary in any layer and the DML queries automatically enlist themselves into the transaction.

View the following Pages: