I'm looking for a good DAO Generator that build classes with plain JDBC 4 and basic CRUD operations.
I have seen that NetBeans generates classes and Java Beans or Entities with JPA and Hibernate. I'm looking for some other tool like this, but I require that the generated classes don't use third party libraries, only the JRE. I'm grateful for the help.
Let's have a look at Telosys Tools a simple code generator working from a database model. This tool is free and very easy to use. See the web site https://sites.google.com/site/telosystools/
Since version 2.1.1 some templates are available for native JDBC DAO (see the blog http://telosys-tools.blogspot.fr/2015/03/telosys-tools-ver-211-whats-new.html ).
Just choose the bundle "persistence-native-jdbc-TT211" to generate DAO, Interfaces, Beans (DTO), JUnit tests, ... All the templates are free and available on GitHub ( https://github.com/telosys-tools )
I think that you might be interested to take a look at AuDAO source code (you can "use" the part of it which generates the DAO and the Beans and write the code that does something similar - it is open source)
this library does exactly what you describe:
However, I think that you might miss the point, the advantage of using tools like Hibernate is the loose coupling with the database for the developer. You don't need to know all the database dialects; Hibernate does. Which is handy because or production servers run DB2, Oracle or MySQL and our Junit tests use SQLite which has a different syntax.
Good Luck!
Let's have a look at Telosys Tools a simple code generator working from a database model. This tool is free and very easy to use. See the web site https://sites.google.com/site/telosystools/
Since version 2.1.1 some templates are available for native JDBC DAO (see the blog http://telosys-tools.blogspot.fr/2015/03/telosys-tools-ver-211-whats-new.html ).
Just choose the bundle "persistence-native-jdbc-TT211" to generate DAO, Interfaces, Beans (DTO), JUnit tests, ... All the templates are free and available on GitHub ( https://github.com/telosys-tools )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With