title: Can a List<> be cast to a DataModel
body: <p>I'm trying to do the following:</p>
  
  <pre><code>public String createByMarcas() {
      items = (DataModel) ejbFacade.findByMarcas(current.getIdMarca().getId());
      updateCurrentItem();
      return "List";
  }
  
  public List&lt;Modelos&gt; findByMarcas(int idMarca){
      return em.createQuery("SELECT id, descripcion FROM Modelos WHERE id_marca ="+idMarca+"").getResultList();
  }
  </code></pre>
  
  <p>But I keep getting this expection:</p>
  
  <pre><code>Caused by: javax.ejb.EJBException
   at com.sun.ejb.containers.BaseContainer.processSystemException(BaseContainer.java:5070)
   at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:4968)
   at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:4756)
   at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1955)
   at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1906)
   at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:198)
   at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:84)
   at $Proxy347.findByMarcas(Unknown Source)
   at controladores.__EJB31_Generated__ModelosFacade__Intf____Bean__.findByMarcas(Unknown Source)
  </code></pre>
  
  <p>Can anyone give a hand please?
  Thank you very much</p>