Permalink
Browse files

Improve ManyToOne id conversion

  • Loading branch information...
1 parent c6f5664 commit 5fea37b39ff3b5133f3cf05761c81e92808f9723 Jean-Francois POUX committed Jun 28, 2010
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/play/modules/search/store/ConvertionUtils.java
@@ -3,6 +3,7 @@
import java.util.Collection;
import javax.persistence.Id;
+import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import org.apache.lucene.document.Document;
@@ -89,7 +90,7 @@ public static String valueOf(Object object, java.lang.reflect.Field field) throw
}
Object o = field.get(object);
- if (o instanceof JPASupport) {
+ if (field.isAnnotationPresent(ManyToOne.class) && o instanceof JPASupport) {
return "" + getIdValueFor((JPASupport) o);
}

0 comments on commit 5fea37b

Please sign in to comment.