Uploaded image for project: 'Hibernate Search'
  1. HSEARCH-3156

@ContainedIn fails at runtime when targeting a class for which only some subclasses are configured in Search

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Component/s: engine
    • Labels:
      None
    • Environment:
      Hibernate Core 5.1.10.Final
      Hibernate Search 5.6.4.Final

      Description

      Entity Class is not @Indexed nor hosts @ContainedIn: class ca.statcan.icos.model.workload.SampleUnitContact
      

      I am running into the error while running tests with this model:

      @Index
      class RegistryBasedCase {
          @IndexedEmbedded
          List<CaseContact> caseContacts;
      }
      
      class SampleUnit {
          List<SampleUnitcontact> sampleUnitContacts;
      }
      
      abstract class Contact {
          @IndexedEmbedded
          List<ContactInformation> contactInformations;
      }
      
      class SampleUnitContact extends Contact {
          ....
      }
      
      class CaseContact extends Contact {
          ....
      }
      
      class ContactInformation {
          @ContainedIn
          Contact contact;
      }
      

      When I run the MassIndexer I get no error, as one might expect. However, when running the unit tests, whenever we try and save a SampleUnit the error is thrown. It seems it sees the @ContainedIn in the contact information but doesn't see that we only care about CaseContact, not SampleUnitContact.

        Attachments

          Activity

            People

            • Assignee:
              yrodiere Yoann Rodière
              Reporter:
              michael.hum Michael Hum
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: