You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: HibernateSpringBootCalculatePropertyGenerated/README.md
+2
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,7 @@
3
3
**Description:** This application is an example of calculating an entity persistent property at `INSERT` and/or `UPDATE ` time via Hibernate, `@Generated`.
4
4
5
5
**Key points:**\
6
+
6
7
**Calculate at `INSERT` time:**
7
8
- annotate the corresponding persistent field with `@Generated(value = GenerationTime.INSERT)`
8
9
- annotate the corresponding persistent field with `@Column(insertable = false)`\
@@ -12,6 +13,7 @@
12
13
- annotate the corresponding persistent field with `@Column(insertable = false, updatable = false)`
13
14
14
15
**Further, apply:**\
16
+
15
17
**Method 1:**
16
18
- if the database schema is generated via JPA annotations (not recommended) then use `columnDefinition` element of `@Column` to specify as an SQL query expression the formula for calculating the persistent property\
0 commit comments