title: JPA - inheriting classes with same field name cause exception in save
body: <p>We have a base class - Base, with 3 inheriting classes - ChildA, ChildB, ChildC.
  All the classes are jpa entities, using a discrimination column.</p>
  
  <p>Both ChildA and ChildB have a field with the same name, and ChildC doesn't:</p>
  
  <p><code>private Long longField;</code> (It's nullable)</p>
  
  <p>So when we try to save to the DB an ChildA instance:</p>
  
  <p><code>this.childARepository.save(new ChildA(...));</code></p>
  
  <p>We get the following exception:</p>
  
  <pre><code>Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'longField' in 'field list'
  </code></pre>
  
  <p>We can think of few workarounds, but non of them is very good in this case:</p>
  
  <p>1) Put <code>longField</code> in Base - doesn't make sense, because ChildC doesn't need it.</p>
  
  <p>2) Create another Base class for ChildA &amp; ChildB - doesn't make sense from an abstraction perspective.</p>
  
  <p>3) Give a different name in ChildA &amp; ChildB - Tried it and it works, but we would prefer not to that because it has the same meaning...</p>
  
  <p>Is there another solution to this issue? Maybe something we're missing?
  Thanks!</p>