This is usually an easy fix, but this time it has me baffled. Hibernate 2.1.8. (Don't ask. I don't make the decisions here.) What's really baffling is it works in the JUnit tests, just not in my action class. And if I try to access other entities from our library in the same action, those DO work. It's only these new classes.
If I print out the keys from the ClassMetaData map from SessionFactory.getAllClassMetadata(), it's there, so it appears to be getting mapped and loaded. Here is what prints out from the KeySet.
class com.sherwin.corp.ehrs.emerald.facade.score.ChemListScoreType
Mapping File. It's as simple as they come.
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "file:///usr/share/xml/hibernate-mapping-2.0.dtd">
<hibernate-mapping package="com.sherwin.corp.ehrs.emerald.facade.score" default-access="field">
<class name="ChemListScoreType" table="CL_SCORE_TYPE" lazy="false">
<id name="primaryKey" type="int" column="SCORE_TYPE_SQ">
<generator class="assigned"/>
</id>
<version name="version" column="VERSION_NO" unsaved-value="negative" />
<property name="creationTimestamp" column="CREATE_DT" type="calendar" />
<property name="creationUser" column="CREATE_USER_ID" type="string" />
<property name="abbreviation" column="ABBR_TX" type="string" />
<property name="displayLabel" column="DEFAULT_DISPLAY_LABEL_TX" type="string" />
</class>
</hibernate-mapping>
Entity:
Code:
package com.sherwin.corp.ehrs.emerald.facade.score;
public class ChemListScoreType extends EntityWithPKEqualityImpl {
private static final long serialVersionUID = 2689447781362093314L;
private String abbreviation;
private String displayLabel;
private Calendar creationTimestamp;
private String creationUser;
private int version = -1;
public ChemListScoreType() { }
.
.
.
public Integer getKey() {
return (Integer) super.getPrimaryKey();
}
public String getAbbreviation() {
return abbreviation;
}
public void setAbbreviation(String abbreviation) {
this.abbreviation = abbreviation;
}
public String getDisplayLabel() {
return displayLabel;
}
public void setDisplayLabel(String displayLabel) {
this.displayLabel = displayLabel;
}
public Calendar getCreationTimestamp() {
return creationTimestamp;
}
public void setCreationTimestamp(Calendar creationTimestamp) {
this.creationTimestamp = creationTimestamp;
}
public String getCreationUser() {
return creationUser;
}
public void setCreationUser(String creationUser) {
this.creationUser = creationUser;
}
public int getVersion() {
return version;
}
public void setVersion(int version) {
this.version = version;
}
}
HQL is also simple. "from ChemListScoreType scoreType". I want everything in the table.
Thanks.