--- Alan She <[EMAIL PROTECTED]> wrote: > I try to use some base class to do this. > > /** > * @hibernate.filter-def name="effectiveDate" > * @hibernate.filter-param name="asOfDate" > type="date" > filterdef-name="effectiveDate" > * @hibernate.filter name="effectiveDate" > condition=":asOfDate BETWEEN > eff_start_dt and eff_end_dt" > */ > public class BaseObject { > ... > } > > /** > * @hibernate.class table="user" > */ > public class User extends BaseObject { > ... > } > > However the User.hbm.xml do NOT applied the > hibernate filter nor the > filter-def tag. > Am I missing something? > I tried the similar approach on collections, filter > element will be > inherited but not filter-def element. > How to make every hbm file contains the filter-def? > What if I need a class level filter? Can I use > inherited the class level > filter?
Just looked into template. It seems that filters are looked for on concrete mapping class only. However, you may try this pretty easy. Just checkout sources for plugin ( http://www.sourceforge.net/projects/xdoclet-plugin ) and try to change org/xdoclet/plugins/hibernate/Filter.jelly so: ${filterEntity.getTagsByName('hibernate.filter')} becomes: ${filterEntity.getTagsByName('hibernate.filter',true)} This shall activate looking for tags also in superclasses. ( if you also provide a testcase covering this problem, and then send in the patch, it can be applied today evening & deployed as snapshot ) Or file a JIRA issue, and I will implement this ASAP. ( The same is true for filter-def tags ) regards, ----[ Konstantin Pribluda http://www.pribluda.de ]---------------- Still using XDoclet 1.x? XDoclet 2 is released and of production quality. check it out: http://xdoclet.codehaus.org __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ xdoclet-plugins-interest mailing list xdoclet-plugins-interest@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xdoclet-plugins-interest