@@ -81,8 +81,7 @@ public PersistentPropertyPathExtension(
81
81
this .path = path ;
82
82
}
83
83
84
- public static boolean isWritable (PersistentPropertyPath <? extends RelationalPersistentProperty > path ) {
85
-
84
+ public static boolean isWritable (@ Nullable PersistentPropertyPath <? extends RelationalPersistentProperty > path ) {
86
85
return path == null || path .getLeafProperty ().isWritable () && isWritable (path .getParentPath ());
87
86
}
88
87
@@ -92,7 +91,7 @@ public static boolean isWritable(PersistentPropertyPath<? extends RelationalPers
92
91
* @return if the leaf property is embedded.
93
92
*/
94
93
public boolean isEmbedded () {
95
- return path != null && path .getRequiredLeafProperty ().isEmbedded ();
94
+ return path != null && path .getLeafProperty ().isEmbedded ();
96
95
}
97
96
98
97
/**
@@ -123,8 +122,8 @@ public PersistentPropertyPathExtension getParentPath() {
123
122
public boolean isMultiValued () {
124
123
125
124
return path != null && //
126
- (path .getRequiredLeafProperty ().isCollectionLike () //
127
- || path .getRequiredLeafProperty ().isQualified () //
125
+ (path .getLeafProperty ().isCollectionLike () //
126
+ || path .getLeafProperty ().isQualified () //
128
127
|| getParentPath ().isMultiValued () //
129
128
);
130
129
}
@@ -136,7 +135,7 @@ public boolean isMultiValued() {
136
135
*/
137
136
@ Nullable
138
137
public RelationalPersistentEntity <?> getLeafEntity () {
139
- return path == null ? entity : context .getPersistentEntity (path .getRequiredLeafProperty ().getActualType ());
138
+ return path == null ? entity : context .getPersistentEntity (path .getLeafProperty ().getActualType ());
140
139
}
141
140
142
141
/**
@@ -157,7 +156,7 @@ public RelationalPersistentEntity<?> getRequiredLeafEntity() {
157
156
throw new IllegalStateException ("Couldn't resolve leaf PersistentEntity absent path" );
158
157
}
159
158
throw new IllegalStateException (String .format ("Couldn't resolve leaf PersistentEntity for type %s" ,
160
- path .getRequiredLeafProperty ().getActualType ()));
159
+ path .getLeafProperty ().getActualType ()));
161
160
}
162
161
163
162
return entity ;
@@ -167,21 +166,21 @@ public RelationalPersistentEntity<?> getRequiredLeafEntity() {
167
166
* @return {@literal true} when this is an empty path or the path references an entity.
168
167
*/
169
168
public boolean isEntity () {
170
- return path == null || path .getRequiredLeafProperty ().isEntity ();
169
+ return path == null || path .getLeafProperty ().isEntity ();
171
170
}
172
171
173
172
/**
174
173
* @return {@literal true} when this is references a {@link java.util.List} or {@link java.util.Map}.
175
174
*/
176
175
public boolean isQualified () {
177
- return path != null && path .getRequiredLeafProperty ().isQualified ();
176
+ return path != null && path .getLeafProperty ().isQualified ();
178
177
}
179
178
180
179
/**
181
180
* @return {@literal true} when this is references a {@link java.util.Collection} or an array.
182
181
*/
183
182
public boolean isCollectionLike () {
184
- return path != null && path .getRequiredLeafProperty ().isCollectionLike ();
183
+ return path != null && path .getLeafProperty ().isCollectionLike ();
185
184
}
186
185
187
186
/**
@@ -192,7 +191,7 @@ public boolean isCollectionLike() {
192
191
public SqlIdentifier getReverseColumnName () {
193
192
194
193
Assert .state (path != null , "Empty paths don't have a reverse column name" );
195
- return path .getRequiredLeafProperty ().getReverseColumnName (this );
194
+ return path .getLeafProperty ().getReverseColumnName (this );
196
195
}
197
196
198
197
/**
@@ -214,7 +213,7 @@ public SqlIdentifier getColumnName() {
214
213
215
214
Assert .state (path != null , "Path is null" );
216
215
217
- return assembleColumnName (path .getRequiredLeafProperty ().getColumnName ());
216
+ return assembleColumnName (path .getLeafProperty ().getColumnName ());
218
217
}
219
218
220
219
/**
@@ -341,7 +340,7 @@ public RelationalPersistentProperty getRequiredIdProperty() {
341
340
*/
342
341
@ Nullable
343
342
public SqlIdentifier getQualifierColumn () {
344
- return path == null ? SqlIdentifier .EMPTY : path .getRequiredLeafProperty ().getKeyColumn ();
343
+ return path == null ? SqlIdentifier .EMPTY : path .getLeafProperty ().getKeyColumn ();
345
344
}
346
345
347
346
/**
@@ -351,7 +350,7 @@ public SqlIdentifier getQualifierColumn() {
351
350
*/
352
351
@ Nullable
353
352
public Class <?> getQualifierColumnType () {
354
- return path == null ? null : path .getRequiredLeafProperty ().getQualifierColumnType ();
353
+ return path == null ? null : path .getLeafProperty ().getQualifierColumnType ();
355
354
}
356
355
357
356
/**
@@ -385,23 +384,23 @@ public Class<?> getActualType() {
385
384
386
385
return path == null //
387
386
? entity .getType () //
388
- : path .getRequiredLeafProperty ().getActualType ();
387
+ : path .getLeafProperty ().getActualType ();
389
388
}
390
389
391
390
/**
392
391
* @return whether the leaf end of the path is ordered, i.e. the data to populate must be ordered.
393
392
* @see RelationalPersistentProperty#isOrdered()
394
393
*/
395
394
public boolean isOrdered () {
396
- return path != null && path .getRequiredLeafProperty ().isOrdered ();
395
+ return path != null && path .getLeafProperty ().isOrdered ();
397
396
}
398
397
399
398
/**
400
399
* @return {@literal true} if the leaf property of this path is a {@link java.util.Map}.
401
400
* @see RelationalPersistentProperty#isMap()
402
401
*/
403
402
public boolean isMap () {
404
- return path != null && path .getRequiredLeafProperty ().isMap ();
403
+ return path != null && path .getLeafProperty ().isMap ();
405
404
}
406
405
407
406
/**
@@ -433,7 +432,7 @@ private SqlIdentifier assembleTableAlias() {
433
432
434
433
Assert .state (path != null , "Path is null" );
435
434
436
- RelationalPersistentProperty leafProperty = path .getRequiredLeafProperty ();
435
+ RelationalPersistentProperty leafProperty = path .getLeafProperty ();
437
436
String prefix ;
438
437
if (isEmbedded ()) {
439
438
prefix = leafProperty .getEmbeddedPrefix ();
@@ -468,7 +467,7 @@ private SqlIdentifier assembleColumnName(SqlIdentifier suffix) {
468
467
}
469
468
470
469
PersistentPropertyPath <? extends RelationalPersistentProperty > parentPath = path .getParentPath ();
471
- RelationalPersistentProperty parentLeaf = parentPath .getRequiredLeafProperty ();
470
+ RelationalPersistentProperty parentLeaf = parentPath .getLeafProperty ();
472
471
473
472
if (!parentLeaf .isEmbedded ()) {
474
473
return suffix ;
0 commit comments