Hi,
I have the following model:
Code:
@Entity
@IdClass(PersonId.class)
@Indexed(index="indexes/person")
public class Person implements Serializable {
private long organizationId;
private long personId;
private String name;
@Id
public long getOrganizationId() {
return organizationId;
}
public void setOrganizationId(long organizationId) {
this.organizationId = organizationId;
}
@Id
public long getPersonId() {
return personId;
}
public void setPersonId(long personId) {
this.personId = personId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
@Embeddable
public class PersonId implements Serializable {
private long organizationId;
private long personId;
public long getOrganizationId() {
return organizationId;
}
public void setOrganizationId(long organizationId) {
this.organizationId = organizationId;
}
public long getPersonId() {
return personId;
}
public void setPersonId(long personId) {
this.personId = personId;
}
// override equals/hashCode
}
When I do the search, I get the following error:
Code:
Caused by: java.lang.NumberFormatException: For input string: "com.test.entity.PersonId@e79f7c35"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Long.parseLong(Long.java:403)
at java.lang.Long.<init>(Long.java:671)
at org.hibernate.search.bridge.builtin.LongBridge.stringToObject(LongBridge.java:14)
at org.hibernate.search.bridge.TwoWayString2FieldBridgeAdaptor.get(TwoWayString2FieldBridgeAdaptor.java:32)
at org.hibernate.search.engine.DocumentBuilder.getDocumentId(DocumentBuilder.java:626)
at org.hibernate.search.engine.DocumentExtractor.extract(DocumentExtractor.java:30)
at org.hibernate.search.engine.DocumentExtractor.extract(DocumentExtractor.java:40)
at org.hibernate.search.query.FullTextQueryImpl.list(FullTextQueryImpl.java:241)
at com.test.search.impl.SearchProviderImpl.searchPersons(SearchProviderImpl.java:52)
... 28 more
I'm I doing something wrong with the mappings?
Thanks,
Pavel