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: README.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ Include the Maven artifact:
20
20
<dependency>
21
21
<groupId>com.github.collinalpert</groupId>
22
22
<artifactId>java2db</artifactId>
23
-
<version>5.2.1</version>
23
+
<version>5.3.0</version>
24
24
</dependency>
25
25
```
26
26
Or include the [JAR](https://github.com/CollinAlpert/Java2DB/releases/latest) in your project.
@@ -213,7 +213,8 @@ public class Person extends BaseEntity {
213
213
### Default database values
214
214
If you would like to use the database-set default value for POJO fields which are null when creating or modifying data on the database, you need to annotate the specific field with the ```DefaultIfNull``` annotation.
215
215
You then have the additional option to specify if this behavior should occur on create or update statements, or both.
216
-
When the annotation is specified, per default the default database value is used on create statements, but not on update ones.
216
+
When the annotation is specified, per default the default database value is used on create statements, but not on update ones.\
217
+
If you __always__ want Java2DB to use your database-default value, regardless if `null` or not, simply use the `Default` annotation.
217
218
218
219
### Column name deviations
219
220
To be able to target any column naming conventions, it is possible to explicitly tell Java2DB which table column a POJO field targets with the `@ColumnName` attribute. Simply apply the attribute to a field.
* This annotation tells Java2DB to always use the database-default for a column on create or update. Not to be confused with the {@link DefaultIfNull} annotation.
0 commit comments