我使用hibernate 3.5.4-final。我有两个JPA课程。
@Entity
@Table(name = "SPI_V_OP_OBJ_SUBJECT_VR")
public class OpSubject_vr extends PersistenceEntity implements Serializable {
private static final long serialVersionUID = 1858749317461707015L;
/** id */
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "ID",
nullable = false)
private Long id;
/** name */
@Column(name = "F_NAME")
private String f_name;
/** type */
@Column(name = "SUBJECT_TYPE")
private String subject_type;
/** okved */
@ManyToMany
@JoinTable(name = "SPI_V_OP_OBJ_SUBJECT_VR_OKVED",
joinColumns = {@JoinColumn(name = "OBJECT_ID",
referencedColumnName = "ID",
nullable = false)},
inverseJoinColumns = {@JoinColumn(name = "SPR_ID",
referencedColumnName = "ID",
nullable = false)})
private List<OpSprOkved> okved_id_mult = new ArrayList<>();
}
和
@Entity
@Table(name = "SPI_V_OP_SPR_OKVED")
public class OpSprOkved extends PersistenceEntity implements Serializable {
/** id */
@Id
@Column(name = "ID", nullable = false)
private Long id;
/** code*/
@Column(name = "CODE")
private String code;
/** name*/
@Column(name = "name")
private String name;
}
属性okved_id_mult是多个。我想选择具有空属性okved_id_mult的对象OpSubject_vr。
我试过
select ent from OpSubject_vr ent where okved_id_mult is empty; (hibernate error)
select ent from OpSubject_vr ent where okved_id_mult is null; (hibernate error)
select distinct ent from OpSubject_vr ent join ent.okved_id_mult i1 where i1.code is null;(return 0 objects)
答案 0 :(得分:0)
答案 1 :(得分:0)
使用“ not in”运算符。此查询将检查您的“ okved_id_mult.id”是否未出现在所有现有的OpSprOkved.id中:
Vector128<float> mf = Vector128.Create(42f);
Vector128<int> mi = mf.As<int, float>(); // acts as '_mm_castps_si128'