Skip to content

Commit

Permalink
Fix indexOnly attribute storage strategy name
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Jul 29, 2019
1 parent 4caed63 commit 4737268
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Expand Up @@ -412,7 +412,7 @@ static <T> RefinedAttributeDefinition<T> parse(ResourceAttributeDefinition<T> sc
if (schemaHandlingAttrDefType != null) {
rAttrDef.fetchStrategy = schemaHandlingAttrDefType.getFetchStrategy();
rAttrDef.storageStrategy = schemaHandlingAttrDefType.getStorageStrategy();
rAttrDef.setIndexOnly(rAttrDef.storageStrategy == AttributeStorageStrategyType.QUERY_ONLY);
rAttrDef.setIndexOnly(rAttrDef.storageStrategy == AttributeStorageStrategyType.INDEX_ONLY);
if (schemaHandlingAttrDefType.getMatchingRule() != null) {
rAttrDef.matchingRuleQName = schemaHandlingAttrDefType.getMatchingRule();
}
Expand Down
Expand Up @@ -8160,7 +8160,7 @@
It can be queried. If needed to get it, explicit INCLUDE option has to be used.
</xsd:documentation>
<xsd:appinfo>
<jaxb:typesafeEnumMember name="QUERY_ONLY"/>
<jaxb:typesafeEnumMember name="INDEX_ONLY"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:enumeration>
Expand Down
Expand Up @@ -621,6 +621,7 @@ private <T extends ObjectType> PrismObject<T> updateLoadedObject(GetObjectResult
private <T extends ObjectType> void loadIndexOnlyItemsIfNeeded(PrismObject<T> prismObject,
Collection<SelectorOptions<GetOperationOptions>> options, boolean raw, Session session) throws SchemaException {
List<SelectorOptions<GetOperationOptions>> retrieveOptions = SelectorOptions.filterRetrieveOptions(options);
LOGGER.trace("loadIndexOnlyItemsIfNeeded: retrieval options = {}", retrieveOptions);
if (retrieveOptions.isEmpty()) {
return;
}
Expand Down Expand Up @@ -661,8 +662,11 @@ private <T extends ObjectType> void loadIndexOnlyItemsIfNeeded(PrismObject<T> pr
// todo what about extension items that are not part of object extension definition?

// attributes
if (ShadowType.class.equals(prismObject.getCompileTimeClass())) {
Class<T> compileTimeClass = prismObject.getCompileTimeClass();
LOGGER.trace("Object class: {}", compileTimeClass);
if (ShadowType.class.equals(compileTimeClass)) {
boolean getAllAttributes = SelectorOptions.hasToLoadPath(ShadowType.F_ATTRIBUTES, retrieveOptions, false);
LOGGER.trace("getAllAttributes = {}", getAllAttributes);
if (getAllAttributes) {
if (rObject == null) {
rObject = session.load(RShadow.class, prismObject.getOid());
Expand All @@ -687,6 +691,7 @@ private void retrieveAllAttributeValues(PrismObject<ShadowType> shadowObject,
PrismContainer<Containerable> attributeContainer = shadowObject.findOrCreateContainer(ShadowType.F_ATTRIBUTES);
// Hack: let's ignore values of attributes that already exist in this container
Collection<QName> existingAttributeNames = attributeContainer.getValue().getItemNames();
LOGGER.trace("existingAttributeNames = {}", existingAttributeNames);
for (ROExtValue<?> rValue : dbCollection) {
if (rValue.getOwnerType() == RObjectExtensionType.ATTRIBUTES) {
LOGGER.trace("- processing {}", rValue);
Expand Down

0 comments on commit 4737268

Please sign in to comment.