0

我是 kundera mongoDb 的新手,我的问题是当我尝试使用本机查询获取数据时出现以下错误

  Exception in thread "main" com.impetus.kundera.query.QueryHandlerException: java.lang.UnsupportedOperationException: Native query support is not enabled in mongoDB
    at com.impetus.client.mongodb.query.MongoDBQuery.populateEntities(MongoDBQuery.java:172)
    at com.impetus.kundera.query.QueryImpl.fetch(QueryImpl.java:986)
    at com.impetus.kundera.query.QueryImpl.getResultList(QueryImpl.java:163)
    at com.test.Test2.main(Test2.java:80)

我的代码如下

EntityManagerFactory emf = Persistence
            .createEntityManagerFactory("mango");
    EntityManager em = emf.createEntityManager();

    Query query = em.createNativeQuery("db.resturant.find({contact: {\"$elemMatch\" :  {\"Mobile\" : \"9568256549\"}}})");

query.getResultList();

帮我...

4

1 回答 1

0

查看这些链接: https ://github.com/impetus-opensource/Kundera/issues/212 https://github.com/impetus-opensource/Kundera/issues/248

HTH,-维维克

于 2014-12-30T10:36:58.537 回答