-->
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: Registering a new DataStore provider
PostPosted: Mon Apr 03, 2017 6:13 am 
Newbie

Joined: Mon Apr 03, 2017 6:04 am
Posts: 4
I am developing a new datastore provider using NeoEmf.
I have based my code on the cassandra code as it seems to be the closest to what I want to provide.

I have some basic functionality coded and would like to run some tests to try to understand more how the implementation should work.
However, when I try to run the tests I am getting an exception:
Code:
...
Caused by: java.lang.ClassNotFoundException: Could not load requested class : neoemf_experimental
   at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:367)
   at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274)
   at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
   at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:161)


Which I assume means that hibernate can not locate my datastore implementation.

My hibernate.properties looks like this:
Code:
hibernate.ogm.datastore.provider=neoemf_experimental


But I am guessing I am missing a pice of glue to tie this to my NeoEmf class:
Code:
public class NeoEmf implements DatastoreConfiguration<GlobalContext<?, ?>> {

   /**
    * Short name of this data store provider.
    *
    * @see OgmProperties#DATASTORE_PROVIDER
    */
   public static final String DATASTORE_PROVIDER_NAME = "NEOEMF_EXPERIMENTAL";

   @Override
   public GlobalContext<?, ?> getConfigurationBuilder(ConfigurationContext context) {
      return GenericOptionModel.createGlobalContext( context );
   }
}


Any pointers are welcome.


Top
 Profile  
 
 Post subject: Re: Registering a new DataStore provider
PostPosted: Thu Apr 06, 2017 7:14 am 
Hibernate Team
Hibernate Team

Joined: Fri Sep 09, 2011 3:18 am
Posts: 295
Hi,
the short name approach only works for the datastores included in `org.hibernate.ogm.datastore.imp.DatastoreProviderType`.
At the moment, I'm afraid you need to use the class name for the datastore porvider you want to add.

Something like
Code:
org.hibernate.ogm.datastore.mongodb.impl.MongoDBDatastoreProvider
.

Davide


Top
 Profile  
 
 Post subject: Re: Registering a new DataStore provider
PostPosted: Fri Apr 07, 2017 5:18 am 
Newbie

Joined: Mon Apr 03, 2017 6:04 am
Posts: 4
Hi,
Thaks for the information. Used the qualified name and it worked.

Cheers,

Horacio


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.