I’ve been trying to use the where clause for <set> on hibernate for quite a long time.

 

The main reason I’m using it is because we’re implementing a soft-delete (setting a flag to 0, instead of a SQL DELETE statement).

And then I use the where=”active_ind=1” to retrieve only active children.

 

First problem is I’m getting “ambiguous column name ‘active_ind’” because most of the tables have an active_ind column – same name.

 

I tried solving this problem by adding the set name for the where clause:  <set … where=”orgTypes.active_ind=1”>

 

It didn’t work, because the real name for the orgTypes is “orgTypes0_”. Therefore orgTypes is not valid.

 

Shouldn’t it be better if I could specify a HQL for the where clause and Hibernate put the sql together for me?

 

How can I solve this problem?

 

Thanks,

Marcelo.

Reply via email to