-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Problem with mapping
PostPosted: Thu Jun 30, 2005 8:26 am 
Beginner
Beginner

Joined: Wed May 18, 2005 9:48 am
Posts: 31
Hi all,

I have problems with this mapping. I want to know what's wrong

Error Code:
Code:
Caused by: org.hibernate.PropertyNotFoundException: Could not find a setter for property Permisos in class bbdd.modelos.tPerfiles
        at org.hibernate.property.BasicPropertyAccessor.createSetter(BasicPropertyAccessor.java:156)
        at org.hibernate.property.BasicPropertyAccessor.getSetter(BasicPropertyAccessor.java:150)
        at org.hibernate.mapping.Property.getSetter(Property.java:245)
        at org.hibernate.tuple.PojoTuplizer.buildPropertySetter(PojoTuplizer.java:241)
        at org.hibernate.tuple.AbstractTuplizer.<init>(AbstractTuplizer.java:74)
        at org.hibernate.tuple.PojoTuplizer.<init>(PojoTuplizer.java:54)
        at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:47)
        at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:217)
        at org.hibernate.persister.entity.BasicEntityPersister.<init>(BasicEntityPersister.java:400)
        at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:104)
        at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
        at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:210)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1055)


tPerfiles.java

Code:
package bbdd.modelos;

import java.io.Serializable;
import bbdd.modelos.tPermisos;

/**
*
* @author Administrador
*/
public class tPerfiles implements Serializable{
   
     private int iId_Perfil = 0;
     private int iId_Permiso = 0;
     private String sCentro = null;
     private String sDescripcion = null;
     private tPermisos oPermisos = null;
   
    /** Creates a new instance of tPerfiles */
    public tPerfiles() {
    }
   
    public tPerfiles(int iId_Perfil, int iId_Permiso, String sCentro, String sDescripcion, tPermisos oPermisos) {
        this.iId_Perfil = iId_Perfil;
        this.iId_Permiso = iId_Permiso;
        this.sCentro = sCentro;
        this.sDescripcion = sDescripcion;
        this.oPermisos = oPermisos;
    }
   
     public int getId_Perfil() { return iId_Perfil; }
     public int getId_Permiso() { return iId_Permiso; }
     public String getCentro() { return sCentro; }
     public String getDescripcion() { return sDescripcion; }
     public tPermisos getPermisos() { return oPermisos; }
     
     public void setId_Perfil(int iId_Perfil) { this.iId_Perfil = iId_Perfil; }
     public void setId_Permiso(int iId_Permiso) { this.iId_Permiso = iId_Permiso; }
     public void setCentro(String sCentro) { this.sCentro = sCentro; }
     public void setDescripcion(String sDescripcion) { this.sDescripcion = sDescripcion; }
     public void sePermisos(tPermisos oPermisos) { this.oPermisos = oPermisos; }
}


tPermisos.java

Code:
package bbdd.modelos;

import java.io.Serializable;
/**
*
* @author Administrador
*/
public class tPermisos implements Serializable {
   
    private int iId_Permiso = 0;
    private String sDes_Perm = null;
    private char cAcceso_Perm = 0;
   
    /** Creates a new instance of tPermisos */
    public tPermisos() {
    }
   
    public tPermisos(int iId_Permiso, String sDes_Perm, char cAcceso_Perm) {
        this.iId_Permiso = iId_Permiso;
        this.sDes_Perm = sDes_Perm;
        this.cAcceso_Perm = cAcceso_Perm;
    }
   
   
    public int getId_Permiso() { return iId_Permiso; }
    public String getDes_Perm() { return sDes_Perm; }
    public char getAcceso_Perm() { return cAcceso_Perm; }
   
    public void setId_Permiso(int iId_Permiso) { this.iId_Permiso = iId_Permiso; }
    public void setDes_Perm(String sDes_Perm) { this.sDes_Perm = sDes_Perm; }
    public void setAcceso_Perm(char cAcceso_Perm) { this.cAcceso_Perm = cAcceso_Perm; }
   
}


tPerfiles.hbm.xml

Code:
<hibernate-mapping package="bbdd.modelos">

<class name="tPerfiles" table="perfiles">
    <id name="Id_Perfil">
        <generator class="sequence">
            <param name="sequence">perfiles_id_perfil_seq</param>
        </generator>
    </id>
    <property name="Id_Permiso"/>
    <property name="Centro"/>
    <property name="Descripcion"/>
    <component name="Permisos" class="bbdd.modelos.tPermisos">
        <property name="Id_Permiso" column="id_permiso"/>
        <property name="Des_Perm" column="des_perm"/>
        <property name="Acceso_Perm" column="acceso_perm"/>
    </component>
</class>
</hibernate-mapping>


Thanks all.


Top
 Profile  
 
 Post subject: Re: Problem with mapping
PostPosted: Thu Jun 30, 2005 8:49 am 
Expert
Expert

Joined: Mon Feb 14, 2005 12:32 pm
Posts: 609
Location: Atlanta, GA - USA
ljpaff wrote:
Hi all,

I have problems with this mapping. I want to know what's wrong
Code:
package bbdd.modelos;

import java.io.Serializable;
import bbdd.modelos.tPermisos;

/**
*
* @author Administrador
*/
public class tPerfiles implements Serializable{
   
     private int iId_Perfil = 0;
     private int iId_Permiso = 0;
     private String sCentro = null;
     private String sDescripcion = null;
     private tPermisos oPermisos = null;
   
    /** Creates a new instance of tPerfiles */
    public tPerfiles() {
    }
   
    public tPerfiles(int iId_Perfil, int iId_Permiso, String sCentro, String sDescripcion, tPermisos oPermisos) {
        this.iId_Perfil = iId_Perfil;
        this.iId_Permiso = iId_Permiso;
        this.sCentro = sCentro;
        this.sDescripcion = sDescripcion;
        this.oPermisos = oPermisos;
    }
   
     public int getId_Perfil() { return iId_Perfil; }
     public int getId_Permiso() { return iId_Permiso; }
     public String getCentro() { return sCentro; }
     public String getDescripcion() { return sDescripcion; }
     public tPermisos getPermisos() { return oPermisos; }
     
     public void setId_Perfil(int iId_Perfil) { this.iId_Perfil = iId_Perfil; }
     public void setId_Permiso(int iId_Permiso) { this.iId_Permiso = iId_Permiso; }
     public void setCentro(String sCentro) { this.sCentro = sCentro; }
     public void setDescripcion(String sDescripcion) { this.sDescripcion = sDescripcion; }
     public void sePermisos(tPermisos oPermisos) { this.oPermisos = oPermisos; }
}


public void sePermisos(... should be setPermisos(...) the 't' is missing in the word set.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.