@@ -1368,8 +1368,7 @@ defaults to "id", just as in one-to-one or many-to-one mappings.
1368
1368
1369
1369
Additionally, when using typed properties with Doctrine 2.9 or newer
1370
1370
you 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:
1373
1372
1374
1373
.. configuration-block ::
1375
1374
@@ -1409,7 +1408,7 @@ Is essentially the same as following:
1409
1408
<?php
1410
1409
/** One Product has One Shipment. */
1411
1410
#[OneToOne(targetEntity: Shipment::class)]
1412
- #[JoinColumn(name: 'shipment_id', referencedColumnName: 'id', nullable: false )]
1411
+ #[JoinColumn(name: 'shipment_id', referencedColumnName: 'id')]
1413
1412
private Shipment $shipment;
1414
1413
1415
1414
.. code-block :: annotation
@@ -1418,7 +1417,7 @@ Is essentially the same as following:
1418
1417
/**
1419
1418
* One Product has One Shipment.
1420
1419
* @OneToOne(targetEntity="Shipment")
1421
- * @JoinColumn(name="shipment_id", referencedColumnName="id", nullable=false )
1420
+ * @JoinColumn(name="shipment_id", referencedColumnName="id")
1422
1421
*/
1423
1422
private Shipment $shipment;
1424
1423
@@ -1442,7 +1441,6 @@ Is essentially the same as following:
1442
1441
joinColumn :
1443
1442
name : shipment_id
1444
1443
referencedColumnName : id
1445
- nullable : false
1446
1444
1447
1445
If you accept these defaults, you can reduce the mapping code to a
1448
1446
minimum.
0 commit comments