|
|||||
| Java DAO Generation J2EE developers use the Data Access Object (DAO) design pattern to separate low-level data access logic from high-level business logic. AspectData DAO for Java generates two kinds of objects.
Table DAO It is possible to create table based DAOs starting from both the schema browser or from the ER diagram. In both cases right click on the desired table and choose Generate | Java DAO. The dialog lets you customize the DAO generation. AspectData can generate both the DAO and the associated Java bean or just the DAO. Select the root directory where you want the classes to be created, add the package names in front of the class names and modify, if neccessary, the property names and types. After you are done click OK. Query DAO To generate query DAO start from the a Query Analyzer windows by editing and executing the query. Usually a query will have a number of input parameters and a result set. For instance: SELECT EMPNO, ENAME, JOB, SAL FROM SCOTT.EMP WHERE SAL BETWEEN 800 AND 2000;
![]() AspectData will try to guess the names and the types of the input parameters and populate the "Query Parameters" table. If you decide that some constant you used in the query should not become a parameter but remain constant (such as date formats for instance) check the "keep constant" checkbox. The dialog shows the original query as well as the prepared statement that will be used at runtime. The DAO will create two search methods:
For instance http://jakarta.apache.org/velocity/docs/user-guide.html |
|||||