Announcement Announcement Module
Collapse
No announcement yet.
Spring Data Documents: Building typesafe queries / QueryDSL? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Data Documents: Building typesafe queries / QueryDSL?

    Hello everyone

    I'm currently using mongoTemplate with queries like this one:
    Code:
    Query q= new Query(where("parentId").is(parentId).and("dateTime").gte(start).lt(end));
    I'd really like to have a safe way to create such queries, without having to use strings to identify properties (like "dateTime"). I saw that querydsl allows to generate "query types" of annotated entities to avoid such string magic.

    Are there similar concepts within spring-data-document? Or is there a way to use the query types or even the queries of querydsl with mongoTemplate?



    Best regards,
    James

  • #2
    Currently Querydsl is supported on the repository level only. See [0] for documentation.

    [0] http://static.springsource.org/sprin.../html/#d0e3105

    Comment


    • #3
      Thank you. I'll try it out.

      Comment


      • #4
        QueryDSL non repository

        Hey All

        Is the QueryDSL still only avaible via the repository if so. What class should I start with to build it up to using in a standard DAO which uses a mongoTemplate?

        Thanks

        Comment

        Working...
        X