title: Adding interface with existing method signature that is annotated with JPA breaks Eclipselink
body: <p>For a long time, I had the following classes with persistence use JPA and Eclipselink as persistence provider, which were persisted and queried sucessfully.</p>
  
  <p>ProductKeyImpl:</p>
  
  <pre><code>@Entity
  @Table(name = "PRODUCT_KEY")
  @Access(PROPERTY)
  public class ProductKeyImpl implements ProductKey {
      ...
  }
  </code></pre>
  
  <p>derived class SomeProductKeyImpl:</p>
  
  <pre><code>@Entity
  public class SomeProductKeyImpl
      extends ProductKeyImpl
      implements SomeProductKey {
      private String accoStockCode = null;
      ....
      @Column(name = "KEY_3")
      public String getAccoStockCode() {
          return this.accoStockCode;
      }
  }
  </code></pre>
  
  <p>implementing the interface SomeProductKey:</p>
  
  <pre><code>public interface SomeProductKey extends ProductKey {
      String getAccoStockCode();
  }
  </code></pre>
  
  <p>During a refactoring the method <code>getAccoStockCode()</code> was moved to a new interface <code>HasAccoStockCode</code> which is implemented by <code>SomeProductKey</code>:</p>
  
  <pre><code>public interface HasAccoStockCode {
      String getAccoStockCode();
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>public interface SomeProductKey extends ProductKey, HasAccoStockCode {
      // getAccoStockCode() removed
  }
  </code></pre>
  
  <p>Since this change, queries are failing, because apparently Eclipselink does not only add the annotated mapping for accoStockCode to KEY_3 to the SQL, but a default mapping for the getAccoStockCode method from the HasAccoStockCode as well:</p>
  
  <pre><code>Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.6.1.v20150916-55dc7c3): org.eclipse.persistence.exceptions.DatabaseException
  Internal Exception: java.sql.SQLSyntaxErrorException: ORA-00904: "ACCOSTOCKCODE": ungültiger Bezeichner
  
  Error Code: 904
  Call: SELECT ..., ACCOSTOCKCODE, KEY_3 ... FROM PRODUCT_KEY WHERE (ID = ?)
  </code></pre>
  
  <p>The correct select statement should not include ACCOSTOCKCODE, because the property is mapped to KEY_3</p>
  
  <p>I see the same behaviour with Eclipselink 2.4.2 as well. In case it matters, the code is running on Weblogic 12.1.2 on Java 7.</p>
  
  <p>Any ideas what I can do besides reverting the refactoring?</p>
  
  <p>Edit after @Chris question:
  If I remove getAccoStockCode() from the interfaces, the same error still occurs (unexpectedly to me...). 
  You're question lead me to another testcase. The JPQL</p>
  
  <pre><code>SELECT a FROM SomeProductKeyImpl a WHERE a.oid = :id
  </code></pre>
  
  <p>is executed just fine with the SQL</p>
  
  <pre><code>SELECT ID, PRODUCT_KEY_SUBCLASS_CODE, TIME_STAMP, KEY_3, KEY_4, KEY_2, KEY_1 FROM VRPBOOKING.PRODUCT_KEY WHERE ((ID = ?) AND (PRODUCT_KEY_SUBCLASS_CODE = ?))
  bind =&gt; [123, SPK]
  </code></pre>
  
  <p>If I query the superclass with the JPQL</p>
  
  <pre><code>SELECT a FROM ProductKeyImpl a WHERE a.oid = :id
  </code></pre>
  
  <p>the generated SQL is</p>
  
  <pre><code>SELECT ID, PRODUCT_KEY_SUBCLASS_CODE, TIME_STAMP, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, ACCOSTOCKCODE FROM VRPBOOKING.PRODUCT_KEY WHERE (ID = ?)
  bind =&gt; [123]
  </code></pre>
  
  <p>and fails.</p>