Skip to content

Commit 8afaa63

Browse files
committed
Add a recommendation not to use multiple private fields of the same name in entity hierarchies
1 parent a939dc2 commit 8afaa63

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

docs/en/reference/limitations-and-known-issues.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,14 @@ internally by the ORM currently refers to fields by their name only, without tak
187187
class containing the field into consideration. This makes it impossible to keep separate
188188
mapping configuration for both fields.
189189

190+
Apart from that, in the case of having multiple ``private`` fields of the same name within
191+
the class hierarchy an entity or mapped superclass, the Collection filtering API cannot determine
192+
the right field to look at. Even if only one of these fields is actually mapped, the ``ArrayCollection``
193+
will not be able to tell, since it does not have access to any metadata.
194+
195+
Thus, to avoid problems in this regard, it is best to avoid having multiple ``private`` fields of the
196+
same name in class hierarchies containing entity and mapped superclasses.
197+
190198
Known Issues
191199
------------
192200

0 commit comments

Comments
 (0)