Hi!
I'm currently working in a project using JBoss 4 and Hibernate 3.1.3 (Tried also with Hibernate 3.2 with the same result)
I have a class named UsPerson that represents a table in a MySQL (5) database named us_person, the mapping for the class is:
--------------------------------------------
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!--
Mapping file autogenerated by MyEclipse - Hibernate Tools
-->
<hibernate-mapping>
<class name="com.nekotec.prepaid.model.UsPerson" table="us_person" catalog="pay_service">
<id name="personId" type="long" unsaved-value="0">
<column name="PERSON_ID" />
<generator class="native" />
</id>
<property name="identification" type="string">
<column name="IDENTIFICATION" length="13" not-null="true" />
</property>
<property name="name" type="string">
<column name="NAME" length="64" not-null="true" />
</property>
<property name="lastName" type="string">
<column name="LAST_NAME" length="64" not-null="true" />
</property>
<property name="address" type="string">
<column name="ADDRESS" length="64" not-null="true" />
</property>
<property name="telephone" type="string">
<column name="TELEPHONE" length="32" not-null="true" />
</property>
<property name="email" type="string">
<column name="EMAIL" length="60" />
</property>
<property name="isActive" type="string">
<column name="IS_ACTIVE" length="1" not-null="true" />
</property>
<many-to-one name="audUser" class="com.nekotec.prepaid.model.UsUser" fetch="select" lazy="false">
<column name="AUD_USER" not-null="true" />
</many-to-one>
<property name="audDate" type="timestamp">
<column name="AUD_DATE" length="19" not-null="true" />
</property>
<property name="audTransaction" type="string">
<column name="AUD_TRANSACTION" length="1" not-null="true" />
</property>
<one-to-one name="usUser" class="com.nekotec.prepaid.model.UsUser" />
<one-to-one name="usSeller" class="com.nekotec.prepaid.model.UsSeller" />
<one-to-one name="usClient" class="com.nekotec.prepaid.model.UsClient" />
</class>
</hibernate-mapping>
---------------------------------------------
and the code for the class is:
---------------------------------------------
package com.nekotec.prepaid.model;
import java.io.Serializable;
import java.util.Date;
/** @author Hibernate CodeGenerator */
public class UsPerson implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
/** identifier field */
private long personId;
/** persistent field */
private String identification;
/** persistent field */
private String name;
/** persistent field */
private String lastName;
/** persistent field */
private String address;
/** persistent field */
private String telephone;
/** nullable persistent field */
private String email;
/** persistent field */
private String isActive;
/** persistent field */
private UsUser audUser;
/** persistent field */
private Date audDate;
/** persistent field */
private String audTransaction;
/** nullable persistent field */
private UsUser usUser;
/** nullable persistent field */
private UsSeller usSeller;
/** nullable persistent field */
private UsClient usClient;
/** full constructor */
public UsPerson(String identification, String name, String lastName, String address, String telephone,
String email, String isActive, UsUser audUser, Date audDate, String audTransaction,
UsUser usUser, UsSeller usSeller, UsClient usClient) {
this.identification = identification;
this.name = name;
this.lastName = lastName;
this.address = address;
this.telephone = telephone;
this.email = email;
this.isActive = isActive;
this.audUser = audUser;
this.audDate = audDate;
this.audTransaction = audTransaction;
this.usUser = usUser;
this.usSeller = usSeller;
this.usClient = usClient;
}
/** default constructor */
public UsPerson() {
}
/** minimal constructor */
public UsPerson(String identification, String name, String lastName, String address, String telephone, String isActive, UsUser audUser, Date audDate, String audTransaction) {
this.identification = identification;
this.name = name;
this.lastName = lastName;
this.address = address;
this.telephone = telephone;
this.isActive = isActive;
this.audUser = audUser;
this.audDate = audDate;
this.audTransaction = audTransaction;
}
public long getPersonId() {
return this.personId;
}
public void setPersonId(long personId) {
this.personId = personId;
}
public String getIdentification() {
return this.identification;
}
public void setIdentification(String identification) {
this.identification = identification;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public String getLastName() {
return this.lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getAddress() {
return this.address;
}
public void setAddress(String address) {
this.address = address;
}
public String getTelephone() {
return this.telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public String getEmail() {
return this.email;
}
public void setEmail(String email) {
this.email = email;
}
public String getIsActive() {
return this.isActive;
}
public void setIsActive(String isActive) {
this.isActive = isActive;
}
public UsUser getAudUser() {
return this.audUser;
}
public void setAudUser(UsUser audUser) {
this.audUser = audUser;
}
public Date getAudDate() {
return this.audDate;
}
public void setAudDate(Date audDate) {
this.audDate = audDate;
}
public String getAudTransaction() {
return this.audTransaction;
}
public void setAudTransaction(String audTransaction) {
this.audTransaction = audTransaction;
}
public UsUser getUsUser() {
return this.usUser;
}
public void setUsUser(UsUser usUser) {
this.usUser = usUser;
}
public UsSeller getUsSeller() { return usSeller; }
public void setUsseller(UsSeller usSeller) { this.usSeller = usSeller; }
public UsClient getUsClient() {
return usClient;
}
public void setUsClient(UsClient usClient) {
this.usClient = usClient;
}
}
-----------------------------------------------------
Now, what's the problem? well the problem is that when my aplication tries to build the session factory I get this exception:
-----------------------------------------------------
org.hibernate.PropertyNotFoundException: Could not find a getter for usSeller in class com.nekotec.prepaid.model.UsPerson
at org.hibernate.property.BasicPropertyAccessor.createGetter(BasicPropertyAccessor.java:282)
at org.hibernate.property.BasicPropertyAccessor.getGetter(BasicPropertyAccessor.java:275)
at org.hibernate.mapping.Property.getGetter(Property.java:260)
at org.hibernate.tuple.PojoEntityTuplizer.buildPropertyGetter(PojoEntityTuplizer.java:238)
at org.hibernate.tuple.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:121)
at org.hibernate.tuple.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:50)
at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:64)
at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:256)
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:418)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:108)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:223)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1213)
at com.nekotec.data.CNekHBSessionFactory.<clinit>(CNekHBSessionFactory.java:19)
... 63 more
----------------------------------------------------------
Now, I've read your faq and a lot of posts for a similar topic in which Hibernate can't find a getter (or setter) when the name of the property has an uppercase letter in it's name second from left to right ("xXxx") and I think I remember some problems with names with an underscope ("x_xx") but this is not my case!, my property is called simply usSeller, and I just cannot find a reason for this exception to happen...
If anyone knows what might be happening, please answer me, I'd really apreciate it...
Thanxs.
DarX.[/b]
_________________ Software development is a race between Coders that produce better and bigger idiot-proof programs and the Universe that produces bigger and better idiots... So far the Universe is winning...
|