Create and Update API

save

Saves the entity passed as input to the database

 DSApi.save(String className, Object entity)
 
 or
 
 DSApi.save(String className, Object entity, String auditMsg)

Parameters

className: the name of class as created using the workbench 
            (correspond to the table)
entity: 
auditMsg:

Sample Code

String className = "shared.common.product";
Map<String, Object> entity = new HashMap<>();
entity.put("productName", "table");
entity.put("description", "foldable table");
entity.put("prices", 620);
Object res = DSApi.save(className, entity);

Returns

saveMany

Saves the list of entities to the database

Parameters

Sample Code

Returns

Update

Updates the attribute name with the provided value

Parameters

Sample Code

Returns

UpdateMany

Update many records at a time. The class name is provided that indirectly represents a table. ​

Parameters

Sample Code

Returns

UpdateByQuery

Update by executing a query on the table. ​it takes partial query which is the embellished with where clauses.

Parameters

Sample Code

Returns

executeSqlWriteStatement

Execute a stored procedure or SQL string. The statement is prepared for execution.​ Use this method when you're specifying the full statement.

Parameters

Returns

Last updated

Was this helpful?