> On Jan 2, 2017, at 1:21 PM, Brandon Perry <[email protected]> wrote:
>
> I have a schema with uuid[] columns and I am using a custom driver in order
> to persist a Guid[] to the uuid[] column. This works well.
>
> If I have a Guid, how can I use the hibernate criteria to select all rows
> from column where column contains X? I expected a Restrictions.Contains, but
> only see Restrictions.In, which doesn’t appear to do what I want.
>
> Example Table
>
> CREATE TABLE foo (
> ID UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
> SearchTerm text,
> Categories uuid[],
> Timestamp timestamp
> );
>
>
> If I wanted to create a criteria search for all search queries who Categories
> contained X, is this something I need to write my own code in the driver to
> do? I may need to create a separate table to union against otherwise.
So, it looks like
criteria.Add(Restrictions.Eq("ANY(Categories)", cat));
will probably do what I want.
https://www.postgresql.org/docs/9.1/static/arrays.html
<https://www.postgresql.org/docs/9.1/static/arrays.html>
--
You received this message because you are subscribed to the Google Groups
"Fluent NHibernate" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fluent-nhibernate.
For more options, visit https://groups.google.com/d/optout.