title: Error in JPA mapping - Fetch Comments
body: <p>I'm trying to fetch comments using the ticket field as a foreign key but I'm getting the following errors:</p>
  
  <pre><code>Caused by: Exception [EclipseLink-6078] (Eclipse Persistence Services - 2.0.1.v20100213-r6600): org.eclipse.persistence.exceptions.QueryException
  Exception Description: The class of the argument for the object comparison is incorrect.         
  
  Expression: [
  Base com.test.forum.model.Comment] 
  Mapping: [org.eclipse.persistence.mappings.OneToOneMapping[ticket]] 
  Argument: [751]
  </code></pre>
  
  <p>This is the code i'm using in my javabean:
  - Hide quoted text -</p>
  
  <pre><code>  @JoinColumn(name = "ticket", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Ticket ticket;
  
  
      public List&lt;Comment&gt; findComment(int id) {
        Query q = em.createQuery("SELECT c FROM Comment c WHERE c.ticket = 751");
        return q.getResultList();
      }
  </code></pre>
  
  <p>Thanks </p>