-->
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: Accessing to inner class property in filter condition
PostPosted: Mon Jun 13, 2011 4:18 pm 
Newbie

Joined: Wed May 25, 2011 9:33 am
Posts: 3
Hi Lads,
I've got a question whether is possible to somehow access into inner class property in filter condition. In attached example you can see a class which is annotated by hibernate annotation @filter. I would like to filter those Relation entities whose source's object or target's object is null or equal to zero value. The status property is available via get/set method on AbstractBaseObject class.

If you run the example below an exception called "unknown schema sourceObject" will be thrown.

Code:
@Filters({
    @Filter(name = "relation_entitiesSoftDelete", condition = "(sourceObject.status IS NULL OR sourceObject.status=0 OR targetObject.status IS NULL OR targetObject.status=0)")
})

public class Relation {
    ...

    /** Source object. */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "source")
    @Index(name = "relation_source_fkey")
    private AbstractBaseObject sourceObject;

    /** Target object. */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "target")
    @Index(name = "relation_target_fkey")
    private AbstractBaseObject targetObject;

    ...
}


Any help will be much appreciated. Thanks a lot. P.H.


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.