title: SQLGrammarException: ORA-00904 ("invalid identifier")
body: <p>I'm getting an Oracle error / <code>org.hibernate.exception.SQLGrammarException</code> when I run a JUnit test against a Java class which uses JPA and Spring:</p>
  
  <pre><code>ORA-00904: "ALIAS"."COLUMN_NAME": invalid identifier
  </code></pre>
  
  <p>The odd thing is that the JUnit test works when run against a development database but fails when run against a database which I use for Continuous Integration builds (they are both Oracle databases).</p>
  
  <p>Therefore, this would suggest that there's something missing or awry in the latter d/b. However, I have double- (and triple-)checked that the table referred to is identical in both databases and contains the column COLUMN_NAME that the error is referring to.</p>
  
  <p>Further information - the DAO Java class invoked in the JUnit test uses a javax.persistence.EntityManager:</p>
  
  <pre><code>MyClass myObject = entityManager.find(MyClass.class, idNumber);
  </code></pre>
  
  <p>The MyClass JPA entity class maps onto the Oracle table:</p>
  
  <pre><code>@Configurable
  @Entity
  @Table(name = "MyTable", schema = "MySchema")
  public class MyClass implements Serializable {
      @Id
      @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "MY_SEQ")
      @SequenceGenerator(name = "MY_SEQ", sequenceName = "MY_SEQ", allocationSize = 1)
      @Column(name = "ID")
      protected BigDecimal id;
  
      @Column(name = "COLUMN_NAME")
      private String columnName;
      ...
  }
  </code></pre>
  
  <p>The column COLUMN_NAME in the database table in both databases is VARCHAR2(50) and nullable.</p>
  
  <p>Versions:</p>
  
  <p>Java - 1.6</p>
  
  <p>Spring - 3.1.1</p>
  
  <p>Oracle - 11.2.0.3.0</p>
  
  <p>Thanks in advance for any assistance.</p>