Configurations - mhewedy/spwrap GitHub Wiki

You can configure spwrap when creating an instance of the DAO class by passing an instance of Config class to the DAO.Builder class.

DAO dao = new DAO.Builder(dataSource)
	.config(new Config().useStatusFields(false)
         // other configurations here
         )
	.build();

List of properties:

  • useStatusFields

Default value: true
Description: Every Stored procedure that is being invoked by spwrap by default need to have the last 2 parameters as output parameters of type SMALLINT and VARCHAR to represent the stored procedure status code and message respectively. You can turn this feature off by setting this property value to false. (You never deal with these two parameters when implementing TypedOutputParamMapper).

  • successCode

Default value: 0
Description: As mentioned in the description of useStatusFields, that every stored procedure by default need to provide 2 additional output parameters at the last of parameter list to represent stored procedure status code and optional message. by default the code 0 means success, so if your stored procedure returns values other than 0, then a CallException will be thrown by spwrap, however if you just want to change the success value, then use this property successCode.