Has anyone used hibernate simply as a RAD dao code generator? (pun intended).
I work at a company where the persistence layer is hand written for various reasons. I am wondering if there is a way to make hibernate output a file something like the following pseduo code below (Assume customer.hbm.xml already exists).
Code:
public class customerDAO{
public insertCustomer(Customer customer){
connx = getConnx();
connx.set...
insert into CSTMR (customerId, customerName) values (...)
}
public updateCustomer(Customer customer){
connx = getConnx();
connx.set...
update CSTMR ....
}
public deleteCustomer(Customer customer){
}
It would save me time from looking up the database field names, getting the corresponding property of the value object, etc.
I guess because the .hbm.xml file is available I could create a custom xml parser, parse the file, and spit out the code above based on any preferences I have.
Any thoughts or ideas for other ways to do this?