Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DAO generator for java [closed]

Tags:

java

dao

I'm searching for free and simple DAO generator for java (it needs to create entities/bens from db tables/views and generate basic CRUD code). Currently, I`m using DAO4J which lacks some functionality like views mapping. I know that there are frameworks like Hibernate but I dont need such robust framework.

Some things this framework should have to do:

  • Generate CRUD operations with standard SQL queries and not compile-time typesafe queries
  • Doesn't have session concept like hibernate
  • Will not automatically close connection
  • JDBC Connection can be configured through code
like image 739
Ivan Milosavljevic Avatar asked May 18 '11 09:05

Ivan Milosavljevic


2 Answers

None of these are perfect matches, but both rock, in their own individual way:

  1. Spring Roo generates DAOs, Web Controllers and more for you.
  2. QueryDSL automatically creates Objects from your database tables and offers an Object-Oriented query syntax with compile-time safety.

But I'd say the winner is Spring Data. It offers a simple but powerful abstraction over many different underlying data store technologies and generates daos for you automatically. Here's a presentation of Spring Data JPA. Unfortunately Spring Data has not been released in final versions yet.

like image 75
Sean Patrick Floyd Avatar answered Oct 06 '22 23:10

Sean Patrick Floyd


If you just need a code generator without adherence to a framework, you should try Telosys Tools. It's a lightweight tool, it generates code from an existing database model.

See https://www.telosys.org

Some templates are specially designed for JDBC code generation, they are available on GitHub https://github.com/telosys-templates-v3

They offer code generation for DAO, DAO interfaces, POJO (beans), JUnit tests, etc

like image 26
John T Avatar answered Oct 07 '22 01:10

John T