-->
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.  [ 1 post ] 
Author Message
 Post subject: no persistent classes found for query class:
PostPosted: Fri Apr 08, 2011 3:05 pm 
Newbie

Joined: Mon Mar 09, 2009 11:17 am
Posts: 2
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.