-->
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.  [ 3 posts ] 
Author Message
 Post subject: Could not find a getter for pEntId in class ...
PostPosted: Fri Mar 12, 2004 11:19 pm 
Regular
Regular

Joined: Sat Feb 21, 2004 8:54 pm
Posts: 60
Location: Lakewood, California
hi, i reversed a database using middlegen (see .java and .hbm.xml files below). seems sorta normal (but i am a programmer, not a dba) and i get a:

INFO: building session factory
net.sf.hibernate.PropertyNotFoundException: Could not find a getter for pEntId in class fg1.hibernate.EntityNum
at net.sf.hibernate.property.BasicPropertyAccessor.getGetter(BasicPropertyAccessor.java:182)
at net.sf.hibernate.mapping.Property.getGetter(Property.java:179) ...

the rest of the classes generated by niddlegen can be added to the configuration and the session get's built.

any pointers will be appreciated.

thanks


package fg1.hibernate;

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 EntityNum implements Serializable {

/** identifier field */
private Integer dbId;

/** persistent field */
private String myEntId;

/** persistent field */
private String pEntId;

/** persistent field */
private String pEntRole;

/** persistent field */
private String pEntNum;

/** persistent field */
private String whoCreated;

/** persistent field */
private Date whenCreated;

/** nullable persistent field */
private String whoModified;

/** nullable persistent field */
private Date whenModified;

/** full constructor */
public EntityNum(Integer dbId, String myEntId, String pEntId, String pEntRole, String pEntNum, String whoCreated, Date whenCreated, String whoModified, Date whenModified) {
this.dbId = dbId;
this.myEntId = myEntId;
this.pEntId = pEntId;
this.pEntRole = pEntRole;
this.pEntNum = pEntNum;
this.whoCreated = whoCreated;
this.whenCreated = whenCreated;
this.whoModified = whoModified;
this.whenModified = whenModified;
}

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

/** minimal constructor */
public EntityNum(Integer dbId, String myEntId, String pEntId, String pEntRole, String pEntNum, String whoCreated, Date whenCreated) {
this.dbId = dbId;
this.myEntId = myEntId;
this.pEntId = pEntId;
this.pEntRole = pEntRole;
this.pEntNum = pEntNum;
this.whoCreated = whoCreated;
this.whenCreated = whenCreated;
}

public Integer getDbId() {
return this.dbId;
}

public void setDbId(Integer dbId) {
this.dbId = dbId;
}

public String getMyEntId() {
return this.myEntId;
}

public void setMyEntId(String myEntId) {
this.myEntId = myEntId;
}

public String getPEntId() {
return this.pEntId;
}

public void setPEntId(String pEntId) {
this.pEntId = pEntId;
}

public String getPEntRole() {
return this.pEntRole;
}

public void setPEntRole(String pEntRole) {
this.pEntRole = pEntRole;
}

public String getPEntNum() {
return this.pEntNum;
}

public void setPEntNum(String pEntNum) {
this.pEntNum = pEntNum;
}

public String getWhoCreated() {
return this.whoCreated;
}

public void setWhoCreated(String whoCreated) {
this.whoCreated = whoCreated;
}

public Date getWhenCreated() {
return this.whenCreated;
}

public void setWhenCreated(Date whenCreated) {
this.whenCreated = whenCreated;
}

public String getWhoModified() {
return this.whoModified;
}

public void setWhoModified(String whoModified) {
this.whoModified = whoModified;
}

public Date getWhenModified() {
return this.whenModified;
}

public void setWhenModified(Date whenModified) {
this.whenModified = whenModified;
}

public String toString() {
return new ToStringBuilder(this)
.append("dbId", getDbId())
.toString();
}

public boolean equals(Object other) {
if ( !(other instanceof EntityNum) ) return false;
EntityNum castOther = (EntityNum) other;
return new EqualsBuilder()
.append(this.getDbId(), castOther.getDbId())
.isEquals();
}

public int hashCode() {
return new HashCodeBuilder()
.append(getDbId())
.toHashCode();
}

}


<?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>
<!--
Created by the Middlegen Hibernate plugin

http://boss.bekk.no/boss/middlegen/
http://hibernate.sourceforge.net/
-->

<class
name="fg1.hibernate.EntityNum"
table="entity_num"
>

<id
name="dbId"
type="int"
column="db_id"
>
<generator class="assigned" />
</id>

<property
name="myEntId"
type="java.lang.String"
column="my_ent_id"
not-null="true"
unique="true"
length="40"
/>
<property
name="pEntId"
type="java.lang.String"
column="p_ent_id"
not-null="true"
unique="true"
length="40"
/>
<property
name="pEntRole"
type="java.lang.String"
column="p_ent_role"
not-null="true"
unique="true"
length="10"
/>
<property
name="pEntNum"
type="java.lang.String"
column="p_ent_num"
not-null="true"
unique="true"
length="40"
/>
<property
name="whoCreated"
type="java.lang.String"
column="who_created"
not-null="true"
length="10"
/>
<property
name="whenCreated"
type="java.sql.Timestamp"
column="when_created"
not-null="true"
length="19"
/>
<property
name="whoModified"
type="java.lang.String"
column="who_modified"
length="10"
/>
<property
name="whenModified"
type="java.sql.Timestamp"
column="when_modified"
length="14"
/>

<!-- associations -->

</class>
</hibernate-mapping>

_________________
<http://tayek.com/>, co-chair <http://www.ocjug.org/>, actively
seeking telecommuting work. hate spam?
<https://www1.ietf.org/mailman/listinfo/asrg>


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 13, 2004 8:41 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
http://www.hibernate.org/116.html#A30


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 14, 2004 4:38 am 
Regular
Regular

Joined: Sat Feb 21, 2004 8:54 pm
Posts: 60
Location: Lakewood, California
works like a charm!

thanks

_________________
<http://tayek.com/>, co-chair <http://www.ocjug.org/>, actively
seeking telecommuting work. hate spam?
<https://www1.ietf.org/mailman/listinfo/asrg>


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