Results 1 to 4 of 4

Thread: Spring Data Documents: Building typesafe queries / QueryDSL?

  1. #1
    Join Date
    Oct 2006
    Location
    Zürich
    Posts
    101

    Default 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. #2
    Join Date
    Apr 2006
    Location
    Dresden, Germany
    Posts
    483

    Default

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

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

  3. #3
    Join Date
    Oct 2006
    Location
    Zürich
    Posts
    101

    Default

    Thank you. I'll try it out.

  4. #4
    Join Date
    Nov 2006
    Posts
    8

    Default 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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •