After you generate a test class, you can edit the SQL statements
and change, add, or remove the methods that are in the class. You
can then run the test class to test your pureQuery code.
Procedure
To edit generated pureQuery code:
- Edit the generated test class.
- If you need to change the SQL statement for a method:
- If you want to use the same number of input parameters, edit the
SQL statement but do not edit the signature of the method.
- If you want to use a different number of input parameters:
- Edit the SQL statement.
- Edit the method signature to match the number of input parameters
for the SQL statement.
- If the statement is a SELECT statement and you need a different
result set, generate a bean that represents the result set. Right-click
the SQL statement and select Data Access Development > Generate
pureQuery Code.
- Change the names of any methods.
- Add new methods and corresponding SQL statements.
- Run the test class.