Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/hibernate/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Hibernate @其中@JoinColumn关系不起作用_Hibernate_Hibernate Mapping - Fatal编程技术网

Hibernate @其中@JoinColumn关系不起作用

Hibernate @其中@JoinColumn关系不起作用,hibernate,hibernate-mapping,Hibernate,Hibernate Mapping,我有两个实体Produto和EnderecoProduto,它们之间存在关系 在我的实体Produto中,我已经拥有一个@Where并且通常有效,但是在我的关系中,当我列出它们时,endereproduto并没有添加到select子句中 Produto: @Entity @Table(name = "SB1010") @Where(clause = "B1_FILIAL = '' AND D_E_L_E_T_='' AND B1_TIPO='MP'") public class Produto

我有两个实体Produto和EnderecoProduto,它们之间存在关系

在我的实体Produto中,我已经拥有一个@Where并且通常有效,但是在我的关系中,当我列出它们时,endereproduto并没有添加到select子句中

Produto:

@Entity
@Table(name = "SB1010")
@Where(clause = "B1_FILIAL = '' AND D_E_L_E_T_='' AND B1_TIPO='MP'")
public class Produto implements Serializable {
注:B1_子代、D_E_L_E_T_、B1_TIPO未映射,但数据库中有

EndereProduto:不使用@Where

@JoinColumn(name = "pro_cod", nullable = false)
@ManyToOne
@Where(clause = "B1_FILIAL = '' AND D_E_L_E_T_='' AND B1_TIPO='MP'")
private Produto pro_cod;
我该怎么做才能使该条件在所有具有Produto的关系中得到验证,而不仅仅是在实体本身上