@@ -1468,32 +1468,23 @@ private static void bindDiscriminatorColumnToRootPersistentClass(
1468
1468
1469
1469
/**
1470
1470
* @param elements List of {@code ProperyData} instances
1471
- * @param defaultAccessType The default value access strategy which has to be used in case no explicit local access
1472
- * strategy is used
1473
1471
* @param propertyContainer Metadata about a class and its properties
1474
1472
*
1475
1473
* @return the number of id properties found while iterating the elements of {@code annotatedClass} using
1476
1474
* the determined access strategy, {@code false} otherwise.
1477
1475
*/
1478
1476
static int addElementsOfClass (
1479
1477
List <PropertyData > elements ,
1480
- AccessType defaultAccessType ,
1481
1478
PropertyContainer propertyContainer ,
1482
1479
MetadataBuildingContext context ) {
1483
1480
int idPropertyCounter = 0 ;
1484
- AccessType accessType = defaultAccessType ;
1485
1481
1486
- if ( propertyContainer .hasExplicitAccessStrategy () ) {
1487
- accessType = propertyContainer .getExplicitAccessStrategy ();
1488
- }
1489
-
1490
- Collection <XProperty > properties = propertyContainer .getProperties ( accessType );
1482
+ Collection <XProperty > properties = propertyContainer .getProperties ();
1491
1483
for ( XProperty p : properties ) {
1492
1484
final int currentIdPropertyCounter = addProperty (
1493
1485
propertyContainer ,
1494
1486
p ,
1495
1487
elements ,
1496
- accessType .getType (),
1497
1488
context
1498
1489
);
1499
1490
idPropertyCounter += currentIdPropertyCounter ;
@@ -1505,15 +1496,14 @@ private static int addProperty(
1505
1496
PropertyContainer propertyContainer ,
1506
1497
XProperty property ,
1507
1498
List <PropertyData > annElts ,
1508
- String propertyAccessor ,
1509
1499
MetadataBuildingContext context ) {
1510
1500
final XClass declaringClass = propertyContainer .getDeclaringClass ();
1511
1501
final XClass entity = propertyContainer .getEntityAtStake ();
1512
1502
int idPropertyCounter = 0 ;
1513
1503
PropertyData propertyAnnotatedElement = new PropertyInferredData (
1514
1504
declaringClass ,
1515
1505
property ,
1516
- propertyAccessor ,
1506
+ propertyContainer . getClassLevelAccessType (). getType () ,
1517
1507
context .getBuildingOptions ().getReflectionManager ()
1518
1508
);
1519
1509
@@ -1560,7 +1550,7 @@ else if ( prop.isAnnotationPresent( JoinColumns.class ) ) {
1560
1550
//same dec
1561
1551
prop ,
1562
1552
// the actual @XToOne property
1563
- propertyAccessor ,
1553
+ propertyContainer . getClassLevelAccessType (). getType () ,
1564
1554
//TODO we should get the right accessor but the same as id would do
1565
1555
context .getBuildingOptions ().getReflectionManager ()
1566
1556
);
@@ -2560,24 +2550,24 @@ public static Component fillComponent(
2560
2550
baseClassElements = new ArrayList <PropertyData >();
2561
2551
baseReturnedClassOrElement = baseInferredData .getClassOrElement ();
2562
2552
bindTypeDefs ( baseReturnedClassOrElement , buildingContext );
2563
- PropertyContainer propContainer = new PropertyContainer ( baseReturnedClassOrElement , xClassProcessed );
2564
- addElementsOfClass ( baseClassElements , propertyAccessor , propContainer , buildingContext );
2553
+ PropertyContainer propContainer = new PropertyContainer ( baseReturnedClassOrElement , xClassProcessed , propertyAccessor );
2554
+ addElementsOfClass ( baseClassElements , propContainer , buildingContext );
2565
2555
for ( PropertyData element : baseClassElements ) {
2566
2556
orderedBaseClassElements .put ( element .getPropertyName (), element );
2567
2557
}
2568
2558
}
2569
2559
2570
2560
//embeddable elements can have type defs
2571
2561
bindTypeDefs ( returnedClassOrElement , buildingContext );
2572
- PropertyContainer propContainer = new PropertyContainer ( returnedClassOrElement , xClassProcessed );
2573
- addElementsOfClass ( classElements , propertyAccessor , propContainer , buildingContext );
2562
+ PropertyContainer propContainer = new PropertyContainer ( returnedClassOrElement , xClassProcessed , propertyAccessor );
2563
+ addElementsOfClass ( classElements , propContainer , buildingContext );
2574
2564
2575
2565
//add elements of the embeddable superclass
2576
2566
XClass superClass = xClassProcessed .getSuperclass ();
2577
2567
while ( superClass != null && superClass .isAnnotationPresent ( MappedSuperclass .class ) ) {
2578
2568
//FIXME: proper support of typevariables incl var resolved at upper levels
2579
- propContainer = new PropertyContainer ( superClass , xClassProcessed );
2580
- addElementsOfClass ( classElements , propertyAccessor , propContainer , buildingContext );
2569
+ propContainer = new PropertyContainer ( superClass , xClassProcessed , propertyAccessor );
2570
+ addElementsOfClass ( classElements , propContainer , buildingContext );
2581
2571
superClass = superClass .getSuperclass ();
2582
2572
}
2583
2573
if ( baseClassElements != null ) {
@@ -2790,9 +2780,11 @@ private static PropertyData getUniqueIdPropertyFromBaseClass(
2790
2780
List <PropertyData > baseClassElements = new ArrayList <PropertyData >();
2791
2781
XClass baseReturnedClassOrElement = baseInferredData .getClassOrElement ();
2792
2782
PropertyContainer propContainer = new PropertyContainer (
2793
- baseReturnedClassOrElement , inferredData .getPropertyClass ()
2783
+ baseReturnedClassOrElement ,
2784
+ inferredData .getPropertyClass (),
2785
+ propertyAccessor
2794
2786
);
2795
- addElementsOfClass ( baseClassElements , propertyAccessor , propContainer , context );
2787
+ addElementsOfClass ( baseClassElements , propContainer , context );
2796
2788
//Id properties are on top and there is only one
2797
2789
return baseClassElements .get ( 0 );
2798
2790
}
0 commit comments