There are two possible ways we would like to do our work based on stored procedures.
One is with a tool that, atarting with an already implemented database, can create the stored procedures to do the CRUD operations generating them to a sql script file, and all the entity classes needed to persist the objects should use those stored procedures. I acknowledge this would mean for the generation process to understand all the different vendors' propietary syntax for SPs so I don't ask that much, but it would be pretty.
The other is, given the database with all the CRUD stored procedures already implemented, the tool should retrieve the tables and associated stored procedures information and generate the entity classes from that.
That is what I could get from sql2java, provided that I change the templates replacing the SQL statements for procedure calls, and that I name my stored procedures in a consistent way using the base table name and some preffixes or suffixes.
In Netbeans I can easily generate Entity Classes from the database with the already included TopLink framework, or installing Hibernate, but they generate SQL statements.
I see in the link you provided, section 16.3, that I can customize the SQL for generating the CRUD operations. That would solve half my concerns and would be very pretty imho.
So I have another question, do I need to manually map each and every other (non CRUD) stored procedure manually, or is there any way of automagically retrieving them from the database ??
Thanks for your help !!!
Daniel
|