File tree 2 files changed +22
-2
lines changed
src/main/java/org/springframework/data/auditing
2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ public class IsNewAwareAuditingHandler extends AuditingHandler {
36
36
private final PersistentEntities entities ;
37
37
38
38
/**
39
- * Creates a new {@link IsNewAwareAuditingHandler} for the given {@link MappingContext }.
39
+ * Creates a new {@link IsNewAwareAuditingHandler} for the given {@link PersistentEntities }.
40
40
*
41
41
* @param entities must not be {@literal null}.
42
42
* @since 1.10
@@ -48,6 +48,16 @@ public IsNewAwareAuditingHandler(PersistentEntities entities) {
48
48
this .entities = entities ;
49
49
}
50
50
51
+ /**
52
+ * Factory method that creates a new {@link IsNewAwareAuditingHandler} for the given {@link MappingContext}.
53
+ *
54
+ * @param mappingContext must not be {@literal null}.
55
+ * @since 3.0
56
+ */
57
+ public static IsNewAwareAuditingHandler from (MappingContext <?,?> mappingContext ) {
58
+ return new IsNewAwareAuditingHandler (PersistentEntities .of (mappingContext ));
59
+ }
60
+
51
61
/**
52
62
* Marks the given object created or modified based on {@link PersistentEntity#isNew(Object)}. Will route the calls to
53
63
* {@link #markCreated(Object)} and {@link #markModified(Object)} accordingly.
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ public class ReactiveIsNewAwareAuditingHandler extends ReactiveAuditingHandler {
37
37
private final PersistentEntities entities ;
38
38
39
39
/**
40
- * Creates a new {@link ReactiveIsNewAwareAuditingHandler} for the given {@link MappingContext }.
40
+ * Creates a new {@link ReactiveIsNewAwareAuditingHandler} for the given {@link PersistentEntities }.
41
41
*
42
42
* @param entities must not be {@literal null}.
43
43
*/
@@ -48,6 +48,16 @@ public ReactiveIsNewAwareAuditingHandler(PersistentEntities entities) {
48
48
this .entities = entities ;
49
49
}
50
50
51
+ /**
52
+ * Factory method that creates a new {@link ReactiveIsNewAwareAuditingHandler} for the given {@link MappingContext}.
53
+ *
54
+ * @param mappingContext must not be {@literal null}.
55
+ * @since 3.0
56
+ */
57
+ public static ReactiveIsNewAwareAuditingHandler from (MappingContext <?,?> mappingContext ) {
58
+ return new ReactiveIsNewAwareAuditingHandler (PersistentEntities .of (mappingContext ));
59
+ }
60
+
51
61
/**
52
62
* Marks the given object created or modified based on {@link PersistentEntity#isNew(Object)}. Will route the calls to
53
63
* {@link #markCreated(Object)} and {@link #markModified(Object)} accordingly.
You can’t perform that action at this time.
0 commit comments