Where attribute?

Tuna Toksöz
Eternal sunshine of the open source mind.

http://devlicio.us/blogs/tuna_toksoz
http://tunatoksoz.com
http://twitter.com/tehlike




On Thu, Jul 23, 2009 at 3:01 PM, Stephane EHRET <[email protected]> wrote:

>
> Hi to all,
>
> By using the Check attribute on a Bag (as doc discribed:
>
> https://www.hibernate.org/hib_docs/nhibernate/1.2/reference/en/html/toolsetguide.html
> ),
>
> I was hopping to filter automatically the Bag.
> But this doesn't work and the generated SQL doesn't take this check
> constraint into account.
>
> Example:
> Bar.Foos - > IList(Of Foo) limited to Foo.IsDeleted==false
>
> <class name="Bar"  table="Bar">
>
>    <bag name="Foos" table="Foo" inverse="true"
> check="IsDeleted=false">
>        <key column="FooId"/>
>        <one-to-many class="Foo"/>
>    </bag>
>
> </class>
>
>
> With Foo:
> <class name="Foo"  table="Foo">
>
>    <id name="Id" column="Id" type="Int32" unsaved-value="0">
>      <generator class="native"/>
>    </id>
>
>    <property name="IsDeleted" column="IsDeleted" type="boolean"
> length="100" not-null="true"/>
>
> </class>
>
>
>
> Thanks for your help,
> Stephane
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to