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: [solved] "no persistent classes found for query class&q
PostPosted: Wed Apr 01, 2009 6:41 am 
Newbie

Joined: Tue Jun 19, 2007 6:53 am
Posts: 7
Location: Hamburg, Germany
Hibernate version: 3.3.1

Mapping documents: via annotations


Hi,

I am new to Hibernate and am working on switching from xdoclet to annotations. Most of the stuff already works, but I´ve got a problem with a joined subclass.

The table "xr_batch_data" contains the XR specific part of a batch. It is mapped via the column batchID to the table "batch".

The class for "xr_batch_data":
Code:
/**
* @hibernate.joined-subclass
* table="xr_batch_data"
*
* @hibernate.joined-subclass-key
* column="batchID"
*/
@Entity
@Table(name=TableName.XR_BATCH_DATA)
@Inheritance(strategy=InheritanceType.JOINED)
@PrimaryKeyJoinColumn(name=FieldName.XRBATCH_ID)
public class XRBatchBean extends BatchBean {


The class for "batch":
Code:
@Entity
@Table(name=TableName.BATCH)
@Inheritance(strategy=InheritanceType.JOINED)
public abstract class BatchBean extends PersistenceBean {


PersistenceBean is an abstract class. I checked all my constants and these are ok.


Now, when I try to get data in my client I get this exception:
Code:
java.lang.IllegalArgumentException: Parameter startdate does not exist as a named parameter in [select batch from de.xxx.yyy.client.bean.XRBatchBean as batch where  batch.created>= :startdate and batch.stopped<= :enddate]


I checked it and the parameter is still there. Nothing changed in that part of the code. I assume the reason is this warning that occurs before:
Code:
>>> WARN  [QuerySplitter.concreteQueries]: no persistent classes found for query class: select batch from de.xxx.yyy.client.bean.XRBatchBean as batch where  batch.created>= :startdate and batch.stopped<= :enddate


I have checked the documentation, googled, and searched this forum but couldn´t find anything useful.

I hope you can help me.


Lars


Last edited by larsen25 on Wed Apr 01, 2009 10:19 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 01, 2009 6:46 am 
Newbie

Joined: Tue Jun 19, 2007 6:53 am
Posts: 7
Location: Hamburg, Germany
BTW, for the admins: the subject could be entered as ""no persistent classes found for query class" / inheritance" but was cropped afterwards


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 01, 2009 10:24 am 
Newbie

Joined: Tue Jun 19, 2007 6:53 am
Posts: 7
Location: Hamburg, Germany
The problem was caused by the change from xdoclet to annotations: I use .addAnnotatedClass() and only added the classes where I previously had hbm.xml files for.

As BatchBean.hbm.xml included the details for xr_batch_data this was missing in the new code. I added .addAnnotatedClass(XRBatchBean.class) and now everything seems to work fine.


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.