Hibernate 的轻量级替代品? [英] Light weight alternative to Hibernate?
问题描述
我有一个单用户 Java 程序,我希望将数据存储在一个轻量级数据库中,例如 Derby 或 Sqlite.我想在我的程序中使用数据抽象层.Hibernate 似乎需要很多配置,对于我需要的东西来说太过分了.什么是 Hibernate 的轻量级替代品?
I have a single user java program that I would like to have store data in a light weight database such as Derby or Sqlite. I would like to use a data abstraction layer in my program. Hibernate appears to require a lot of configuration and is overkill for what I need. What are light weight alternatives to Hibernate?
推荐答案
如果您使用注释,Hibernate 需要接近零配置.它甚至可以自动发现类路径中的映射 bean!从简单和的角度来看,我认为没有任何替代方案.
Hibernate requires next to zero configuration if you use annotations. It even can auto-discover mapped beans in the classpath! I don't see any alternative to it from both simplicity and power point of view.
它还可以将自己暴露为 JPA,这(恕我直言)更简单.
It can also expose itself as JPA, which is (IMHO) even simpler.
这篇关于Hibernate 的轻量级替代品?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!