Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Hibernate supports <strong>relational databases</strong>, like MySQL, PostgreSQL, Oracle, DB2 and SQL Server. MongoDB, however, isn't a relational database, it's a <strong>document database</strong>. The differences are quite huge:</p> <ul> <li>a relational database defines relations between tables. Tables consist of rows and columns. The columns, together with any type or relation constraints on them, define the so-called <em>schema</em>.</li> <li>a document database defines document collections. Documement database don't know a <em>schema</em>: every document can have different properties. Note that these aren't called "rows" and "columns", but "documents" and "properties" instead.</li> </ul> <p>So, to answer your question, Hibernate doesn't support <a href="https://community.jboss.org/wiki/SupportedDatabases2" rel="nofollow noreferrer">MongoDB</a> and I think chances are close to zero that it ever will.</p> <p>However, there are ORM implementations for Java / MongoDB, for example <a href="https://code.google.com/p/mongo-java-orm/" rel="nofollow noreferrer">MJORM</a>.</p> <p>However, since these are two completely different points-of-view to database organisation, there is no simple process to migrate. At the very least it will include re-thinking your database design. So it may be worth to re-consider the migration, and see whether or not it is actually needed. In the end, MongoDB is not a drop-in replacement for a relational database, since it isn't a relational database. See the following links for some discussion on the two types of databases:</p> <ul> <li><a href="https://softwareengineering.stackexchange.com/questions/90877/document-database-versus-relational-database-how-to-choose">Document Database versus Relational Database : how to choose?</a></li> <li><a href="https://stackoverflow.com/questions/337344/pros-cons-of-document-based-databases-vs-relational-databases">Pros/cons of document-based databases vs. relational databases</a></li> <li><a href="https://en.wikipedia.org/wiki/Document-oriented_database" rel="nofollow noreferrer">Wikipedia: Document-oriented database</a></li> <li><a href="https://en.wikipedia.org/wiki/Relational_databases" rel="nofollow noreferrer">Wikipedia: Relational database</a></li> </ul> <p><strong>UPDATE Regarding Hibernate OGM</strong></p> <p>You can probably use <a href="http://www.hibernate.org/subprojects/ogm.html" rel="nofollow noreferrer">Hibernate OGM</a>. IMHO, there are two drawbacks:</p> <ol> <li>Hibernate OGM Is currently in beta; there has been no official release yet, and the last beta was released last January, that's half a year ago. It depends on your project whether that is an acceptable risk or not.</li> <li>Hibernate OGM provides a <strong>JPA</strong> implementation for NoSQL storage (among them MongoDB). According to your question, you're currently using Hibernate, and not JPA. That means you'll still have to change your domain objects to use JPA annotations instead of Hibernate annotations.</li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload