Hi. I have a problem. I have two tables and i want connected table1'id with id of table2'id.
After i want take the rows of the table2 where the state in the row ( with same id) is "active".
In the class of table1 :
Code:
@NotNull
private Integer numberId;
private State state;
In the class of table2 :
Code:
@ManyToOne(cascade = { CascadeType.REFRESH }, fetch = FetchType.LAZY,optional=true)
@JoinColumn(name = "numeroAco",updatable=false,insertable=false)
private Table1 table1;
In the dao :
Code:
crit.setFetchMode("table1",FetchMode.SELECT);
crit.createAlias("table1", "ta",JoinType.LEFT_OUTER_JOIN);
crit.add(Restrictions.eq("ta.state", "active"));
i try the debugging. In the criteria there is a ac.state=active but hibernate doesn't do that and it do a other filter ( i don't understand the filter)
Help!! what is the problem? thanks !!!!! :(