Java hibernate and mongodb simple

Thursday, May 18th, 2017 (0 Comment)

In this article, we will use java simple to integrate hibernate and mongodb nosql database focus on entity class.

We need to get Create java hibernate simple test project in eclipse article and only modify persistence.xml file to connect mongodb nosql database.

Example: we have a CRUD project simple with mysql or oracle database, we use entity class to mapping between hibernate and database after that we need change this database to mongodb nosql database then we can change config of hibernate (persistence.xml).

Important: Should not convert your project from rdbms database to nosql database, because we have many many bugs and issue…

1) Config maven library for hibernate and mongodb

pom.xml

2) Change config oracle connection in previous article to hibernate and mongodb

persistence.xml

If we get previous article then we only change section 1,2 and we can run App.java file.

We will modify main function in App.java file to see effectly.

App.java

Output

To clearly about relationships table A and Table B, we can read Java hibernate mongodb OneToMany and ManyToOne

Tags: , , ,

Related Posts

core java
Export Crystal Report with Subreport in java
core java
Convert xml to object java and vice versa
core java
Java basic tutorial on lvtutorial.com
core java
Java hibernate manytomany to manage user role

Related Posts

core java
Export Crystal Report with Subreport in java
core java
Convert xml to object java and vice versa
core java
Java basic tutorial on lvtutorial.com
core java
Java hibernate manytomany to manage user role

Leave a Reply

Your email address will not be published. Required fields are marked *