クラスInterventoをhibernate-searchアノテーション(4.1.1バージョンライブラリ)で構成しました。したがって、私はjpaを使用しており、私の場合は省略でき@DocumentId
ますが、複合主キーがあります...
@IdClass(it.domain.InterventoPK.class)
@Entity
@Indexed
@AnalyzerDef(name = "interventongram", tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class),
filters = {
@TokenFilterDef(factory = LowerCaseFilterFactory.class),
@TokenFilterDef(factory = StopFilterFactory.class, params = {
@Parameter(name = "words", value = "lucene/dictionary/stopwords.txt"),
@Parameter(name = "ignoreCase", value = "true"),
@Parameter(name = "enablePositionIncrements", value = "true")
}),
@TokenFilterDef(factory = ItalianLightStemFilterFactory.class),
@TokenFilterDef(factory = SynonymFilterFactory.class, params = {
@Parameter(name = "synonyms", value = "lucene/dictionary/synonyms.txt"),
@Parameter(name = "expand", value = "true")
}),
@TokenFilterDef(factory = SnowballPorterFilterFactory.class, params = {
@Parameter(name = "language", value = "Italian")
})
})
@Table(name = "intervento", catalog = "gestionale")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(namespace = "Clinigo/it/domain", name = "Intervento")
@XmlRootElement(namespace = "Clinigo/it/domain")
public class Intervento implements Serializable {
private static final long serialVersionUID = 1L;
/**
*/
@Column(name = "idintervento", nullable = false)
@Basic(fetch = FetchType.EAGER)
@Id
@XmlElement
Integer idintervento;
/**
*/
@Column(name = "lingua_idlingua", nullable = false)
@Basic(fetch = FetchType.EAGER)
@Id
@XmlElement
Integer linguaIdlingua;
/**
*/
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "version", nullable = false)
@Basic(fetch = FetchType.EAGER)
@XmlElement
Calendar version;
..。
私は得ています....あなたは私を助けることができますか?
エラー:HSEARCH000058:HSEARCH000116:MassIndexer操作中に予期しないエラーjava.lang.ClassCastException:it.domain.InterventoPKをorg.hibernate.type.descriptor.java.IntegerTypeDescriptor.unwrap(IntegerTypeDescriptor.java: 36)org.hibernate.type.descriptor.sql.IntegerTypeDescriptor $ 1.doBind(IntegerTypeDescriptor.java:57)at org.hibernate.type.descriptor.sql.BasicBinder.bind(BasicBinder.java:92)atorg.hibernate。 type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:305)at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:300)at org.hibernate.loader.Loader.bindPositionalParameters(Loader.java:1891)at org.hibernate org.hibernate.loader.Loaderの.loader.Loader.bindParameterValues(Loader.java:1862)。prepareQueryStatement(Loader.java:1737)at org.hibernate.loader.Loader.doQuery(Loader.java:828)at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:289)at org.hibernate.loader.Loader .doList(Loader.java:2447)at org.hibernate.loader.Loader.doList(Loader.java:2433)at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2263)atorg.hibernate.loader。 Loader.list(Loader.java:2258)at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:122)at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1535)at org.hibernate .internal.CriteriaImpl.list(CriteriaImpl.java:374)at org.hibernate.search.batchindexing.impl.IdentifierConsumerEntityProducer.loadList(IdentifierConsumerEntityProducer.java:150)atorg.hibernate.search.batchindexing.impl。IdentifierConsumerEntityProducer.loadAllFromQueue(IdentifierConsumerEntityProducer.java:117)at org.hibernate.search.batchindexing.impl.IdentifierConsumerEntityProducer.run(IdentifierConsumerEntityProducer.java:94)at org.hibernate.search.batchindexing.impl.OptionallyWrapInJTATransaction.run( 84)at java.util.concurrent.ThreadPoolExecutor $ Worker.runTask(ThreadPoolExecutor.java:886)at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:908)at java.lang.Thread.run(Thread .java:619)run(OptionallyWrapInJTATransaction.java:84)at java.util.concurrent.ThreadPoolExecutor $ Worker.runTask(ThreadPoolExecutor.java:886)at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:908)at java.lang .Thread.run(Thread.java:619)run(OptionallyWrapInJTATransaction.java:84)at java.util.concurrent.ThreadPoolExecutor $ Worker.runTask(ThreadPoolExecutor.java:886)at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:908)at java.lang .Thread.run(Thread.java:619)