title: How to make method in crudRepository to find any elements using list ids?
body: <p>There is application on Spring + jpa + jpa Crud repository + hibernate-envers</p>
  
  <p>So, I have a table UserRecord with any fields</p>
  
  <pre><code>        Table UserRecord
  id   name  surname  age version
  
         Table UserRecord_AUD
  id   name  surname  age version REV REVINFO
  </code></pre>
  
  <p>So, when I add new user it writes into UserRecord table.
  If I change age, and try to write, new version of user writes into UserRecord and old version of user moves into UserRecord_AUD table with same id.</p>
  
  <p>all saved entoties have own records in UserRecord_AUD</p>
  
  <p>My task is get all enities from UserRecord_AUD by id's list.</p>
  
  <p>Example</p>
  
  <pre><code>===============================
      Table UserRecord
    11-1  Ivan      Ivanov  23 2
    22-2  Natasha   Ivanova 22 1
  ===============================
      Table UsersRecord_AUD
    11-1  Ivan      Ivanov  9  0
    11-1  Ivan      Ivanov  9  1
    22-2  Natasha   Ivanova 22 0
  ===============================
  </code></pre>
  
  <p>I have repository:</p>
  
  <pre><code>@Repository
  public interface UserRepository extends CrudRepository&lt;UserRecord, String&gt; 
  {}
  </code></pre>
  
  <p>I need in custom method, wich can find all users from table UserRecord_AUD by id -list</p>
  
  <p>instead call any times</p>
  
  <pre><code>repository.find(id);
  </code></pre>
  
  <p>I need to call</p>
  
  <pre><code>repository.find(ids);
  </code></pre>
  
  <p>How to make that:</p>
  
  <p>I tried to:</p>
  
  <pre><code>@Query(value = "select id, name, surname, age, REV as VERSION, IDCALC from USERRECORD_AUD where PR_KEY in (:ids)", nativeQuery = true)
  List&lt;UserRecord&gt; findHistoryByIds(List&lt;String&gt; ids);
  </code></pre>
  
  <p>But there is exception</p>
  
  <blockquote>
    <p>Name for parameter binding must not be null or empty! On JDKs &lt; 8, you
    need to use @Param for named parameters, on JDK 8 or better, be sure
    to compile with -parameters.; nested exception is
    java.lang.IllegalArgumentException: Name for parameter binding must
    not be null or empty! On JDKs &lt; 8, you need to use @Param for named
    parameters, on JDK 8 or better, be sure to compile with -parameters.</p>
  </blockquote>
  
  <p>My JPA entity is</p>
  
  <pre><code>@Entity
  @Audited
  @Table(name = "UserRecord")
  @NoArgsConstructor(access = AccessLevel.PUBLIC)
  @AllArgsConstructor
  @Getter
  @Setter
  @Access(AccessType.FIELD)
  public class UserRecord {
      @Id
      @GeneratedValue(generator = "uuid")
      @GenericGenerator(name = "uuid", strategy = "uuid2")
      @Column(name = "id")
      private String id;
  
      @Column(name = "name", length = 100, unique = false)
      private String name;
  
      @Column(name = "surname", length = 100, nullable = false)
      private String surname;
  
  
      @Column(name = "age", length = 100, nullable = false)
      private String age;
  
      @Version
      private int version;
  </code></pre>