Bug 855948 - Fields declared on @MappedSuperclass parent are not recognized on child entity by programmatic API mapping
Summary: Fields declared on @MappedSuperclass parent are not recognized on child entit...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: JBoss Enterprise WFK Platform 2
Classification: Retired
Component: HibernateSearch
Version: 2.0.0.GA
Hardware: Unspecified
OS: Linux
medium
medium
Target Milestone: ---
: 2.2.0
Assignee: Brett Meyer
QA Contact: Karel Piwko
URL:
Whiteboard:
Depends On:
Blocks: 947491
TreeView+ depends on / blocked
 
Reported: 2012-09-10 17:30 UTC by Emil Cervenan
Modified: 2015-09-01 04:00 UTC (History)
8 users (show)

Fixed In Version:
Clone Of:
: 947491 (view as bug list)
Environment:
Last Closed: 2013-01-31 16:57:59 UTC
Type: Feature Request
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Hibernate HSEARCH-1108 0 None None None Never

Description Emil Cervenan 2012-09-10 17:30:00 UTC
Description of problem:
Fields declared on @MappedSuperclass parent are not recognized on child entity by programmatic API mapping.

Workaround:
Overide getters on child entity.

Version-Release number of selected component (if applicable):
hibernate-search-4.1.0.Final, wfk-2.0.0.GA


How reproducible:
@MappedSuperclass
public abstract class FooAbstract {
    protected String bar;

    public String getBar() {
        return this.bar
    }
    ...
}

@Entity
public class Foo extends FooAbstract {}

@Factory
public SearchMapping getSearchMapping() {
    SearchMapping mapping = new SearchMapping();
    mapping
        .entity(Foo.class).indexed()
            .property("bar", ElementType.METHOD)
                .field();
}


Steps to Reproduce:
1. create data model with inheritance
2. map indexes using programmatic api
3. try to get inherited field value from extended entity
  
Actual results:
 org.hibernate.search.SearchException: Unable to find field bar in ...


Expected results:
 return value of field

Additional info:
reported on jira too: https://hibernate.onjira.com/browse/HSEARCH-1108

Comment 1 Marek Novotny 2012-09-14 06:32:52 UTC
There is a discussion about this at HSEARCH-1108 - and this is not a bug, but request for an improvement/feature request.

https://hibernate.onjira.com/browse/HSEARCH-1108?focusedCommentId=46619&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-46619

Comment 2 mark yarborough 2012-11-05 15:29:56 UTC
Known issue for WFK 2.1, should be release noted.

Comment 4 Sneha 2013-03-21 08:57:38 UTC
Updated Doc Text.

Comment 5 Petr Penicka 2013-04-02 14:51:02 UTC
As this is no longer considered a bug, I have moved this from known issues to resolved issues in WFK 2.2.0 Release Notes.

The information will be included in the Hibernate Search Guide in WFK 2.3.0, a cloned issue is created for the purpose.


Note You need to log in before you can comment on or make changes to this bug.