|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RelatedEntity<T extends RelatedEntity<T> & RawEntity<?>>
A superinterface for entities which are related to each other using Lucene heuristics. This is not required as a superinterface for entities related to one another at the database level. Thus, this interface is only relevant to those already using full-text indexing.
While this entity does not extend RawEntity
itself, it should
only be inherited by interfaces which do. In fact, this is enforced by
the type parameterization of this interface. Example:
public interface Post extends Entity, RelatedEntity<Post> { // ... @Searchable @SQLType(Types.BLOB) public String getBody(); @Searchable @SQLType(Types.BLOB) public void setBody(String body); } // ... Post p = manager.get(Post.class, 123); Post[] relatedPosts = p.getRelated(); // searches Lucene index for related posts
Under most circumstances, the type parameter used when inheriting from this interface should be the entity interface itself, as in the above example.
SearchableEntityManager
Method Summary | |
---|---|
T[] |
getRelated()
Retrieves the entities related to this by using full-text search heuristics. |
Method Detail |
---|
T[] getRelated()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |