The where attribute takes an *SQL* fragment, not a HQL fragment, And the
braindead parser will recognize a function iff you nest the paren right up
close like this: "exists(", instead of this: "exists (".

If you want to use subqueries, etc in where fragments, you MUST be using
Hibernate 2.1.


> Hi.
> I'm tried to use a where parameter in a set tag with an exists clause and
> I've an error.  My mapping is similar to:
>
> <set name="persons" lazy="true"
>      where="not exists ( from myapp.Person as other where other.id = id)">
> .....
>
>   and the generated SQL is like
>
> select plan_tip0_.USER_ID as TIPO_CAM1___,
>       ..................
> from PLAN_USERS plan_tip0_
> where plan_tip0_.USER_ID=? and
>       not plan_tip0_.exists ( plan_tip0_.from plan_tip0_.myapp.Person
> plan_tip0_.as plan_tip0_.other plan_tip0_.where
> plan_tip0_.otro.id=plan_tip0_.id)
>
> the synonymous for the table (named plan_tipo0_) is uppend at begining of
> the reserved word (like exists) making the SQL code erroneous.
>
> Is possible that I can used an exists in this form?
> Also, Can I use arbitrary SQL code inside the HQL code (to make this query
> works)?
>
> Thanks!
>
> Germán
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> hibernate-devel mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/hibernate-devel
>



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to