Hello i have got one question
I Need indexes only one class no other i use jboss ver 4.2 GA , hibernate-search-3.4.0.Final.jar, lucene-core-3.3.0.jar.
i have got a case something like that:
Code:
@MappedSuperclass
@Inheritance(strategy=InheritanceType.JOINED)
public abstract Class User implements Serializable, Cloneable
{
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@DocumentId
private long id;
@Field(store=Store.YES)
private String description;
@Field
private String name;
//other stuff
}
and:
@Indexed
private Class Person Extend User implements Serializable, Cloneable
{
@OneToMany
@JoinColumns({
@JoinColumn(name="albumId", referencedColumnName="id")
})
@IndexedEmbedded
private List<Photo> photos;
@OneToMany
@JoinColumns({
@JoinColumn(name="id", referencedColumnName="id")
})
private List<Buy> buy;
//other stuff
}
@Indexed
public class Photo implements Serializable, Cloneable
{
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@DocumentId
private long id;
@Field
private String name;
}
and jboss give me errror Reason: java.lang.annotation.IncompleteAnnotationException: org.hibernate.search.annotations.Field missing element index
Depends On Me:
jboss.j2ee:jar=person-app.jar,name=PersonEntityHandler,service=EJB3
I need only indexed field in class Person and photo not Buy And i have one more question:
in book HIbernate Search in Action on page 38 they wrote:
Quote:
<hibernate-configuration>
<session-factory>
...
<event type="post-update">
<listener
class="org.hibernate.search.event.FullTextIndexEventListener"/>
</event>
<event type="post-insert">
<listener class="org.hibernate.search.event.FullTextIndexEventListener"/>
</event>
<event type="post-delete">
<listener class="org.hibernate.search.event.FullTextIndexEventListener"/>
</event>
<event type="post-collection-recreate">
<listener class="org.hibernate.search.event.FullTextIndexCollectionEventListener"/>
</event>
<event type="post-collection-remove">
<listener
class="org.hibernate.search.event.FullTextIndexCollectionEventListener"/>
</event>
<event type="post-collection-update">
<listener class="org.hibernate.search.event.FullTextIndexCollectionEventListener"/>
</event>
</session-factory>
</hibernate-configuration>
and i wrote in persistance.xml
Code:
<property name="hibernate.search.default.directory_provider" value="org.hibernate.search.store.FSDirectoryProvider"/>
<!-- directory where the indexes will be stored -->
<property name="hibernate.search.default.indexBase" value="/usr/local/storage/index"/>
<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"/>
but if i use property :
Code:
<property name="hibernate.ejb.event.pre-collection-update" value="org.hibernate.search.event.FullTextIndexCollectionEventListener"" />
<property name="hibernate.ejb.event.pre-collection-remove" value="org.hibernate.search.event.FullTextIndexCollectionEventListener"" />
<property name="hibernate.ejb.event.post-collection-recreate" value="org.hibernate.search.event.FullTextIndexCollectionEventListener"" />
I have got error in Jboss that this property dont exist ??