Uploaded image for project: 'Spring Data JPA'
  1. Spring Data JPA
  2. DATAJPA-1303

Supports findByFieldIgnoreCaseIn(Collection<> fieldValues)

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 2.2 RC2 (Moore)
    • Component/s: None
    • Labels:
      None
    • Environment:
      Spring Data JPA 2.0.5.RELEASE

      Description

      We have some user entity:

      public class User {
      
        @Id
        @GeneratedValue
        private Long id;
      
        private String name;
      }
      

      We have unique index for column "name" based on upper function:

      CREATE UNIQUE INDEX user_name_unique_idx ON user (UPPER(name));
      

      We have repository with methods that finding users by name using index:

      public interface UserRepository extends JpaRepository<User, Long> {
      
        findOneByNameIgnoreCase(String name);
      
        findAllByNameIgnoreCaseIn(Collection<String> names);
      }
      

      Method findOneByNameIgnoreCase calls:

      SELECT *
      FROM user
      WHERE upper(name) = upper(?);
      

      But method findAllByNameIgnoreCaseIn calls:

      SELECT *
      FROM user
      WHERE name IN (?, ?, ...);
      

        Attachments

          Activity

            People

            Assignee:
            schauder Jens Schauder
            Reporter:
            krupt Kovalev Andrey
            Last updater:
            Mark Paluch
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: