title: Variable 'this.userInfo' is unbound and cannot be determined
body: <p>I am developing a maven JDO project, but I am getting this error when I am trying to make relation between two tables (user_login, user_role)</p>
  
  <p>User_Login: user_id(primary key), user_name, user_password,user_role_id</p>
  
  <p>User_Role: id(primary key), role</p>
  
  <p><strong>user_role_id is same as id of user_role table</strong></p>
  
  <p>User.java:</p>
  
  <pre><code>@PersistenceCapable(table = "user_login")
  public class User {  
  @PrimaryKey
  @Column(name="user_id")
  private Integer userId=0;
  @Column(name="user_profile_name")
  private String userProfileName=null; 
  @Column(name="user_email")
  private String userEmail=null;
  @Column(name="user_contact")
  private String userContact=null;
  @Column(name="user_name")
  private String userName=null;
  @Column(name="user_password")
  private String userPassword=null;
  @ManyToOne
  @Column(name="user_role_id")   
  private Integer userRoleId=0;
  </code></pre>
  
  <p>Role.java:</p>
  
  <pre><code>@PersistenceCapable(table = "user_role")
  public class Role {
  @PrimaryKey
  @Column(name="id")
  private Integer id=0;
  @Column(name="role")
  private String role=null;   
  
  @OneToMany
  private User userInfo=null;
  </code></pre>
  
  <p>DAOImpol:</p>
  
  <pre><code>public List&lt;Role&gt; getUser(String username, String userpassword) {
      PersistenceManager pm = this.pmf.getPersistenceManager();
      Transaction tx = pm.currentTransaction();
      JDOPersistenceManager jdopm = (JDOPersistenceManager)pm;       
      try {
      // Start the transaction
      tx.begin(); 
  
      TypesafeQuery&lt;User&gt; tq = jdopm.newTypesafeQuery(User.class);
      //QUser user = QUser.candidate();
      QRole role = QRole.candidate();
      QUser userInfo=role.userInfo;
      List&lt;Role&gt; result = tq.filter(userInfo.userName.eq(username).and(userInfo.userPassword.eq(userpassword))).executeList();
  
      //result = tq.executeResultList(true, user.userId);
  
      if(result.size()&gt;0){
          log.info("&gt;&gt;&gt;&gt;&gt;00000000"+"    "+result.get(0).getUser().getUserEmail());
          log.info("&gt;&gt;&gt;&gt;&gt;11111111"+"    "+result.get(0).getRoleId()+"    "+result.get(0).getRole());
      }else{
          log.info("&lt;&lt;&lt;&lt;&lt;&lt;&lt;=====000000");
      }
      // Commit the transaction, flushing the object to the datastore
      tx.commit();
      return result;
      }
      finally {
          if (tx.isActive())
          {
              // Error occurred so rollback the transaction
              tx.rollback();
          }
          pm.close();
      } 
  </code></pre>
  
  <p>I am getting this error:</p>
  
  <pre><code>javax.jdo.JDOUserException: Variable 'this.userInfo' is unbound and 
  cannot be determined (is it a misspelled field name? or is not intended
  to be a variable?)
  NestedThrowables:
  org.datanucleus.exceptions.NucleusUserException: Variable 
  'this.userInfo' is unbound and cannot be determined (is it a   
  misspelled   
  field name? or is not intended to be a variable?)
  </code></pre>