@@ -361,6 +361,7 @@ else if ( type.isEntityType() ) {
361
361
columns ,
362
362
columnReaders ,
363
363
columnReaderTemplates ,
364
+ formulaTemplates != null && formulaTemplates .length > 0 ? formulaTemplates : null ,
364
365
factory
365
366
);
366
367
}
@@ -373,6 +374,17 @@ protected void initIdentifierPropertyPaths(
373
374
final String [] columnReaders ,
374
375
final String [] columnReaderTemplates ,
375
376
final Mapping factory ) throws MappingException {
377
+ initIdentifierPropertyPaths (path , etype , columns , columnReaders , columnReaderTemplates , null , factory );
378
+ }
379
+
380
+ protected void initIdentifierPropertyPaths (
381
+ final String path ,
382
+ final EntityType etype ,
383
+ final String [] columns ,
384
+ final String [] columnReaders ,
385
+ final String [] columnReaderTemplates ,
386
+ final String [] formulaTemplates ,
387
+ final Mapping factory ) throws MappingException {
376
388
377
389
Type idtype = etype .getIdentifierOrUniqueKeyType ( factory );
378
390
String idPropName = etype .getIdentifierOrUniqueKeyPropertyName ( factory );
@@ -381,15 +393,15 @@ protected void initIdentifierPropertyPaths(
381
393
if ( etype .isReferenceToPrimaryKey () ) {
382
394
if ( !hasNonIdentifierPropertyNamedId ) {
383
395
String idpath1 = extendPath ( path , EntityPersister .ENTITY_ID );
384
- addPropertyPath ( idpath1 , idtype , columns , columnReaders , columnReaderTemplates , null , factory );
385
- initPropertyPaths ( idpath1 , idtype , columns , columnReaders , columnReaderTemplates , null , factory );
396
+ addPropertyPath ( idpath1 , idtype , columns , columnReaders , columnReaderTemplates , formulaTemplates , factory );
397
+ initPropertyPaths ( idpath1 , idtype , columns , columnReaders , columnReaderTemplates , formulaTemplates , factory );
386
398
}
387
399
}
388
400
389
401
if ( (! etype .isNullable () ) && idPropName != null ) {
390
402
String idpath2 = extendPath ( path , idPropName );
391
- addPropertyPath ( idpath2 , idtype , columns , columnReaders , columnReaderTemplates , null , factory );
392
- initPropertyPaths ( idpath2 , idtype , columns , columnReaders , columnReaderTemplates , null , factory );
403
+ addPropertyPath ( idpath2 , idtype , columns , columnReaders , columnReaderTemplates , formulaTemplates , factory );
404
+ initPropertyPaths ( idpath2 , idtype , columns , columnReaders , columnReaderTemplates , formulaTemplates , factory );
393
405
}
394
406
}
395
407
0 commit comments