Skip to content

Commit 652a1f3

Browse files
Calculate Entity Persistent Property
1 parent 5b5584e commit 652a1f3

File tree

1 file changed

+3
-3
lines changed
  • HibernateSpringBootCalculatePropertyGenerated

1 file changed

+3
-3
lines changed

HibernateSpringBootCalculatePropertyGenerated/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
**Key points:**\
66
**Calculate at `INSERT` time:**
77
- annotate the corresponding persistent field with `@Generated(value = GenerationTime.INSERT)`
8-
- annotate the corresponding persistent field with `@Column(insertable = false)`
9-
**Calculate at `INSERT` and `UPDATE` time:**\
8+
- annotate the corresponding persistent field with `@Column(insertable = false)`\
9+
**Calculate at `INSERT` and `UPDATE` time:**
1010
- annotate the corresponding persistent field with `@Generated(value = GenerationTime.ALWAYS)`
1111
- annotate the corresponding persistent field with `@Column(insertable = false, updatable = false)`
1212

1313
**Further, apply:**\
1414
**Method 1:**
15-
- 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
15+
- 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\
1616
**Method 2:**
1717
- if the database schema is not generated via JPA annotations (recommended way) then add the formula as part of schema in `CREATE TABLE`
1818

0 commit comments

Comments
 (0)