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(
302302 scale = null ;
303303 nullable = true ;
304304 isLob = false ;
305- selectablePath = basicValue . createSelectablePath ( bootPropertyDescriptor .getName () );
305+ selectablePath = new SelectablePath ( determineEmbeddablePrefix () + bootPropertyDescriptor .getName () );
306306 }
307307
308308 attributeMapping = MappingModelCreationHelper .buildBasicAttributeMapping (
@@ -453,6 +453,14 @@ else if ( subtype instanceof EntityType ) {
453453 return true ;
454454 }
455455
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+
456464 @ Override
457465 public int getNumberOfFetchables () {
458466 return getAttributeMappings ().size ();
Original file line number Diff line number Diff line change @@ -398,7 +398,7 @@ private boolean finishInitialization(
398398 scale = null ;
399399 isLob = false ;
400400 nullable = bootPropertyDescriptor .isOptional ();
401- selectablePath = basicValue . createSelectablePath ( bootPropertyDescriptor .getName () );
401+ selectablePath = new SelectablePath ( determineEmbeddablePrefix () + bootPropertyDescriptor .getName () );
402402 }
403403 attributeMapping = MappingModelCreationHelper .buildBasicAttributeMapping (
404404 bootPropertyDescriptor .getName (),
Original file line number Diff line number Diff line change @@ -106,10 +106,6 @@ public String getFullPath() {
106106 return fullPath ;
107107 }
108108
109- public boolean isRoot () {
110- return parent == null && StringHelper .isEmpty ( localName );
111- }
112-
113109 @ Override
114110 public String toString () {
115111 return getClass ().getSimpleName () + '[' + fullPath + ']' ;
You can’t perform that action at this time.
0 commit comments