Hibernate version: 3.1
Database: Oracle 10g using ojdbc14 drivers
Hello there! I'm havin a little problem with Collections mapping using Annotations. Here's my persistent classes:
Code:
@Entity
@Table(name="VW_USUARIO")
@SuppressWarnings("serial")
public class Usuario{
@OneToMany(fetch=FetchType.EAGER,targetEntity=Produto.class)
@OrderBy("ponto")
public Set getProdutos() {
return produtos;
}
}
@Entity
@Table(name="VW_PRODUTO")
public class Produto{
}
This is an unidirectional relationship. Both tables (actually views) have composite keys
Usuario is composed by CODUSER, CONTRATO
Produto is composed by CIDADE,CONTRATO,PRODUTO
Ok, my problem is that the SQL generated by hibernate is trying to perform an outer join in a table called "VW_USUARIO_VW_PRODUTO" like there was a JoinTable in a manyToMany relationship.
What's wrong with this code?
Regards