This is driving me crazy and I'm on a tight schedule to get this done.
I have the following class and named query defined:
Code:
---
package com.XXX.YYY.domain.lookup;
import com.XXX.AAA.domain.support.ZZZ;
public class Relation extends ZZZ{
private Integer lookupRelationId;
private Integer sectionId;
private String lookupRelationName;
private String srcFieldName;
private String tgtFieldName;
private Integer lookupAdminId;
..... snip getters and setters ....
---
<hibernate-mapping package="com.XXX.YYY.domain.BBB">
... snip lots of class mappings and named queries ...
<sql-query name="etofRelation" cacheable="false" callable="false">
<return class="com.XXX.YYY.domain.lookup.Relation" lock-mode="read">
<return-property name="lookupRelationId" column="lookup_relation_id"/>
<return-property name="sectionId" column="section_id"/>
<return-property name="lookupRelationName" column="lookup_relation_name"/>
<return-property name="srcFieldName" column="source_field_name"/>
<return-property name="tgtFieldName" column="target_field_name"/>
<return-property name="lookupAdminId" column="lookup_admin_id"/>
</return>
select lookup_relation_id, section_id, lookup_relation_name, source_field_name, target_field_name, lookup_admin_id
from SOME_TABLE where
section_id = :section and
lookup_relation_name = :relation_name
</sql-query>
My table is defined as follows:Code:
create table SOME_TABLE
( lookup_relation_id NUMBER(11,0) primary key,
section_id NUMBER(11,0),
lookup_relation_name VARCHAR2(50),
source_field_name VARCHAR2(50),
target_field_name VARCHAR2(50),
lookup_admin_id NUMBER(11,0) NOT NULL,
CONSTRAINT fk_relations_lu_admin_id
FOREIGN KEY (lookup_admin_id)
REFERENCES OTHER_TABLE (lookup_admin_id),
CONSTRAINT fk_relations_section_id
FOREIGN KEY (section_id)
REFERENCES ANOTHER_TABLE (section_id)
)
My localhost fails to start with the following exception:Code:
Error in named query: etofRelation
org.hibernate.MappingException: Unknown entity: com.XXX.YYY.domain.lookup.Relation
at org.hibernate.impl.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:514)
.... snip long stack trace ....
All of this seems to be correct to me. I can't figure out for the life of me why hibernate doesn't like my named query. Does anybody have any idea what's going wrong here?
Thanks,
matt muscari