0

Hibernate Search のマッピングと抽象基本クラスの使用について質問があります。次のエラーが表示されます

Caused by: org.hibernate.search.SearchException: Found invalid @IndexedEmbedded->paths configured on class nl.project.model.social.AbstractGroup, member language: language.id
    at org.hibernate.search.engine.spi.AbstractDocumentBuilder.validateAllPathsEncountered(AbstractDocumentBuilder.java:901)
    at org.hibernate.search.engine.spi.AbstractDocumentBuilder.checkForIndexedEmbedded(AbstractDocumentBuilder.java:880)
    at org.hibernate.search.engine.spi.AbstractDocumentBuilder.initializeMemberLevelAnnotations(AbstractDocumentBuilder.java:489)
    at org.hibernate.search.engine.spi.AbstractDocumentBuilder.initializeClass(AbstractDocumentBuilder.java:391)
    at org.hibernate.search.engine.spi.AbstractDocumentBuilder.<init>(AbstractDocumentBuilder.java:174)
    at org.hibernate.search.engine.spi.DocumentBuilderContainedEntity.<init>(DocumentBuilderContainedEntity.java:60)
    at org.hibernate.search.spi.SearchFactoryBuilder.initDocumentBuilders(SearchFactoryBuilder.java:396)
    at org.hibernate.search.spi.SearchFactoryBuilder.buildNewSearchFactory(SearchFactoryBuilder.java:222)
    at org.hibernate.search.spi.SearchFactoryBuilder.buildSearchFactory(SearchFactoryBuilder.java:146)
    at org.hibernate.search.event.impl.FullTextIndexEventListener.initialize(FullTextIndexEventListener.java:130)
    at org.hibernate.search.hcore.impl.HibernateSearchIntegrator.integrate(HibernateSearchIntegrator.java:83)
    at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:301)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1750)

次のマッピング構成に基づく

@Entity
@Table
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "DTYPE", discriminatorType= DiscriminatorType.STRING, length = 3)
@Indexed
public abstract class AbstractGroup implements Serializable, IEntity, IPhoto{

    protected Language language;

    @ManyToOne(fetch=FetchType.LAZY, cascade=CascadeType.ALL)
    @JoinColumn(name="FK_LanguageId")
    @Cache(usage=CacheConcurrencyStrategy.NONSTRICT_READ_WRITE,region=CacheRegion.NEVERCHANGE)
    @NotNull
    @IndexedEmbedded(includePaths={"id"})
    public Language getLanguage() {
        return language;
    }
}

@Entity
@DiscriminatorValue(value = "GRP")
@Cache(usage=CacheConcurrencyStrategy.NONSTRICT_READ_WRITE,region=CacheRegion.GROUP)
public class Group extends AbstractGroup{

@Entity
@DiscriminatorValue(value = "PGE")
@Cache(usage=CacheConcurrencyStrategy.NONSTRICT_READ_WRITE,region=CacheRegion.GROUP)
public class Page extends AbstractGroup{

サブクラスに @Indexed を入れようとしましたが、これは同じエラーを出します。

4

1 に答える 1

1

@Indexedアノテーションは実際にはサブクラスにあるはずです。ただし、これが識別子列とどう関係するのかわかりません。JPA と検索のアノテーションは直交する必要があります。本当に2つの異なること。ところで、言語エンティティはどのように見えますか? https://forum.hibernate.org/viewtopic.php?f=9&t=993097&hilit=abstract+base+classも参照してください。

于 2013-02-07T10:52:46.513 に答える