}
private AccessType getAccessTypeForElement() {
//get local strategy
AccessType accessType = getAccessTypeForClass( element );
if ( accessType == null ) {
accessType = this.defaultAccessTypeForHierarchy;
}
if ( accessType == null ) {
//we don't know if an entity go up
//
//superclasses are always treated after their entities
//and their access type are discovered
//FIXME is it really true if only the superclass is changed
TypeElement superClass = element;
do {
superClass = TypeUtils.getSuperclassTypeElement( superClass );
if ( superClass != null ) {
if ( TypeUtils.containsAnnotation( superClass, Entity.class, MappedSuperclass.class ) ) {
//FIXME make it work for XML
AccessType superClassAccessType = getAccessTypeForClass( superClass );
//we've reach the root entity and resolved Ids
if ( superClassAccessType != null && defaultAccessTypeForHierarchy != null ) {
break; //we've found it
}
}