Hibernate Note

Reading time ~1 minute

This note is about the problems that I met while using Hibernate.

分享到: 微信 微博 更多

Generated Value

@Id
@GeneratedValue(generator = "uuid")
@GenericGenerator(name = "uuid", strategy = "uuid2")

Mapping

// One to one
@OneToOne(cascade = {CascadeType.PERSIST, CascadeType.REFRESH})
@JoinColumn(name = "memberId")
  • CascadeType.PERSIST : means that save() or persist() operations cascade to related entities.
  • CascadeType.MERGE : means that related entities are merged into managed state when the owning entity is merged.
  • CascadeType.REFRESH : does the same thing for the refresh() operation.
  • CascadeType.REMOVE : removes all related entities association with this setting when the owning entity is deleted.
  • CascadeType.DETACH : detaches all related entities if a “manual detach” occurs.
  • CascadeType.ALL : is shorthand for all of the above cascade operations.

竟然无法拒绝你的打赏

微信支付

专业处理中国护照照片一次通过

专业处理中国护照照片一次通过 Continue reading

Python Notes

Published on April 01, 2021

Scrum Training Notes

Published on December 01, 2020