@@ -47,9 +47,9 @@ public interface PersistentEntity<T, P extends PersistentProperty<P>> extends It
47
47
* Returns the {@link PreferredConstructor} to be used to instantiate objects of this {@link PersistentEntity}.
48
48
*
49
49
* @return {@literal null} in case no suitable constructor for automatic construction can be found. This usually
50
- * indicates that the instantiation of the object of that persistent entity is done through either a
51
- * customer {@link org.springframework.data.mapping.model.EntityInstantiator} or handled by custom
52
- * conversion mechanisms entirely.
50
+ * indicates that the instantiation of the object of that persistent entity is done through either a customer
51
+ * {@link org.springframework.data.mapping.model.EntityInstantiator} or handled by custom conversion
52
+ * mechanisms entirely.
53
53
* @deprecated since 3.0, use {@link #getInstanceCreatorMetadata()}.
54
54
*/
55
55
@ Nullable
@@ -61,8 +61,8 @@ public interface PersistentEntity<T, P extends PersistentProperty<P>> extends It
61
61
*
62
62
* @return {@literal null} in case no suitable creation mechanism for automatic construction can be found. This
63
63
* usually indicates that the instantiation of the object of that persistent entity is done through either a
64
- * customer {@link org.springframework.data.mapping.model.EntityInstantiator} or handled by custom
65
- * conversion mechanisms entirely.
64
+ * customer {@link org.springframework.data.mapping.model.EntityInstantiator} or handled by custom conversion
65
+ * mechanisms entirely.
66
66
* @since 3.0
67
67
*/
68
68
@ Nullable
@@ -136,17 +136,17 @@ default P getRequiredIdProperty() {
136
136
}
137
137
138
138
/**
139
- * Returns the version property of the {@link PersistentEntity}. Can be {@literal null} in case no version property
140
- * is available on the entity.
139
+ * Returns the version property of the {@link PersistentEntity}. Can be {@literal null} in case no version property is
140
+ * available on the entity.
141
141
*
142
142
* @return the version property of the {@link PersistentEntity}.
143
143
*/
144
144
@ Nullable
145
145
P getVersionProperty ();
146
146
147
147
/**
148
- * Returns the version property of the {@link PersistentEntity}. Can be {@literal null} in case no version property
149
- * is available on the entity.
148
+ * Returns the version property of the {@link PersistentEntity}. Can be {@literal null} in case no version property is
149
+ * available on the entity.
150
150
*
151
151
* @return the version property of the {@link PersistentEntity}.
152
152
* @throws IllegalStateException if {@link PersistentEntity} does not define a {@literal version} property.
@@ -166,7 +166,7 @@ default P getRequiredVersionProperty() {
166
166
/**
167
167
* Obtains a {@link PersistentProperty} instance by name.
168
168
*
169
- * @param name The name of the property. Can be {@literal null}.
169
+ * @param name the name of the property. Can be {@literal null}.
170
170
* @return the {@link PersistentProperty} or {@literal null} if it doesn't exist.
171
171
*/
172
172
@ Nullable
@@ -213,6 +213,28 @@ default P getPersistentProperty(Class<? extends Annotation> annotationType) {
213
213
*/
214
214
Iterable <P > getPersistentProperties (Class <? extends Annotation > annotationType );
215
215
216
+ /**
217
+ * Obtains a transient {@link PersistentProperty} instance by name. You can check with {@link #isTransient(String)}
218
+ * whether there is a transient property before calling this method.
219
+ *
220
+ * @param name the name of the property. Can be {@literal null}.
221
+ * @return the {@link PersistentProperty} or {@literal null} if it doesn't exist.
222
+ * @since 3.3
223
+ * @see #isTransient(String)
224
+ */
225
+ @ Nullable
226
+ P getTransientProperty (String name );
227
+
228
+ /**
229
+ * Returns whether the property is transient.
230
+ *
231
+ * @param property name of the property.
232
+ * @return {@code true} if the property is transient. Applies only for existing properties. {@code false} if the
233
+ * property does not exist or is not transient.
234
+ * @since 3.3
235
+ */
236
+ boolean isTransient (String property );
237
+
216
238
/**
217
239
* Returns whether the {@link PersistentEntity} has an id property. If this call returns {@literal true},
218
240
* {@link #getIdProperty()} will return a non-{@literal null} value.
@@ -237,8 +259,8 @@ default P getPersistentProperty(Class<? extends Annotation> annotationType) {
237
259
Class <T > getType ();
238
260
239
261
/**
240
- * Returns the alias to be used when storing type information. Might be {@literal null} to indicate that there was
241
- * no alias defined through the mapping metadata.
262
+ * Returns the alias to be used when storing type information. Might be {@literal null} to indicate that there was no
263
+ * alias defined through the mapping metadata.
242
264
*
243
265
* @return
244
266
*/
@@ -268,8 +290,8 @@ default P getPersistentProperty(Class<? extends Annotation> annotationType) {
268
290
void doWithProperties (SimplePropertyHandler handler );
269
291
270
292
/**
271
- * Applies the given {@link AssociationHandler} to all {@link Association} contained in this
272
- * {@link PersistentEntity}. The iteration order is undefined.
293
+ * Applies the given {@link AssociationHandler} to all {@link Association} contained in this {@link PersistentEntity}.
294
+ * The iteration order is undefined.
273
295
*
274
296
* @param handler must not be {@literal null}.
275
297
*/
@@ -284,8 +306,8 @@ default P getPersistentProperty(Class<? extends Annotation> annotationType) {
284
306
void doWithAssociations (SimpleAssociationHandler handler );
285
307
286
308
/**
287
- * Applies the given {@link PropertyHandler} to both all {@link PersistentProperty}s as well as all inverse
288
- * properties of all {@link Association}s. The iteration order is undefined.
309
+ * Applies the given {@link PropertyHandler} to both all {@link PersistentProperty}s as well as all inverse properties
310
+ * of all {@link Association}s. The iteration order is undefined.
289
311
*
290
312
* @param handler must not be {@literal null}.
291
313
* @since 2.5
@@ -370,7 +392,7 @@ default <A extends Annotation> A getRequiredAnnotation(Class<A> annotationType)
370
392
*
371
393
* @param bean must not be {@literal null}.
372
394
* @throws IllegalArgumentException in case the given bean is not an instance of the typ represented by the
373
- * {@link PersistentEntity}.
395
+ * {@link PersistentEntity}.
374
396
* @return whether the given bean is considered a new instance.
375
397
*/
376
398
boolean isNew (Object bean );
@@ -386,8 +408,8 @@ default <A extends Annotation> A getRequiredAnnotation(Class<A> annotationType)
386
408
boolean isImmutable ();
387
409
388
410
/**
389
- * Returns whether the entity needs properties to be populated, i.e. if any property exists that's not initialized
390
- * by the constructor.
411
+ * Returns whether the entity needs properties to be populated, i.e. if any property exists that's not initialized by
412
+ * the constructor.
391
413
*
392
414
* @return
393
415
* @since 2.1
0 commit comments