Hi!
I've got a class named Ficha whith a set of objects of another class named Materia. Like this:
@Indexed public class Ficha { ....... @Id @DocumentId protected Long idFicha;
@ManyToMany(fetch = FetchType.EAGER, cascade = CascadeType.MERGE) @JoinTable(name = "rel_materia_ficha_tarifa", joinColumns = { @JoinColumn(name = "ficha_tarifa_id") }, inverseJoinColumns = { @JoinColumn(name = "materia_id") }) @IndexedEmbedded protected Set<Materia> materias = new HashSet<Materia>(); ...... }
@Entity
@Indexed
public class Materia{
......
@Id
@DocumentId
private String codigo;
@Field(index = Index.TOKENIZED, store = Store.NO)
@Boost(2.0f)
private String descripcion;
.......
}
I'm working with queries about Ficha class, I mean, I want to retrieve lists of Ficha objects. However, I don't know how I can set the Lucene indexes aware of any change in the Materias objects. I mean, I'd like to do the same that the annotation @ContainedIn does in a bidirectional relationship .
Thanks a lot.
|