Hello,
I'm facing problem with update of index files, when dependent entity is being updated or inserted.
I have following entities:
Code:
@Indexed
class Ticket {
@Id
private long id;
@OneToMany(mappedBy="ticket", cascade=CascadeType.ALL)
@IndexedEmbedded
private List<Note> notes = new ArrayList<Note>();
}
class Note {
@Field(index = Index.TOKENIZED)
private String text;
@ManyToOne(fetch=FetchType.LAZY, optional = false)
@ContainedIn
private Ticket ticket;
}
And i want the index files of Ticket entity being updated, when user updates/creates new dependent Note entity. Previous code works, but with one important problem. The index files of Ticket entity are updated, but new Note is not indexed to already existing and indexed Ticket, but new Ticket entity is indexed and stored with ticketId = 0 in index files. I'm using Luke to check index files.
I have no idea what might be wrong. Thanx for any hint.