I am trying to fetch all the data from a single collection in MongoDB using Hibernate OGM transaction type RESOURCE_LOCAL as follows : Persistence.xml
<persistence-unit name="NOSQLPU" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ogm.jpa.HibernateOgmPersistence</provider>
<class>jpa.nosql.entity.Customer</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<property name="hibernate.ogm.datastore.provider" value="org.hibernate.ogm.datastore.mongodb.impl.MongoDBDatastoreProvider"/>
<property name="hibernate.ogm.mongodb.host" value="127.0.0.1"/>
<property name="hibernate.ogm.mongodb.port" value="27017"/>
<property name="hibernate.ogm.mongodb.database" value="test"/>
</properties>
</persistence-unit>
CustomerRepositoryImpl.java
public List<Customer> getAllCustomers() {
return em.createQuery( "SELECT c FROM Customer c", Customer.class ).getResultList();
}
But I am getting error as below :
org.hibernate.ogm.exception.NotSupportedException: OGM-14 - typed queries are not supported yet
How can I fetch all the data instead of finding single row by Id ?