Hi All,
We have a server using spring and hibernate. We are trying to add hibernate search to the server but run into the following problem.
We have a class Request with a relation to a single Customer. This is annotated like so:
Request:
Code:
@Entity
@Table(name = "requests")
@Indexed(index = "indexes/requests")
public class Request extends BaseDomainEntity
@ManyToOne
@IndexedEmbedded
private @Getter @Setter Customer customer;
}
Customer
Code:
@Entity
@Table(name = "customers")
@Indexed(index = "indexes/customers")
public class Customer extends BaseDomainEntity {
@Column(name = "name")
@Field(index = Index.TOKENIZED, store = Store.NO)
@NotEmpty
private @Getter @Setter String name;
@OneToMany(mappedBy="customer")
@ContainedIn
private @Getter @Setter List<Request> requests;
}
When i create a request i can see with Luke that the index is created and that the customer related to the request is added to the index of the request.
When i update the customer (by changing its name) the index of the customer is updated, the index of the request with the related customer not.
If i have read the documentation correct the @containedIn should do this for me right?
We use hibernate 3.6.2.Final and hibernate search 3.4.1.Final