The reasons why I want to do this are not so relevant I think, but mostly because of time generation of indexes.
I want to index a subset of the top level entity (House, in this example), and all of the lower level entity (Room). There is a bug in Hibernate using FetchMode.JOIN in scroll mode before indexing collections (
http://opensource.atlassian.com/projects/hibernate/browse/HHH-1283) so it takes forever if I want to index collections on Room, for instance, but not on my subset of House, as I am indexing very few.
Again, as to what entities I am actually indexing, I'm not sure how this can provide any extra information. My example provides enough information I think.
In pseudocode it is like this:
Code:
@Indexed
class House {
private Set<Room> rooms;
@IndexEmbedded
public Set<Room> getRooms() {
return rooms;
}
}
@Indexed
class Room {
private Set<Box> boxes;
@IndexEmbedded
public Set<Box> getBoxes() {
return rooms;
}
}
... and so on to Box & Toy
What I want to know is, can I index Boxes collection in Room only when I am indexing House, but not when I index Room.
Thanks for your time,
Steve