-->
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: Centralise filter condition
PostPosted: Thu May 03, 2007 7:57 am 
Newbie

Joined: Fri Dec 15, 2006 6:39 am
Posts: 3
Hibernate version: 3.2.2

Mapping documents:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
   "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
   "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="customer">
<class name="Customer" table="CUSTOMER" schema="SCHEMA">
        [...]
        <filter name="softDeleteFilter" condition="DELETED_S != 'Y'">
        </filter>
    </class>
</hibernate-mapping>


Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>

    <filter-def name="softDeleteFilter" />
   
</hibernate-mapping>


The Question
I'm trying to put a filter on all my Classes, but in a maintainable fashion.

Is there any way I could write
Code:
<filter-def name="softDeleteFilter" condition="DELETED_S != 'Y'" />

or something similar that let's me centralise the condition?

Writing the condition in every class would be a solution, but since I have +50 different classes, it would be a pain to maintain.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 31, 2007 5:11 pm 
Newbie

Joined: Thu Jan 12, 2006 4:35 pm
Posts: 13
Hi

Did you get an answer to this question? Can you please post the solution if so?

Thanks


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.