用于java的DAO生成器 [英] DAO generator for java
问题描述
我正在为java搜索免费且简单的DAO生成器(它需要从db表/视图创建实体/ bens并生成基本的CRUD代码)。目前,我使用的DAO4J缺少视图映射等功能。我知道有像Hibernate这样的框架,但我不需要这样强大的框架。
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:
- 生成CRUD操作标准SQL查询而非编译时类型安全查询
- 没有像hibernate这样的会话概念
- 不会自动关闭连接
- JDBC连接可以通过代码配置
- 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
推荐答案
这些都不是完美的比赛,但两者都以自己的方式摇滚:
None of these are perfect matches, but both rock, in their own individual way:
- Spring Roo 为您生成DAO,Web
控制器等。 - QueryDSL 自动从数据库表中创建对象,并提供具有编译时安全性的面向对象查询语法。
- Spring Roo generates DAOs, Web Controllers and more for you.
- QueryDSL automatically creates Objects from your database tables and offers an Object-Oriented query syntax with compile-time safety.
但我会说赢家是 Spring Data 。它提供了对许多不同底层数据存储技术的简单但强大的抽象,并自动为您生成daos。以下是 Spring Data JPA 的演示文稿。 不幸的是,Spring Data尚未在最终版本中发布。
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.
这篇关于用于java的DAO生成器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!