-->
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.  [ 4 posts ] 
Author Message
 Post subject: org.hibernate.PropertyNotFoundException - pls help
PostPosted: Fri Oct 17, 2008 7:38 pm 
Beginner
Beginner

Joined: Mon Jul 09, 2007 2:21 pm
Posts: 24
I am getting the following exception when i try to run my application

Initial SessionFactory creation failed.org.hibernate.PropertyNotFoundException:

Could not find a getter for countyId in class com.mavent.model.testLimit



mapping:

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated Oct 17, 2008 3:48:21 PM by Hibernate Tools 3.2.0.b9 -->
<hibernate-mapping>
<class name="com.test.model.testLimit" table="TEST_LIMIT" >
<id name="id" type="long">
<column name="ID" precision="22" scale="0" />

<generator class="sequence">
<param name="sequence">TEST_ID_SEQ</param>
</generator>
</id>

<many-to-one name="county" class="com.test.model.County" fetch="select">
<column name="COUNTY_ID" precision="22" scale="0" not-null="true" />
</many-to-one>

<property name="limitTransactionDate" type="timestamp">
<column name="LIMIT_TRANSACTION_DATE" length="7" not-null="true" />
</property>

<property name="limitType" type="string">
<column name="LIMIT_TYPE" length="20" not-null="true" />
</property>

<property name="unitCount" type="big_decimal">
<column name="UNIT_COUNT" precision="22" scale="0" not-null="true" />
</property>

<property name="limitAmount" type="string">
<column name="LIMIT_AMOUNT" length="240" />
</property>
</class>
</hibernate-mapping>

pojo


/**
*
* Copyright (c) 2007, Mavent Inc.
* All Rights Reserved.
*
*/
package com.mavent.model;

// Generated by Hibernate Tools 3.2.0.b9


import java.math.BigDecimal;
import java.util.Date;

/**
* TESTLimit generated by hbm2java
*/
public class TESTLimit implements java.io.Serializable {


//Fields

private long id;
private County county;
private Date limitTransactionDate;
private String limitType;
private BigDecimal unitCount;
private String limitAmount;
// Constructors

/** default constructor */
public TESTLimit() {
}

/** minimal constructor */
public TESTLimit(County county, Date limitTransactionDate, String limitType, BigDecimal unitCount) {
this.county = county;
this.limitTransactionDate = limitTransactionDate;
this.limitType = limitType;
this.unitCount = unitCount;
}
/** full constructor */
public TESTLimit(County county, Date limitTransactionDate, String limitType, BigDecimal unitCount, String limitAmount) {
this.county = county;
this.limitTransactionDate = limitTransactionDate;
this.limitType = limitType;
this.unitCount = unitCount;
this.limitAmount = limitAmount;
}

// Property accessors
public long getId() {
return this.id;
}

public void setId(long id) {
this.id = id;
}
public County getCounty() {
return this.county;
}

public void setCounty(County county) {
this.county = county;
}
public Date getLimitTransactionDate() {
return this.limitTransactionDate;
}

public void setLimitTransactionDate(Date limitTransactionDate) {
this.limitTransactionDate = limitTransactionDate;
}
public String getLimitType() {
return this.limitType;
}

public void setLimitType(String limitType) {
this.limitType = limitType;
}
public BigDecimal getUnitCount() {
return this.unitCount;
}

public void setUnitCount(BigDecimal unitCount) {
this.unitCount = unitCount;
}
public String getLimitAmount() {
return this.limitAmount;
}

public void setLimitAmount(String limitAmount) {
this.limitAmount = limitAmount;
}



}


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 18, 2008 1:06 am 
Regular
Regular

Joined: Wed Oct 15, 2008 6:59 am
Posts: 103
Location: Chennai
Ciao

There is no definition of method getCountryId , i think u may use miss code in ur project. i mean ur code may call getter method for countryid field/object. but u don't have nay countryid field in ur class. ur class contain only Country object. so check out ur Country class for any getter method presence of countryid field, if it is not just create it.

_________________
If u feel it will help you, don't forget to rate me....


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 20, 2008 1:29 pm 
Beginner
Beginner

Joined: Mon Jul 09, 2007 2:21 pm
Posts: 24
Not supposed to have a getter for that property because its a foregin key


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 21, 2008 12:36 am 
Regular
Regular

Joined: Wed Oct 15, 2008 6:59 am
Posts: 103
Location: Chennai
ok lake..
w abt ur Country class and their getter,setter methods..
why r u posting ur Country class lake?
i think the problem lies there..

_________________
If u feel it will help you, don't forget to rate me....


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.