Hi,
I am having trouble trying to figure out why my index is not being updated. so any help would be most appreciated.
the code is as follows:
Code:
@Entity
@Name("profile")
@Table(name = "PROFILE")
public class Profile implements Serializable {
@Id
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
@ContainedIn
@OneToMany(mappedBy="profile")
public List<Item> getItemList() {
return itemList;
}
@IndexedEmbedded
@OneToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE})
@PrimaryKeyJoinColumn(name = "PROFILE_ID", referencedColumnName = "CONTACT_ID")
public Contact getContact() {
return contact;
}
}
@Entity
@Indexed
@Name("item")
@Table(name = "ITEM")
public class Item implements Serializable {
@DocumentId
@Id
public Long getId() {
return id;
}
@IndexedEmbedded(depth=3)
@ManyToOne
@JoinColumn(name = "PROFILE_ID_FK")
public Profile getProfile() {
return profile;
}
}
@Embeddable
@Entity
@Name("contact")
@Table(name="CONTACT")
public class Contact implements Serializable {
public String email;
@Id
public Long getId() {
return id;
}
@OneToOne(mappedBy="contact", cascade = {CascadeType.PERSIST, CascadeType.MERGE})
@ContainedIn
public Profile getProfile() {
return profile;
}
}
okay so the problem is when i update any fields on Contact (say the email value) they are not reflected in the Item index. Although when i view the Item index in Luke i can see the relationship (profile.contact.email) but only old values.
I am using Seam and thus JPA so the EntityManager for the project.
any ideas as what i need to change to see the updates in the Item index?
Thanks