File tree 4 files changed +42
-2
lines changed
data/QueryResult/Entities
4 files changed +42
-2
lines changed Original file line number Diff line number Diff line change @@ -550,6 +550,7 @@ public function walkFunction($function)
550
550
}
551
551
552
552
$ nullable = ($ joinColumn ['nullable ' ] ?? true )
553
+ || $ this ->isQueryComponentNullable ($ dqlAlias )
553
554
|| $ this ->hasAggregateWithoutGroupBy ();
554
555
555
556
$ fieldType = $ this ->resolveDatabaseInternalType ($ typeName , $ enumType , $ nullable );
Original file line number Diff line number Diff line change @@ -1377,6 +1377,7 @@ public function getTestData(): iterable
1377
1377
[new ConstantIntegerType (6 ), TypeCombinator::addNull ($ this ->numericStringOrInt ())],
1378
1378
[new ConstantIntegerType (7 ), TypeCombinator::addNull (new MixedType ())],
1379
1379
[new ConstantIntegerType (8 ), TypeCombinator::addNull ($ this ->numericStringOrInt ())],
1380
+ [new ConstantIntegerType (9 ), TypeCombinator::addNull ($ this ->numericStringOrInt ())],
1380
1381
]),
1381
1382
'
1382
1383
SELECT IDENTITY(m.oneNull),
@@ -1386,8 +1387,10 @@ public function getTestData(): iterable
1386
1387
IDENTITY(m.compoundPk, \'id \'),
1387
1388
IDENTITY(m.compoundPk, \'version \'),
1388
1389
IDENTITY(m.compoundPkAssoc),
1389
- IDENTITY(m.compoundPkAssoc, \'version \')
1390
+ IDENTITY(m.compoundPkAssoc, \'version \'),
1391
+ IDENTITY(o.subOne)
1390
1392
FROM QueryResult\Entities\Many m
1393
+ LEFT JOIN m.oneNull o
1391
1394
' ,
1392
1395
];
1393
1396
Original file line number Diff line number Diff line change 8
8
use Doctrine \ORM \Mapping \Entity ;
9
9
use Doctrine \ORM \Mapping \Id ;
10
10
use Doctrine \ORM \Mapping \JoinColumn ;
11
- use Doctrine \ORM \Mapping \ManyToOne ;
12
11
use Doctrine \ORM \Mapping \OneToMany ;
12
+ use Doctrine \ORM \Mapping \OneToOne ;
13
13
14
14
/**
15
15
* @Entity
@@ -45,6 +45,14 @@ class One
45
45
*/
46
46
public $ stringNullColumn ;
47
47
48
+ /**
49
+ * @OneToOne(targetEntity="QueryResult\Entities\SubOne", cascade={"persist"})
50
+ * @JoinColumn(nullable=false)
51
+ *
52
+ * @var SubOne
53
+ */
54
+ public $ subOne ;
55
+
48
56
/**
49
57
* @OneToMany(targetEntity="QueryResult\Entities\Many", mappedBy="one")
50
58
*
@@ -58,4 +66,9 @@ class One
58
66
* @var Embedded
59
67
*/
60
68
public $ embedded ;
69
+
70
+ public function __construct ()
71
+ {
72
+ $ this ->subOne = new SubOne ();
73
+ }
61
74
}
Original file line number Diff line number Diff line change
1
+ <?php declare (strict_types=1 );
2
+
3
+ namespace QueryResult \Entities ;
4
+
5
+ use Doctrine \ORM \Mapping \Column ;
6
+ use Doctrine \ORM \Mapping \Entity ;
7
+ use Doctrine \ORM \Mapping \Id ;
8
+ use Doctrine \ORM \Mapping \GeneratedValue ;
9
+
10
+ /**
11
+ * @Entity
12
+ */
13
+ class SubOne
14
+ {
15
+ /**
16
+ * @GeneratedValue()
17
+ * @Column(type="integer")
18
+ * @Id
19
+ *
20
+ * @var string
21
+ */
22
+ public $ id ;
23
+ }
You can’t perform that action at this time.
0 commit comments