I found that if you have a field that is @Transient and depends on a Hibernate managed field, this field is not updated when the underlying field changes. Can't say exactly yet if it's in all cases. Using HSearch 4.1.0.Final
Code:
@ManyToOne(cascade = CascadeType.ALL,fetch=FetchType.EAGER)
@JoinColumn
@IndexedEmbedded
public Photo getPhoto() {
return photo;
}
@Transient
@Field(index=Index.NO,store=Store.YES)
public String getMugshot(){
if(photo == null)
return null;
return getUserDirectory() + "/" + photo.getFilename();
}
I saw this behaviour when creating the user, saving and flushing and then adding a photo and resaving, all in one process.
I assume that the dirty checking mechanism is responsible for this.
Any ideas how to deal with this?
Marc