-->
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: Filter vs Where clause on Class Mapping Definition
PostPosted: Thu Dec 30, 2010 6:38 pm 
Regular
Regular

Joined: Tue Nov 30, 2004 4:23 pm
Posts: 62
The following document describes an attribute called where.

http://docs.jboss.org/hibernate/core/3. ... n-subclass

I was thinking of using this on a class that requires an effective dated query
everytime I get results from the db.

Can I use this?

What is the difference between this or Filters?

<class
name="ClassName"
table="tableName"
discriminator-value="discriminator_value"
mutable="true|false"
schema="owner"
catalog="catalog"
proxy="ProxyInterface"
dynamic-update="true|false"
dynamic-insert="true|false"
select-before-update="true|false"
polymorphism="implicit|explicit"
where="arbitrary sql where condition"
persister="PersisterClass"
batch-size="N"
optimistic-lock="none|version|dirty|all"
lazy="(16)true|false"
entity(17)-name="EntityName"
check=(18)"arbitrary sql check condition"
rowid=(19)"rowid"
subsel(20)ect="SQL expression"
abstra(21)ct="true|false"
node="element-name"
/>

Thanks...Jay


Top
 Profile  
 
 Post subject: Re: Filter vs Where clause on Class Mapping Definition
PostPosted: Thu Dec 30, 2010 10:44 pm 
Newbie

Joined: Thu Dec 30, 2010 6:58 pm
Posts: 5
Your condition will be hard-coded. It's like a permanent filter. I use it when I want to get only active records (based on some flag - so, making a record inactive should not delete it, but will make it inaccessible from the application).

I wonder though if I can still retrieve inactive records via a query or filter if I do not specify the same condition there (among others) as I hard-coded in the "where" clause on class mapping.


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.