Uploaded image for project: 'Spring Data GemFire'
  1. Spring Data GemFire
  2. SGF-392

Add support for OQL Query statement extensions in Repository Query methods via Annotations.

    XMLWordPrintable

Details

    Description

      Currently, a developer must use the GemFire's System property...

      -Dgemfire.Query.VERBOSE=true
      

      To debug an OQL Query statement generated from Spring Data GemFire's Repository support and OQL-based Query methods based on the standard naming conventions.

      Unfortunately, the GemFire System property is an all or nothing option to turn debugging on for all application OQL Query statements when a developer may only need, or want to debug a single or specific OQL Queries.

      Using straight OQL syntax, a developer would just need to specify a <TRACE> statement in an individual OQL Query to debug it, like so...

      <trace> SELECT * FROM /Users u WHERE u.name = $1
      

      However, using the corresponding Repository Query method, the standard naming conventions limit the use of available keywords...

      User findByName(String username);
      

      This improvement would add support for OQL statement extensions, like <TRACE>, and other keywords (e.g. IMPORT, LIMIT) via annotations, e.g. ...

      @Trace
      @Limit(10)
      @Import("example.app.domain.User")
      User findByNameLike(String username);
      

      Resulting in the following, generated OQL Query...

      IMPORT example.app.domain.User;
      SELECT * FROM /Users u WHERE u.name LIKE '$1' LIMIT 10
      

      Currently, the only way to do the later would be to use the @Query annotation...

      @Query("IMPORT example.app.domain.User; SELECT * FROM /Users u WHERE u.name LIKE '$1' LIMIT 10")
      User findByName(String username);
      

      Attachments

        Activity

          People

            jblum John Blum
            jblum John Blum
            Trevor Marshall Trevor Marshall
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 10d
                10d
                Remaining:
                Remaining Estimate - 10d
                10d
                Logged:
                Time Spent - Not Specified
                Not Specified