File tree Expand file tree Collapse file tree 3 files changed +10
-6
lines changed
hibernate-core/src/main/java/org/hibernate/metamodel Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -302,7 +302,7 @@ protected boolean finishInitialization(
302
302
scale = null ;
303
303
nullable = true ;
304
304
isLob = false ;
305
- selectablePath = basicValue . createSelectablePath ( bootPropertyDescriptor .getName () );
305
+ selectablePath = new SelectablePath ( determineEmbeddablePrefix () + bootPropertyDescriptor .getName () );
306
306
}
307
307
308
308
attributeMapping = MappingModelCreationHelper .buildBasicAttributeMapping (
@@ -453,6 +453,14 @@ else if ( subtype instanceof EntityType ) {
453
453
return true ;
454
454
}
455
455
456
+ protected String determineEmbeddablePrefix () {
457
+ NavigableRole root = getNavigableRole ().getParent ();
458
+ while ( !root .isRoot () ) {
459
+ root = root .getParent ();
460
+ }
461
+ return getNavigableRole ().getFullPath ().substring ( root .getFullPath ().length () + 1 ) + "." ;
462
+ }
463
+
456
464
@ Override
457
465
public int getNumberOfFetchables () {
458
466
return getAttributeMappings ().size ();
Original file line number Diff line number Diff line change @@ -398,7 +398,7 @@ private boolean finishInitialization(
398
398
scale = null ;
399
399
isLob = false ;
400
400
nullable = bootPropertyDescriptor .isOptional ();
401
- selectablePath = basicValue . createSelectablePath ( bootPropertyDescriptor .getName () );
401
+ selectablePath = new SelectablePath ( determineEmbeddablePrefix () + bootPropertyDescriptor .getName () );
402
402
}
403
403
attributeMapping = MappingModelCreationHelper .buildBasicAttributeMapping (
404
404
bootPropertyDescriptor .getName (),
Original file line number Diff line number Diff line change @@ -106,10 +106,6 @@ public String getFullPath() {
106
106
return fullPath ;
107
107
}
108
108
109
- public boolean isRoot () {
110
- return parent == null && StringHelper .isEmpty ( localName );
111
- }
112
-
113
109
@ Override
114
110
public String toString () {
115
111
return getClass ().getSimpleName () + '[' + fullPath + ']' ;
You can’t perform that action at this time.
0 commit comments