|
To make the life of OGM starters easier, we could try and detect the datastore provider automatically, if only one is available. When e.g. adding the following dependencies to a project:
<dependency>
<groupId>org.hibernate.ogm</groupId>
<artifactId>hibernate-ogm-core</artifactId>
<version>4.1.0.Beta3</version>
<dependency>
<dependency>
<groupId>org.hibernate.ogm</groupId>
<artifactId>hibernate-ogm-neo4j</artifactId>
<version>4.1.0.Beta3</version>
<dependency>
Then I'd expect that Neo4j is used automatically by default, rather than Infinispan as it is the case today (in particular the resulting ClassNotFoundException for InfinispanDatastoreProvider is really confusing).
If more than one provider is available, it would have to be specified explicitly per PU which one is to be used (we could log a very descriptive error message in this case, including the names of the avaible providers).
Providers could be detected using the service loader pattern, which also would allow to get rid of that central enum AvailableDatastoreProviders in hibernate-ogm-core.
|