Skip to content

Commit 9aec113

Browse files
committed
Polish Javadoc of PersistentEntity regarding iteration order of PersistentProperty instances.
Fixes #2814.
1 parent d725a55 commit 9aec113

File tree

1 file changed

+27
-14
lines changed

1 file changed

+27
-14
lines changed

src/main/java/org/springframework/data/mapping/PersistentEntity.java

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import org.springframework.util.Assert;
2525

2626
/**
27-
* Represents a persistent entity.
27+
* Represents a persistent entity. The order of the properties returned via the {@link Iterator} is not guaranteed.
2828
*
2929
* @author Oliver Gierke
3030
* @author Graeme Rocher
@@ -136,17 +136,17 @@ default P getRequiredIdProperty() {
136136
}
137137

138138
/**
139-
* Returns the version property of the {@link PersistentEntity}. Can be {@literal null} in case no version property is
140-
* available on the entity.
139+
* Returns the version property of the {@link PersistentEntity}. Can be {@literal null} in case no version property
140+
* is available on the entity.
141141
*
142142
* @return the version property of the {@link PersistentEntity}.
143143
*/
144144
@Nullable
145145
P getVersionProperty();
146146

147147
/**
148-
* Returns the version property of the {@link PersistentEntity}. Can be {@literal null} in case no version property is
149-
* available on the entity.
148+
* Returns the version property of the {@link PersistentEntity}. Can be {@literal null} in case no version property
149+
* is available on the entity.
150150
*
151151
* @return the version property of the {@link PersistentEntity}.
152152
* @throws IllegalStateException if {@link PersistentEntity} does not define a {@literal version} property.
@@ -237,8 +237,8 @@ default P getPersistentProperty(Class<? extends Annotation> annotationType) {
237237
Class<T> getType();
238238

239239
/**
240-
* Returns the alias to be used when storing type information. Might be {@literal null} to indicate that there was no
241-
* alias defined through the mapping metadata.
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.
242242
*
243243
* @return
244244
*/
@@ -253,26 +253,39 @@ default P getPersistentProperty(Class<? extends Annotation> annotationType) {
253253

254254
/**
255255
* Applies the given {@link PropertyHandler} to all {@link PersistentProperty}s contained in this
256-
* {@link PersistentEntity}.
256+
* {@link PersistentEntity}. The iteration order is undefined.
257257
*
258258
* @param handler must not be {@literal null}.
259259
*/
260260
void doWithProperties(PropertyHandler<P> handler);
261261

262+
/**
263+
* Applies the given {@link SimplePropertyHandler} to all {@link PersistentProperty}s contained in this
264+
* {@link PersistentEntity}. The iteration order is undefined.
265+
*
266+
* @param handler must not be {@literal null}.
267+
*/
262268
void doWithProperties(SimplePropertyHandler handler);
263269

264270
/**
265-
* Applies the given {@link AssociationHandler} to all {@link Association} contained in this {@link PersistentEntity}.
271+
* Applies the given {@link AssociationHandler} to all {@link Association} contained in this
272+
* {@link PersistentEntity}. The iteration order is undefined.
266273
*
267274
* @param handler must not be {@literal null}.
268275
*/
269276
void doWithAssociations(AssociationHandler<P> handler);
270277

278+
/**
279+
* Applies the given {@link SimpleAssociationHandler} to all {@link Association} contained in this
280+
* {@link PersistentEntity}. The iteration order is undefined.
281+
*
282+
* @param handler must not be {@literal null}.
283+
*/
271284
void doWithAssociations(SimpleAssociationHandler handler);
272285

273286
/**
274-
* Applies the given {@link PropertyHandler} to both all {@link PersistentProperty}s as well as all inverse properties
275-
* of all {@link Association}s.
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.
276289
*
277290
* @param handler must not be {@literal null}.
278291
* @since 2.5
@@ -357,7 +370,7 @@ default <A extends Annotation> A getRequiredAnnotation(Class<A> annotationType)
357370
*
358371
* @param bean must not be {@literal null}.
359372
* @throws IllegalArgumentException in case the given bean is not an instance of the typ represented by the
360-
* {@link PersistentEntity}.
373+
* {@link PersistentEntity}.
361374
* @return whether the given bean is considered a new instance.
362375
*/
363376
boolean isNew(Object bean);
@@ -373,8 +386,8 @@ default <A extends Annotation> A getRequiredAnnotation(Class<A> annotationType)
373386
boolean isImmutable();
374387

375388
/**
376-
* Returns whether the entity needs properties to be populated, i.e. if any property exists that's not initialized by
377-
* the constructor.
389+
* Returns whether the entity needs properties to be populated, i.e. if any property exists that's not initialized
390+
* by the constructor.
378391
*
379392
* @return
380393
* @since 2.1

0 commit comments

Comments
 (0)