wood burning stoves 2.0*
The moose likes MongoDB and the fly likes MongoDB and Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » MongoDB
Bookmark "MongoDB and Java" Watch "MongoDB and Java" New topic
Author

MongoDB and Java

Sujoy Choudhury
Ranch Hand

Joined: Sep 17, 2008
Posts: 136

Hi Kyle,

Being a Java developer, I would like to know that only by having mongoDB driver jar file, would I be able to use mongoDB.
Or is there anything else I have to do?

I presume that drivers are available for mongoDB.

Right?


Thanks and Regards,
~Sujoy
Askar Akhmerov
Greenhorn

Joined: Apr 13, 2010
Posts: 20

Hi Sujoy,

drivers are certanly out there
you can use following maven dependency:




I would also recomend investigating Spring-MongoDB integration. The thing actually offers some amazing features as annotated queries and auto generation of repositories code with simple CRUD operations implemented for collections.
Peter Smorada
Greenhorn

Joined: May 02, 2011
Posts: 12

Hi,

I'd like to ask what is that experince using MongoDB with Hibernate or if it is possile.


OCPJP
Askar Akhmerov
Greenhorn

Joined: Apr 13, 2010
Posts: 20

Hi Peter,

as far as I know, hibernate as well as JPA notation are not adopted to support MongoDB and NoSQL databases.
Spring-Mongo is trying to wrap JPA around it's own datasources implementation, but I havent tryed it.

There is a lot of things why this would work badly even theoretically.
Peter Smorada
Greenhorn

Joined: May 02, 2011
Posts: 12

Hi Askar,

Your answer has made to to look more into NoSQL databases... So I hope that with developement of UnQL some big frameworks will show up soon.
Andrew Moko
Ranch Hand

Joined: Dec 16, 2011
Posts: 55
Askar Akhmerov wrote:Hi Peter,

as far as I know, hibernate as well as JPA notation are not adopted to support MongoDB and NoSQL databases.
Spring-Mongo is trying to wrap JPA around it's own datasources implementation, but I havent tryed it.

There is a lot of things why this would work badly even theoretically.


Hibernate OGM???
Askar Akhmerov
Greenhorn

Joined: Apr 13, 2010
Posts: 20

Wops,

Hibernate OGM haven't heard about that. Thanks for the knowlege.

Have you tried it? Just wandering if they are trying to apply transactions management to NoSQL ;)

UPD. The guys clearly state that framework is mainly aimed to support Hibernate's Infinispan db[General Architecture section]. Which is probably most suitable data layer representation to use with the framework.
Sujoy Choudhury
Ranch Hand

Joined: Sep 17, 2008
Posts: 136

Thanks everyone for your valuable inputs.
Andrew Moko
Ranch Hand

Joined: Dec 16, 2011
Posts: 55
Askar Akhmerov wrote:Wops,

Hibernate OGM haven't heard about that. Thanks for the knowlege.

Have you tried it? Just wandering if they are trying to apply transactions management to NoSQL ;)

UPD. The guys clearly state that framework is mainly aimed to support Hibernate's Infinispan db[General Architecture section]. Which is probably most suitable data layer representation to use with the framework.


My guess is that it comes with all hibernate features - Security, Transaction Management etc etc. And Yes, as per the documentation they are using Infinispan as the persistence store. Can't the store be totally decoupled from the api JUST SO it's possible to plug a SQL/ NoSQL to it without having to rely on infinispan? And the persistence store NEEDS to follow a well-defined specification?? My two cents
Kyle Banker
author
Greenhorn

Joined: Nov 22, 2011
Posts: 16
Hi Sujoy,

For what it's worth, most Java developers I know use Morphia:
http://code.google.com/p/morphia/

Regards,
Kyle
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MongoDB and Java