Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 11 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
所有这些工具都是非常轻量级的 JDBC 包装器,无需添加任何 ORM / ActiveRecord 功能:
这些工具添加了一些与 ORM/ActiveRecord 模型相关的附加功能,因此不太轻量级:
这些还具有流畅的 API类型安全的 SQL 构造:
All of these tools are very lightweight wrappers for JDBC, without adding any ORM / ActiveRecord features:
These tools add a couple of additional features related to ORM / ActiveRecord models and are thus a bit less lightweight:
These ones also feature a fluent API for typesafe SQL construction:
不要忘记OrmLite。
不过,请确保您确实需要 ORM。
编辑以回复评论
对于简单的 Java 项目(现在很少见),我通常不关心 ORM,但仍然使用 Commons BeanUtils 的 RowSetDynaClass 有时会出现。这会包装查询结果并允许使用普通的 BeanUtils
copyProperties
类型方法复制到域对象。Don't forget OrmLite.
Make sure you need an ORM at all, though.
Edit to respond to comment
For simple Java projects (a rarity these days) I often don't bother with ORM, but still use Commons BeanUtils' RowSetDynaClass sometimes. This wraps query results and allows copying to domain objects using normal BeanUtils
copyProperties
-type methods.Spring 的 SimpleJdbcTemplate< /a> 是最轻量级的。您无需使用所有样板即可使用 SQL。您也不需要完整的 Spring 机制 - 只需使用您需要的即可。
如果 SimpleJdbcTemplate 对您来说太轻量,请尝试 iBatis。它是 JDBC 和 Hibernate 之间的中间步骤。
Spring's SimpleJdbcTemplate is as lightweight as it gets. You can use SQL without all the boilerplate. You don't need the full Spring machinery, either - just use what you need.
If SimpleJdbcTemplate is too light for you, try iBatis. It's an intermediate step between JDBC and Hibernate.
我专门设计了 sormula 作为一个轻量级的 ORM。它支持 CRUD 且对 POJO 友好。你不写任何 DAO。零配置、零注释是可能的。
I designed sormula specifically to be a lightweight ORM. It is CRUD-ready and POJO-friendly. You don't write any DAO's. Zero-configuration, zero-annotation is possible.