title: Spring Boot JPA - Find By Composite Unique Columns
body: <p>I have created the following table :</p>
  
  <pre><code>CREATE TABLE public."TB_KEY"
  (
      "ID" integer NOT NULL DEFAULT nextval('"TB_KEY_seq"'::regclass),
      "UNIQUE_ID" character varying COLLATE pg_catalog."default",
      "VERSION" character varying COLLATE pg_catalog."default",
      "ATTRIBUTE_NAME" character varying COLLATE pg_catalog."default",
      CONSTRAINT "MDD_KEY_pkey" PRIMARY KEY ("ID"),
      CONSTRAINT "MDD_KEY_unique" UNIQUE ("UNIQUE_MDD_ID", "VERSION")
  )
  </code></pre>
  
  <p>I created the following entity class</p>
  
  <pre><code>@Entity
  @Table(name = "\"TB_KEY\"")
  public class Key {
  
      private int id;
      private String uniqueId;
      private String version;
      private String attributeName;
  
      @Id
      @SequenceGenerator(allocationSize = 1, initialValue = 1, sequenceName = "\"TB_KEY_seq\"", name = "key_id_seq")
      @GeneratedValue(generator = "key_id_seq", strategy = GenerationType.SEQUENCE)
      @Column(name = "\"ID\"", unique = true, nullable = false)
      public int getId() {
          return id;
      }
      public void setId(int id) {
          this.id = id;
      }
  
      @Column(name = "\"UNIQUE_ID\"")
      public String getUniqueMDDId() {
          return uniqueId;
      }
      public void setUniqueMDDId(String uniqueMDDId) {
          this.uniqueId = uniqueId;
      }
  
      @Column(name = "\"VERSION\"")
      public String getVersion() {
          return version;
      }
      public void setVersion(String version) {
          this.version = version;
      }
  
      @Column(name = "\"ATTRIBUTE_NAME\"")
      public String getAttributeName() {
          return attributeName;
      }
      public void setAttributeName(String attributeName) {
          this.attributeName = attributeName;
      }
  
  }
  </code></pre>
  
  <p>Using Spring JPA respository, I want to find by composite unique constarint columns without using native query
  (For ex : I want to find a row in Key entity by UniqueId and Version columns)</p>
  
  <p>How do I achieve using findBy method?</p>