Uploaded image for project: 'DeltaSpike'
  1. DeltaSpike
  2. DELTASPIKE-1222

Allow query by example method expression wtih @Query annotation

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Data-Module

    Description

      ability to either override findBy/findAll methods with @Query annotation (without using params or using params, but also allowing the E example pattern) or add support for custom method expression that could be used for this purpose. the E example would only appy to the main Entity restrictions, the additional params could apply to nested entities based on param index

      ie. @Query(value = "select r from Range r where r.customId IN (select e.customId from EbsUserStub e)")
      public abstract List<Range> findBy(Range paramE, SingularAttribute<Range, ?> paramArrayOfSingularAttribute);

      or

      @Query(value = "select r from Range r where r.customId IN (select e.customId from EbsUserStub e)")
      public abstract List<Range> findUsing(Range paramE, SingularAttribute<Range, ?> paramArrayOfSingularAttribute);

      or

      @Query(value = "select r from Range r where r.customId IN (select e.customId from EbsUserStub e where e.miscField = ?2)")
      public abstract List<Range> findByMiscField(Range paramE, SingularAttribute<Range, ?> paramArrayOfSingularAttribute, String miscField);

      method expression could either be custom ie. findUsing, findByEntityName, findByMiscField or some other marker.

      Attachments

        Activity

          People

            Unassigned Unassigned
            richardjusko Richard Juso
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: