Note that there are some explanatory texts on larger screens.

plurals
  1. POProperty 'xxx' not found on type org.hibernate.collection.PersistentSet Hibernate
    text
    copied!<p>Hibernate learn hibernate is a hard work! this error show me hibernate:</p> <pre><code> javax.el.PropertyNotFoundException: Property 'usuarioPersonal' not found on type org.hibernate.collection.PersistentSet </code></pre> <p>when across the view I trying to acces to property.</p> <p>I have this relation: 1 proyect has N users (only 1 user can be responsable) and N Users 1 data information(name,lastname,email).</p> <p><img src="https://i.stack.imgur.com/ekWGq.png" alt="enter image description here"></p> <p>I´m use myeclipse and this generated my hbm and pojo, I´m review this information and to me it's ok.</p> <p>Project DTO</p> <pre><code> public class Proyecto implements java.io.Serializable { // Fields private Integer idproyecto; private String nombre; private Integer creadoPor; private Timestamp inicia; private Timestamp finaliza; private Timestamp fecha; private Integer estatus; private Set tareas = new HashSet(0); private Set usrProyectos = new HashSet(0); </code></pre> <p>UsrProyectoDTO</p> <pre><code> public class UsrProyecto implements java.io.Serializable { // Fields private Integer idproyecto; private UsuarioPersonal usuarioPersonal; private Proyecto proyecto; private Short estatus; private Integer responsable; </code></pre> <p>UsuarioPersona DTO</p> <pre><code> public class UsuarioPersonal implements java.io.Serializable { // Fields private Integer idusuarioPersonales; private CtgPuesto ctgPuesto; private String nombre; private String paterno; private String materno; private Timestamp fecha; private Set usrProyectos = new HashSet(0); </code></pre> <p>Proyecto.hbm.xml</p> <pre><code>&lt;class name="com.bsd.projects.capadatos.dto.Proyecto" table="proyecto" catalog="bsd_proyectos"&gt; &lt;id name="idproyecto" type="java.lang.Integer"&gt; &lt;column name="idproyecto" /&gt; &lt;generator class="identity" /&gt; &lt;/id&gt; &lt;property name="nombre" type="java.lang.String"&gt; &lt;column name="nombre" length="45" /&gt; &lt;/property&gt; &lt;property name="creadoPor" type="java.lang.Integer"&gt; &lt;column name="creado_por" /&gt; &lt;/property&gt; &lt;property name="inicia" type="java.sql.Timestamp"&gt; &lt;column name="inicia" length="0" /&gt; &lt;/property&gt; &lt;property name="finaliza" type="java.sql.Timestamp"&gt; &lt;column name="finaliza" length="0" /&gt; &lt;/property&gt; &lt;property name="fecha" type="java.sql.Timestamp"&gt; &lt;column name="fecha" length="0" /&gt; &lt;/property&gt; &lt;set name="tareas" inverse="true"&gt; &lt;key&gt; &lt;column name="proyecto_id" not-null="true" /&gt; &lt;/key&gt; &lt;one-to-many class="com.bsd.projects.capadatos.dto.Tarea" /&gt; &lt;/set&gt; &lt;set name="usrProyectos" inverse="true"&gt; &lt;key&gt; &lt;column name="proyecto_id" not-null="true" /&gt; &lt;/key&gt; &lt;one-to-many class="com.bsd.projects.capadatos.dto.UsrProyecto" /&gt; &lt;/set&gt; &lt;property name="estatus" type="java.lang.Integer"&gt; &lt;column name="estatus" /&gt; &lt;/property&gt; &lt;/class&gt; </code></pre> <p>UsrProyecto.hbm.xml</p> <pre><code>&lt;class name="com.bsd.projects.capadatos.dto.UsrProyecto" table="usr_proyecto" catalog="bsd_proyectos"&gt; &lt;id name="idproyecto" type="java.lang.Integer"&gt; &lt;column name="idproyecto" /&gt; &lt;generator class="identity" /&gt; &lt;/id&gt; &lt;many-to-one name="usuarioPersonal" class="com.bsd.projects.capadatos.dto.UsuarioPersonal" fetch="select"&gt; &lt;column name="usaurio_personal_id" not-null="true" /&gt; &lt;/many-to-one&gt; &lt;many-to-one name="proyecto" class="com.bsd.projects.capadatos.dto.Proyecto" fetch="select"&gt; &lt;column name="proyecto_id" not-null="true" /&gt; &lt;/many-to-one&gt; &lt;property name="estatus" type="java.lang.Short"&gt; &lt;column name="estatus" /&gt; &lt;/property&gt; &lt;property name="responsable" type="java.lang.Integer"&gt; &lt;column name="responsable" /&gt; &lt;/property&gt; &lt;/class&gt; </code></pre> <p>UsuarioPersonal.hbm.xml</p> <pre><code>&lt;class name="com.bsd.projects.capadatos.dto.UsuarioPersonal" table="usuario_personal" catalog="bsd_proyectos"&gt; &lt;id name="idusuarioPersonales" type="java.lang.Integer"&gt; &lt;column name="idusuario_personales" /&gt; &lt;generator class="identity" /&gt; &lt;/id&gt; &lt;many-to-one name="ctgPuesto" class="com.bsd.projects.capadatos.dto.CtgPuesto" fetch="select"&gt; &lt;column name="ctg_puesto_id" not-null="true" /&gt; &lt;/many-to-one&gt; &lt;property name="nombre" type="java.lang.String"&gt; &lt;column name="nombre" length="45" /&gt; &lt;/property&gt; &lt;property name="paterno" type="java.lang.String"&gt; &lt;column name="paterno" length="45" /&gt; &lt;/property&gt; &lt;property name="materno" type="java.lang.String"&gt; &lt;column name="materno" length="45" /&gt; &lt;/property&gt; &lt;property name="fecha" type="java.sql.Timestamp"&gt; &lt;column name="fecha" length="0" /&gt; &lt;/property&gt; &lt;set name="usrProyectos" inverse="true"&gt; &lt;key&gt; &lt;column name="usaurio_personal_id" not-null="true" /&gt; &lt;/key&gt; &lt;one-to-many class="com.bsd.projects.capadatos.dto.UsrProyecto" /&gt; &lt;/set&gt; &lt;/class&gt; </code></pre> <p>ProyectoDAO</p> <pre><code>public Proyecto findById(java.lang.Integer id) { log.debug("getting Proyecto instance with id: " + id); try { Proyecto instance = (Proyecto) getSession().get( "com.bsd.projects.capadatos.dto.Proyecto", id); return instance; } catch (RuntimeException re) { log.error("get failed", re); throw re; } } </code></pre> <p>When I return my object to view</p> <pre><code> request.setAttribute("detalleProyecto",proyecto); </code></pre> <p>and in detailproyect.jsp try access to "idusuarioPersonales" </p> <pre><code>&lt;td&gt;Id Personal:&lt;/td&gt;&lt;td&gt; &lt;input type="text" value="${detalleProyecto.usrProyectos.usuarioPersonal.idusuarioPersonales}" /&gt; </code></pre> <p>Why can´t I´m access to this property? If the map associate 3 class</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload