1
我有一個實體誰有boolean
財產。如何使用CriteriaUpdate設置true?
class MyEntity {
@Basic(optional = false)
@Column(name = "FLAG")
private boolean flag;
}
我怎麼能執行批量更新設置flag
場true
?
// UPDATE MyEntity AS e SET e.flag = TRUE
final CriteriaBuilder builder = entityManager.getCriteriaBuilder();
final CriteriaUpdate<MyEntity> update
= builder.createCriteriaUpdate(MyEntity.class);
final Root<MyEntity> root = criteriaUpdate.from(MyEntity.class);
update.set(root.get(ProfileClue_.flag), ???);