QueryBuilder qb = fullTextSession.getSearchFactory().build QueryBuilder().forEntity(Cat.class).get();
Unfortunately, it doesn't. It won't just return Cats, if may even return Dogs if they are also indexed, which will in turn cause ClassCastExceptions.
To limit to only cats, you'd need to specify the entity class in this line:
FullTextQuery searchQuery = fullTextSession.createFullTextQuery(luce neQuery,Cat.class);
Unfortunately, it doesn't. It won't just return Cats, if may even return Dogs if they are also indexed, which will in turn cause ClassCastExceptions.
To limit to only cats, you'd need to specify the entity class in this line:
FullTextQuery searchQuery = fullTextSession.createFullTextQuery(luce
No comments:
Post a Comment