-->
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: search in multiple subclasses
PostPosted: Mon Dec 06, 2010 7:48 am 
Newbie

Joined: Tue Sep 21, 2004 11:21 am
Posts: 8
i have the following classes

@Entity
@Inheritance(strategy = InheritanceType.JOINED)
public class GenericContent {String columnA ...}

@Entity
public class AContent extends GenericContent {String columnB ...}
@Entity
public class BContent extends GenericContent {String columnB ...}
@Entity
public class CContent extends GenericContent { String columnC}

i want to search in columnA for all the 3 classes. which is simpel
criteria = getSessionFactory().getCurrentSession().createCriteria(GenericContent .class);
disjunction.add(Restrictions.ilike("columnA", "foo", MatchMode.ANYWHERE));
criteria.add(disjunction);
List<GenericContent> results = criteria.list();

now i want to add a filter for all columnB's. but this is not in the genericContent. and i rather not go by all subclasses one by one.

is there a solution?


ps all pseudocode


Top
 Profile  
 
 Post subject: Re: search in multiple subclasses
PostPosted: Thu Sep 08, 2011 6:02 pm 
Newbie

Joined: Tue Sep 21, 2004 11:21 am
Posts: 8
i now use compass (or elasticsearch) for this


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.