Hi All,
I am getting a very strange (for me) configuration time problem-
Code:
net.sf.hibernate.PropertyNotFoundException: Could not find a setter for property [b]fOrgId[/b] in class com.ao.ae.foundation.hb.FOrg
This is the table definition-
Code:
CREATE TABLE f_org(
f_org_id numeric(10) not null,
f_div_id numeric(10) not null,
isActive char(1) DEFAULT 'Y' not null,
created timestamp DEFAULT TIMESTAMP not null,
createdBy numeric(10) not null,
updated timestamp DEFAULT TIMESTAMP not null,
updatedBy numeric(10) not null,
name varchar(60) not null,
description varchar(255),
f_language varchar(6),
check (isActive in ('Y','N')),
CONSTRAINT f_org_pk PRIMARY KEY (f_org_id));
This is the mapping-
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >
<hibernate-mapping package="com.ao.ae.foundation.hb">
<!--
Created by the Middlegen Hibernate plugin
http://boss.bekk.no/boss/middlegen/
http://hibernate.sourceforge.net/
-->
<class
name="FOrg"
table="F_ORG"
>
<id
name="fOrgId"
type="long"
column="F_ORG_ID"
>
<generator class="assigned" />
</id>
<property
name="fDivId"
type="long"
column="F_DIV_ID"
not-null="true"
length="10"
/>
<property
name="isactive"
type="java.lang.String"
column="ISACTIVE"
length="1"
/>
<property
name="created"
type="java.sql.Timestamp"
column="CREATED"
length="26"
/>
<property
name="createdby"
type="long"
column="CREATEDBY"
not-null="true"
length="10"
/>
<property
name="updated"
type="java.sql.Timestamp"
column="UPDATED"
length="26"
/>
<property
name="updatedby"
type="long"
column="UPDATEDBY"
not-null="true"
length="10"
/>
<property
name="name"
type="java.lang.String"
column="NAME"
not-null="true"
length="60"
/>
<property
name="description"
type="java.lang.String"
column="DESCRIPTION"
length="255"
/>
<property
name="fLanguage"
type="java.lang.String"
column="F_LANGUAGE"
length="6"
/>
<!-- associations -->
</class>
</hibernate-mapping>
And this is the POJO-
Code:
package com.ao.ae.foundation.hb;
import java.io.Serializable;
import java.util.Date;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
/** @author Hibernate CodeGenerator */
public class FOrg implements Serializable {
/** identifier field */
private long fOrgId;
/** persistent field */
private long fDivId;
/** nullable persistent field */
private String isactive;
/** nullable persistent field */
private Date created;
/** persistent field */
private long createdby;
/** nullable persistent field */
private Date updated;
/** persistent field */
private long updatedby;
/** persistent field */
private String name;
/** nullable persistent field */
private String description;
/** nullable persistent field */
private String fLanguage;
/** full constructor */
public FOrg(long fOrgId, long fDivId, String isactive, Date created, long createdby, Date updated, long updatedby, String name, String description, String fLanguage) {
this.fOrgId = fOrgId;
this.fDivId = fDivId;
this.isactive = isactive;
this.created = created;
this.createdby = createdby;
this.updated = updated;
this.updatedby = updatedby;
this.name = name;
this.description = description;
this.fLanguage = fLanguage;
}
/** default constructor */
public FOrg() {
}
/** minimal constructor */
public FOrg(long fOrgId, long fDivId, long createdby, long updatedby, String name) {
this.fOrgId = fOrgId;
this.fDivId = fDivId;
this.createdby = createdby;
this.updatedby = updatedby;
this.name = name;
}
public long getFOrgId() {
return this.fOrgId;
}
public void setFOrgId(long fOrgId) {
this.fOrgId = fOrgId;
}
public long getFDivId() {
return this.fDivId;
}
public void setFDivId(long fDivId) {
this.fDivId = fDivId;
}
public String getIsactive() {
return this.isactive;
}
public void setIsactive(String isactive) {
this.isactive = isactive;
}
public Date getCreated() {
return this.created;
}
public void setCreated(Date created) {
this.created = created;
}
public long getCreatedby() {
return this.createdby;
}
public void setCreatedby(long createdby) {
this.createdby = createdby;
}
public Date getUpdated() {
return this.updated;
}
public void setUpdated(Date updated) {
this.updated = updated;
}
public long getUpdatedby() {
return this.updatedby;
}
public void setUpdatedby(long updatedby) {
this.updatedby = updatedby;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return this.description;
}
public void setDescription(String description) {
this.description = description;
}
public String getFLanguage() {
return this.fLanguage;
}
public void setFLanguage(String fLanguage) {
this.fLanguage = fLanguage;
}
public String toString() {
return new ToStringBuilder(this)
.append("fOrgId", getFOrgId())
.toString();
}
public boolean equals(Object other) {
if ( !(other instanceof FOrg) ) return false;
FOrg castOther = (FOrg) other;
return new EqualsBuilder()
.append(this.getFOrgId(), castOther.getFOrgId())
.isEquals();
}
public int hashCode() {
return new HashCodeBuilder()
.append(getFOrgId())
.toHashCode();
}
}
I can see a setter for property
fOrgId in class com.ao.ae.foundation.hb.FOrg.
Can anybody point out what is wrong there.
Hibernate 2.1.4