Hi,
I have an appfuse based project with Hibernate 3.2.6., entitymanager 3.3.2, hibernate annotations 3.3.1, hibernate search 3.0.1, Spring 2.5.4
I have a problem with one of my entities not being indexed automatically. However, when I run an explicit index operation using createFullTextSession and indexing all the objects, it does get indexed.
I dont have access to the sessionFactory in xml, but I do to the persistence.xml, which is configured as follows
Code:
<persistence-unit name="ApplicationEntityManager"
transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<properties>
<property name="hibernate.search.default.directory_provider"
value="org.hibernate.search.store.FSDirectoryProvider" />
<property name="hibernate.search.autoregister_listeners"
value="true" />
<property name="hibernate.search.default.batch.merge_factor" value="1"/>
<property name="hibernate.search.default.indexBase"
value="d:/Java/Projects/CompraVenta/indexes" />
<property name="hibernate.ejb.event.post-insert"
value="org.hibernate.search.event.FullTextIndexEventListener"/>
<property name="hibernate.ejb.event.post-update"
value="org.hibernate.search.event.FullTextIndexEventListener"/>
<property name="hibernate.ejb.event.post-delete"
value="org.hibernate.search.event.FullTextIndexEventListener"/>
</properties>
</persistence-unit>
Some of my classes do get indexed automatically properly but one doesn't and I don't get it
It is this class
Code:
@Entity
@Table(name = "Offers")
@Inheritance(strategy = InheritanceType.JOINED)
//@DiscriminatorValue(value = "OFFER")
@Indexed
@FullTextFilterDefs( {
@FullTextFilterDef(name = "offerTerms", impl = OfferFilterFactory.class),
@FullTextFilterDef(name = "validUntil", impl = RangeFilterFactory.class) })
public class Offer implements Serializable{
[...]
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "offerID", updatable = false, insertable = false)
@DocumentId
public Long getId() {
return id;
}
@Column
@Field(index = Index.TOKENIZED, store = Store.YES)
public String getTitle() {
return title;
}
@Column
@Field(index = Index.TOKENIZED, store = Store.YES)
@Boost(2.5f)
public String getDescription() {
return description;
}
[...]
}
the save operation is as follows:
Code:
@SuppressWarnings("unchecked")
public T save(T object) {
return (T) super.getHibernateTemplate().merge(object);
}
leading to
public Object merge(final Object entity) throws DataAccessException {
return executeWithNativeSession(new HibernateCallback() {
public Object doInHibernate(Session session) throws HibernateException {
checkWriteOperationAllowed(session);
return session.merge(entity);
}
});
}
Any ideas?
Cheers,
Marc[/code]