title: Why does using a column name directly in HQL only work sometimes?
body: <p>I have two HQL queries I am using for a quick-and-dirty unit test. The first looks somewhat like this:</p>
  
  <pre><code>from Foo where SOME_FOREIGN_KEY = 42
  </code></pre>
  
  <p>The second looks like this:</p>
  
  <pre><code>from Foo as foo
   inner join foo.Bar as bar
   where foo.SOME_FOREIGN_KEY = 42
  </code></pre>
  
  <p>The SOME_FOREIGN_KEY column is not the name of something that Hibernate knows is mapped.</p>
  
  <p>For some reason, the first HQL query works, but the second one does not.</p>
  
  <p>My goal here is to get the second version to work, without traversing the object graph to the object identified by the foreign key. For this test, I have a known ID and I only want the objects related to that ID. The object itself on the other end of the relationship is irrelevant. Is this possible?</p>