-->
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.  [ 2 posts ] 
Author Message
 Post subject: Extra Filter On The Categories Table, HOW?
PostPosted: Thu Jul 26, 2007 3:41 am 
Beginner
Beginner

Joined: Wed Jul 25, 2007 6:32 am
Posts: 22
I have mapped a Category with CategorizedItems and Items, like the Caveat Example. But in my Category there is an extra column "CATEGORY_TYPE".

Now when I run my test getItemById(Long Id), I get the CategorizedItems from every Category.

But I want only the CategorizedItems of the Category with CATEGORY_TYPE ="Something"

How can I achieve this in my mapping, because I can add no where="" in my Categorized.hbm.xml?

I have tried to add this in <class name="Category" table="CATEGORIES" where="CATEGORY_TYPE='UI'">

But this doesn't work as well.

How can I get this to work?


Top
 Profile  
 
 Post subject: EXTRA INFO
PostPosted: Thu Jul 26, 2007 8:41 am 
Beginner
Beginner

Joined: Wed Jul 25, 2007 6:32 am
Posts: 22
Because when I add an where on my Category.hbm.xml

like this:
<class name="Category" table="CATEGORIES" where="CATEGORIE_TYPE='UI'">

I get the following Exception:
org.hibernate.ObjectNotFoundException: No row with the given identifier exists: package.Category#86

I think I am almost there, but don't know what to do now.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.