Skip to Content
3
Former Member
Aug 12, 2016 at 11:52 AM

How to search instances of a Relation marked as Abstract

652 Views

I have a Relation defined in my items.xml which is not explicitly marked as abstract. Both the source and target elements of the relation are also non abstract.

I then used the "Redeclaring Relations" by making the relation concrete in subclasses as defined in https://help.hybris.com/6.1.0/hcd/8c755da8866910149c27ec908fc577ef.html

This works fine for performance and validations however the following unfortunate and weird situation arises:

  1. For some reason the relation is marked as abstract (I just realized the relations in question are of type one-to-many or many-to-one and do not have their own deployment tables. Could this be the reason?)

  2. There is no way to search for instances of the Relation in hmc or backoffice.

  3. Also it is impossible to search for the instances using Flexible search. it throws an exception:

    Exception message: parsed type --(Relation Name Here)-- is abstract

Exception stacktrace: de.hybris.platform.persistence.flexiblesearch.ParsedType.getTypeRestrictionConditions(ParsedType.java:720) de.hybris.platform.persistence.flexiblesearch.ParsedQuery.collectTranslatedRestrictions(ParsedQuery.java:596) de.hybris.platform.persistence.flexiblesearch.ParsedQuery.assemble(ParsedQuery.java:543) de.hybris.platform.persistence.flexiblesearch.ParsedQuery.translate(ParsedQuery.java:432) de.hybris.platform.persistence.flexiblesearch.ParsedQuery.getTranslatedQuery(ParsedQuery.java:179) de.hybris.platform.persistence.flexiblesearch.QueryParser.translateQuery(QueryParser.java:227) de.hybris.platform.jalo.flexiblesearch.FlexibleSearch.translate(FlexibleSearch.java:1998)

I am looking for experts to please:

  1. Confirm if this behavior of marking the Relation abstract is correct? (I think this is a bug)

  2. Share how to get around this issue