有一些流行的框架可用于处理关系数据库,例如 MyBatis(以前的 iBatis)和 Hibernate。
我可以从社区获得一些关于是否有此类框架可用于 NoSQL 数据库的建议吗?即 MongoDB 和 CouchDB?
我看到 Theserverside.com 上提到了一些 JavATE ,这是吗?相似的?
非常感谢。
There are popular frameworks out there such as MyBatis (former iBatis), and Hibernate to work with relational databases.
Can I get some advice from the community on whether are there such frameworks available for NoSQL databases? i.e. MongoDB and CouchDB?
I saw some mentions of JavATE from Theserverside.com, is this something similar?
Many thanks.
发布评论
评论(4)
CouchDB:
MongoDB:
CouchDB:
MongoDB:
你想通过抽象来完成什么?通常,抽象会隐藏特定的实现......因此,就 NoSQL 而言,这意味着隐藏您正在使用 Mongo 与 Couch(例如)。但 NoSQL 是一个通用术语,指的是 4 类不同的数据存储实现类型。一种是图(Neo4j)、文档(Mongo、Couch)、名称值或宽列(如 Cassandra)。
虽然像 hibernate 这样的抽象在这些类之一中是有意义的,但将它们抽象为业界所谓的“NoSQL”并没有多大意义。
现在...抽象在您的应用程序代码中确实有意义。在java世界中,Spring可以帮助你。使用 Spring 模块(例如 spring-mongo、spring-neo4j)针对仅输入输出 POJO 的 java 接口实现数据访问层。无论如何,这就是可靠的方法。
What are you trying to accomplish through abstraction? Typically, abstraction would hide the particular implementation... so in terms of NoSQL, this would mean hiding that you are using Mongo vs Couch (for instance). But NoSQL is a generic term that refers to 4 distinct classes of implementation of data storage. One is Graph (Neo4j), Document (Mongo, Couch), Name Value, or Wide Column (like Cassandra).
While an abstraction like hibernate would make sense within one of these classes, abstracting them to what the industry calls "NoSQL" would not make a lot of sense.
Now... abstraction DOES make sense in your application code. In the java world, Spring can help you. Implement your data access layer with a Spring module (such as spring-mongo, spring-neo4j) against a java interface that just input-outputs POJOs. That's the SOLID way anyway.
我刚刚推出了一个名为 spring-data-gremlin 的新 Spring-Data 项目,旨在正是这样做。它使用 JPA 注释来映射到任何 Tinkerpop 蓝图 nosql 数据库(OrientDB、TitanDB 目前已实现)。这意味着在任何蓝图 nosql 数据库之间切换应该是一个配置问题。
注意:该项目正处于开发的早期阶段。
I have just pushed a new Spring-Data project named spring-data-gremlin which aims to do exactly this. It uses JPA annotations to map to any Tinkerpop blueprints nosql database (OrientDB, TitanDB are implemented as of now). This means that switching between any blueprints nosql database should be a matter of configuration.
Note: The project is in early stages of development.
Hibernate OGM 允许使用 Hibernate API 来驱动 NoSQL 技术。
Hibernate OGM allows to use the Hibernate API to drive NoSQL technoloqies.