发展环境:
想要实现以下目标:
问题:可以使用JPA和Hibernate动态生成SQLite DB模式并填充数据吗?如果是,怎么做?如果没有,则使用哪种ORM来实现这个目标。
其他信息:我正在使用Spring工具套件、JPA和hibernate来实现持久性层。我现在不想返回和用户标准SQL查询来动态创建模式和填充数据。
我东张西望,没有得到任何帮助。我还查看了Hibernate(ORM实现),但没有看到任何对SQLite的专门支持。类似于SQLite官方网站。
如果需要更多细节,请告诉我。
发布于 2014-07-10 04:29:41
可以自动创建数据库架构。
<property name="hibernate.hbm2ddl.auto" value="create" />
在你的persistence.xml里
你的第二个问题在这里得到回答:Does Hibernate Fully Support SQLite https://code.google.com/p/hibernate-sqlite/
https://stackoverflow.com/questions/20728385
复制