Hibernate version: 3
Can I Apply a IN filter on a OneToMany property? Like this:
Code:
@Entity
class Car{
....
@OneToMany(mappedBy="car")
private List<Component> components;
...
}
@Entity
class Component{
...
@MayToOne
@JoinColumn(name="car_id")
public Car car;
}
I want to do this:
Code:
session.createCriteria(Car.class).add(Restrictions.in("components",getFilteredComponents()));
getFilteredComponentes returns a Collection<Component>
I get the error "Missing IN or OUT parameter at index:: 1"
The generated query is
Code:
select this_.car_id as id1_1_0_, this_.model as model2_1_0_
from cars this_ where this_.car_id in (?)
Any Ideas??
Thanks!