title: Primefaces selected row is null when variable is declared as Long
body: <p>I have the following in ManagedBean </p>
  
  <pre><code>private Employee selectedEmployee; // with getter and setter    
  
  public void onRowSelect(SelectEvent event) {
  
  System.out.println("selected employee "+selectedEmployee.getEmployeeNumber());
  
  }
  </code></pre>
  
  <p>My problem is in <code>Employee</code> Entity class if I make <code>employeeNumber</code> from <code>String</code> to <code>Long</code>, I am getting null for <code>selectedEmployee</code> in <code>onRowSelect</code> method of ManagedBean</p>
  
  <p><strong>Employee Entity</strong> class</p>
  
  <pre><code>private String employeeNumber; // this works  
  
  private Long employeeNumber; // this doesn't work
  </code></pre>
  
  <p>What could be the reason for this?</p>
  
  <p>JSF Code for selection</p>
  
  <pre><code>    &lt;p:dataTable id="dataTable" var="emp" lazy="true"
  value="#{myMB.lazyModel}" styleClass="userDataTableStyle"
  paginator="true" paginatorPosition="bottom" rows="5"
  selection="#{myMB.selectedEmployee}"&gt;
  
      &lt;p:ajax event="rowSelectRadio" listener="#{myMB.onRowSelect}"
  update=":myform:details" /&gt;
  </code></pre>