-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Very simple exmple about Hibernate OGM and MongoDB
PostPosted: Fri Jul 19, 2013 7:22 am 
Beginner
Beginner

Joined: Thu Jul 11, 2013 7:58 am
Posts: 22
Hi experts

could you please post an example for using OGM and MongoDB from scratch, I dont want to use maven to do it, but unfortunattly I didnt finde a clear example
thanks


Top
 Profile  
 
 Post subject: Re: Very simple exmple about Hibernate OGM and MongoDB
PostPosted: Fri Jan 10, 2014 6:59 am 
Hibernate Team
Hibernate Team

Joined: Fri Sep 09, 2011 3:18 am
Posts: 295
Hi,
if you don't want to use maven you have to include the dependencies in your project manually. You will find the required libraries inside the distribution package on SourceForge:

In the documentation you will find the information about how to set the configuation:
http://docs.jboss.org/hibernate/ogm/4.0/reference/en-US/html_single/#_using_jpa

And this is the description of the properties you can use with mongodb:
http://docs.jboss.org/hibernate/ogm/4.0/reference/en-US/html_single/#_configuring_mongodb

Assuming that your db is running locally on the default port you only have to set these properties to connect to the db:
Code:
hibernate.ogm.datastore.provider = MONGODB
hibernate.ogm.mongodb.database = your_database_name/code]

For remote servers you will need to add the URL:
[code]
hibernate.ogm.mongodb.host = ...
hibernate.ogm.mongodb.port = ...


Mapping and querying should be the same as in any other Hibernate ORM/JPA example but let me know if you have specific problems.

I'm not sure if there is an existing project at the moment that can be used as a complete example. If you want to provide one it would be much appreciated.

Hope this help,
Davide


Top
 Profile  
 
 Post subject: Re: Very simple exmple about Hibernate OGM and MongoDB
PostPosted: Fri Jan 10, 2014 7:00 am 
Hibernate Team
Hibernate Team

Joined: Fri Sep 09, 2011 3:18 am
Posts: 295
I forgot to add the Sourceforge link: http://sourceforge.net/projects/hibernate/files/hibernate-ogm/4.0.0.Beta4/


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.