OK. I've scoured every bit of information I can find, and cannot find why I'm getting this error. I'm maintaining this project (not the original developer), so I've followed exactly what was in place on the existing project.
The error I'm getting is:
Code:
getMandatoryTrainingByMandatoryTrainingGroupId failed; nested exception is org.hibernate.QueryException: could not resolve property: mandatoryTrainingActive of: project.domain.employee.training.MandatoryTraining [select mandatoryTraining from project.domain.employee.training.MandatoryTraining mandatoryTraining
My hibernate mapping is as follows (non-relevant properties removed for space' sake):
Code:
<hibernate-mapping>
<class name="project.domain.employee.training.MandatoryTraining" table="mandatorytraining" >
<id name="id" type="int" column="mandatorytrainingid">
<generator class="sequence">
<param name="sequence">MandatoryTrainingID_seq</param>
</generator>
</id>
<property name="mandatoryTrainingName" type="text">
<column name="mandatorytrainingname" not-null="false"/>
</property>
<property name="mandatoryTrainingDesc" type="text">
<column name="mandatorytrainingdesc" not-null="false"/>
</property>
<property name="mandatoryTrainingActive" type="project.persistence.support.BooleanToSmallInt">
<column name="mandatorytrainingactive" not-null="true"/>
</property>
</class>
</hibernate-mapping>
The project.domain.employee.training.MandatoryTraining class inherits the project.base.domain.MandatoryTrainingBase abstract class, which contains the following definitions (Again, shortened):
Code:
public abstract class MandatoryTrainingBase extends project.domain.Domain {
private Boolean mandatoryTrainingActive;
public void setMandatoryTrainingActive(final Boolean isActive) {
this.mandatoryTrainingActive = isActive;
}
public Boolean getMandatoryTrainingActive()
{
return this.mandatoryTrainingActive;
}
}
The underlying database is PostgreSQL 8.1.9, with the field defined as:
mandatorytrainingactive, smallint, not null, default 1
I'm using Hibernate 3.2.4, Java 1.5.0_15.
What's baffling me is that I can properly access the property through normal java code, but the hibernate query is throwing this exception.
I'm not very familiar with hibernate, so I'm probably missing something terribly simple. Please help!
Thanks very much in advance.
-Doug