@@ -1368,8 +1368,7 @@ defaults to "id", just as in one-to-one or many-to-one mappings.
13681368
13691369Additionally, when using typed properties with Doctrine 2.9 or newer
13701370you can skip ``targetEntity `` in ``ManyToOne `` and ``OneToOne ``
1371- associations as they will be set based on type. Also ``nullable ``
1372- attribute on ``JoinColumn `` will be inherited from PHP type. So that:
1371+ associations as they will be set based on type. So that:
13731372
13741373.. configuration-block ::
13751374
@@ -1409,7 +1408,7 @@ Is essentially the same as following:
14091408 <?php
14101409 /** One Product has One Shipment. */
14111410 #[OneToOne(targetEntity: Shipment::class)]
1412- #[JoinColumn(name: 'shipment_id', referencedColumnName: 'id', nullable: false )]
1411+ #[JoinColumn(name: 'shipment_id', referencedColumnName: 'id')]
14131412 private Shipment $shipment;
14141413
14151414 .. code-block :: annotation
@@ -1418,7 +1417,7 @@ Is essentially the same as following:
14181417 /**
14191418 * One Product has One Shipment.
14201419 * @OneToOne(targetEntity="Shipment")
1421- * @JoinColumn(name="shipment_id", referencedColumnName="id", nullable=false )
1420+ * @JoinColumn(name="shipment_id", referencedColumnName="id")
14221421 */
14231422 private Shipment $shipment;
14241423
@@ -1442,7 +1441,6 @@ Is essentially the same as following:
14421441 joinColumn :
14431442 name : shipment_id
14441443 referencedColumnName : id
1445- nullable : false
14461444
14471445 If you accept these defaults, you can reduce the mapping code to a
14481446minimum.
0 commit comments