}If You prefer You can find this code here:
http://wklej.org/hash/b0cfedbd617/ But that's not the point. I want to connect to the file persistance.xml. Since I use the @Entity and @NoSql(dataFormat=DataFormatType.MAPPED) in my class.
So I use to connect with my Mongo database a persistance.xml . But I can only connect to the my local MongoDB.. I don't know how i can edit my persistance.xml to have correct connection with MongoDB in cloud ( on
mongolab.com ) . I tried, but was unsuccessful.
My file persistance.xml looks like ( when i connect with my local MongoDB) :
app.pharmacy.Drug <- it is my Entity Class,
This is code:
<?xml version="1.0" encoding="UTF-8"?>
<persistence-unit name="aptekaPU" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<class>app.pharmacy.Drug</class>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="eclipselink.target-database" value="org.eclipse.persistence.nosql.adapters.mongo.MongoPlatform"/>
<property name="eclipselink.nosql.connection-spec" value="org.eclipse.persistence.nosql.adapters.mongo.MongoConnectionSpec"/>
<property name="eclipselink.nosql.property.mongo.port" value="27017"/>
<property name="eclipselink.nosql.property.mongo.host" value="localhost"/>
<property name="eclipselink.nosql.property.mongo.db" value="apteka"/>
</properties>
</persistence-unit>
</persistence>
If You prefer You can find this code here:
http://wklej.org/hash/895c425ce18/Maybe Someone can help me?
Very please with help it because it's part of my Thesis (licenciate).
I hope my Subject is good and place where add my question too. This is my first post here, so if I did something wrong I apologize.
Thanks!