[
https://hibernate.onjira.com/browse/HSEARCH-1049?page=com.atlassian.jira....
]
Davide D'Alto edited comment on HSEARCH-1049 at 3/5/12 8:45 AM:
----------------------------------------------------------------
{quote} Sorry, yeah I'm new to this. I ran the engine tests since that's what I
worked on ...{quote}
Don't worry Marc.
Another reson to add tests is this way is easier for us to understand your use case.
Anyway I think I've understand what's going on:
1) "subitem.item.id" doesn't exist because the includePaths option create
paths from the class where is used. Other includePaths in embedded entities are not
considered. This is way we avoid teh problem of infinite paths.
So
{code}
@Indexed
public class Item {
@ManyToMany
@IndexedEmbedded(prefix="subitem.")
public List<SubItem> getSubItems() {
...
}
}
{code}
{code}
@Indexed
public class SubItem {
@IndexedEmbedded(prefix="item.",includePaths={"id"})
public List<Item> relatedItems() {
...
}
}
{code}
the prefix define in Item won't be used in SubItem.
was (Author: davided):
{quote} Sorry, yeah I'm new to this. I ran the engine tests since that's what
I worked on ...{quote}
Don't worry Marc.
Another reson to add tests is this way is easier for us to understand your use case.
Anyway I think I've understand what's going on:
1) "subitem.item.id" doesn't exist because the includePaths option create
paths from the class where is used. Other includePaths in embedded entities are not
considered. This is necessary to avoid infinite loop with some mapping.
So
{code}
@Indexed
public class Item {
@ManyToMany
@IndexedEmbedded(prefix="subitem.")
public List<SubItem> getSubItems() {
...
}
}
{code}
{code}
public class SubItem {
@IndexedEmbedded(prefix="item.",includePaths={"id"})
public List<Item> relatedItems() {
...
}
{code}
includePaths bombs on inclusion of id members
---------------------------------------------
Key: HSEARCH-1049
URL:
https://hibernate.onjira.com/browse/HSEARCH-1049
Project: Hibernate Search
Issue Type: Bug
Components: engine
Affects Versions: 4.1.0.Beta2
Reporter: Marc Schipperheyn
Priority: Blocker
Fix For: 4.1.0.Final
When I include id members on includePaths, I get
Found invalid @IndexedEmbedded->paths configured on class nl.project.model.Item,
member subitem: item.id
I use ids a lot and in many cases they are all I'm interested in.
E.g.
@IndexedEmbedded(prefix="location.",includePaths={"city.id","city.city","country.id","city.region.id"})
public Address getAddress() {
return address;
}
will indicate all id fields as erronous.
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira