Announcement Announcement Module
No announcement yet.
Big problem MongoDb and QuerysDSL Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Big problem MongoDb and QuerysDSL

    We are using the last builds from the repositorys with QueryDSL 2.5

    We have a POJO as Mongo entity with a String as id property.

    The problem is that when we insert the entity with the id property not set, mongodb autogenerate an ObjectId on the property "_id". When we try to query on that property with Querydsl we have to use a String o List<String>

    example :

    List<String> list = new ArrayList<String>();
    Iterable<Course> result  =  courseContentDao.findAll(;
    The id "4faa47ab3a9b9ee0910fe19d" exists in MongoDb but the result is always empty because MongoDb has ObjectId as id.

    We can not use List<ObjectId> because Querydsl expects List<? extends String> as parameter.

    Any solution for this???

    Thanks a lot