hibernate
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| hibernate [2023/07/14 12:04] – [Warning: bidirectional relationships] skipidar | hibernate [2023/07/14 12:42] (current) – [Transactional] skipidar | ||
|---|---|---|---|
| Line 224: | Line 224: | ||
| In Spring boot you need to annotate a method with '' | In Spring boot you need to annotate a method with '' | ||
| + | |||
| + | At a high level, Spring creates proxies for all the classes annotated with @Transactional, | ||
| + | |||
| + | https:// | ||
| + | |||
| https:// | https:// | ||
| Line 246: | Line 251: | ||
| </ | </ | ||
| + | |||
| + | |||
| + | ==== ManyToMany with composite key to self ==== | ||
| + | |||
| + | <sxh java> | ||
| + | |||
| + | @ManyToMany(fetch = FetchType.EAGER, | ||
| + | @JoinTable(name=" | ||
| + | joinColumns={ | ||
| + | @JoinColumn( | ||
| + | name = " | ||
| + | referencedColumnName = " | ||
| + | @JoinColumn( | ||
| + | name = " | ||
| + | referencedColumnName = " | ||
| + | }) | ||
| + | private Set< | ||
| + | |||
| + | |||
| + | // Associations marked as mappedBy must not define database mappings like @JoinTable or @JoinColumn | ||
| + | @ManyToMany( cascade = CascadeType.ALL, | ||
| + | private Set< | ||
| + | </ | ||
hibernate.1689336296.txt.gz · Last modified: by skipidar
