Bug 947491

Summary: Document that fields declared on @MappedSuperclass parent are not recognized on child entity by programmatic API mapping
Product: [Retired] JBoss Enterprise WFK Platform 2 Reporter: Petr Penicka <ppenicka>
Component: doc-Hibernate-Search-GuideAssignee: Sneha <snagarwa>
Status: CLOSED CURRENTRELEASE QA Contact: thradec
Severity: medium Docs Contact:
Priority: medium    
Version: 2.3.0CC: ankit, brmeyer, ecervena, irooskov, kpiwko, mnovotny, myarboro, ppenicka, sanne, snagarwa
Target Milestone: GA   
Target Release: 2.3.0   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 855948 Environment:
Last Closed: 2013-07-16 11:32:46 UTC Type: Feature Request
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 855948    
Bug Blocks:    

Comment 1 Petr Penicka 2013-04-02 14:54:58 UTC
Please include the information about unrecognized inherited Hibernate Search fields in the Hibernate Search Guide.

Comment 3 Sneha 2013-06-17 06:52:04 UTC
Marek,

Can you please provide more information about what needs to be added the guide for this bug?

Comment 4 Marek Novotny 2013-06-17 07:48:52 UTC
We had in original issue 855948, which this issue is cloned from the following RN text:

"Programmatic API mapping does not recognize Hibernate Search fields inherited from parent entities annotated with @MappedSuperclass. As a consequence, Hibernate Search views the fields as unmapped, resulting in a SearchException. This is not considered a bug, but a by-design behaviour that can only be addressed by a functionality enhancement. Until the functionality is enhanced, the issue can be worked around by overriding the getter methods of the inherited fields in the child entities."

That should be added somewhere in HSearch Guide, but you probably need some guidance from HSearch team to confirm the chapter/section placement.

Comment 5 Sneha 2013-06-17 11:28:18 UTC
I am planning to add the following warning message above 'Example 4.17' in the HSerach guide:

Warning:
Programmatic API mapping does not recognize Hibernate Search fields inherited from parent entities annotated with @MappedSuperclass. As a consequence, Hibernate Search views the fields as unmapped, resulting in a SearchException. This behaviour is due to the design of the application. To work around the exception, override the getter methods of the inherited fields in the child entities. 

Sanne, please confirm.

Comment 6 Sanne Grinovero 2013-06-17 11:44:21 UTC
I've created a JIRA to clarify the documentation:
  https://hibernate.atlassian.net/browse/HSEARCH-1352

Proposed fix is sent as pull request.

Comment 7 Sanne Grinovero 2013-06-17 11:47:59 UTC
Sneha: sorry was working on the same in parallel, and provided a simplified wording version.

I'm not sure what 'Example 4.17' means: in the community documentation that one is very unrelated so I assume the numbering is different.

Comment 8 Sanne Grinovero 2013-06-17 14:38:40 UTC
We merged a documentation improvement upstream:
https://github.com/hibernate/hibernate-search/commit/3e8f095aa8a644dd4a4ed0d07564c07514279ad3