-->
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: Hibernate Filter with Joined Inheritence
PostPosted: Thu Jul 16, 2009 7:11 am 
Newbie

Joined: Thu Jul 16, 2009 6:54 am
Posts: 2
I have the following base class
Code:
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@FilterDef(name = "visibilityFilter", defaultCondition = "visible = :visible", parameters = @ParamDef(name = "visible", type = "java.lang.Boolean"))
@Filter(name = "visibilityFilter")
public class ClassA {
       ...
       private boolean visible = true;
       ...

       public void setVisible(boolean visible) {
            this.visible = visible
        }

        public boolean isVisible() {
            return visible;
        }
}


And the following subclass:
Code:
public class SubclassA extends ClassA {
     ...
}


Then in ClassB I have:

Code:
public class ClassB {
     ...
       @OneToMany(cascade = { ALL }, fetch = LAZY)
       @JoinColumn(name = "classb_id")
       @Filter(name = "visibilityFilter")
       private List<SubclassA> list = new ArrayList<SubclassA>();
     ...
}


Simply I need to use the filter called "visibilityFilter" to filter the collection in ClassB
The above code produced the following error :
Code:
WARN  o.h.util.JDBCExceptionReporter - SQL Error: 1054, SQLState: 42S22
ERROR o.h.util.JDBCExceptionReporter - Unknown column 'list0_.visible' in 'where clause'


Top
 Profile  
 
 Post subject: Re: Hibernate Filter with Joined Inheritence
PostPosted: Thu Jan 31, 2013 6:01 pm 
Newbie

Joined: Thu Jun 07, 2012 10:03 am
Posts: 8
Hi,

I know this is an old discussion but did you find a solution?

Thanks
Mickael


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.