package example;
...
@Entity
@Indexed
public class Book {
@Id
@GeneratedValue
private Integer id;
@Field(index=Index.YES, analyze=Analyze.YES, store=Store.NO)
private String title;
@Field(index=Index.YES, analyze=Analyze.YES, store=Store.NO)
private String subtitle;
@Field(index = Index.YES, analyze=Analyze.NO, store = Store.YES)
@DateBridge(resolution = Resolution.DAY)
private Date publicationDate;
@IndexedEmbedded
@ManyToMany
private Set<Author> authors = new HashSet<Author>();
@OneToMany(mappedBy="book")
List<BookPages> bookPages;
}
1) 検索結果が Book.class タイプの場合、結果には @ManyToOne オブジェクト (bookPages) が含まれますか、それとも個別にロードする必要がありますか? 結果を表示するためにそれらが必要だからです。
2) 検索にネイティブ SQL 句を追加することは可能ですか? 結果を制限する必要があるため、Book.class で宣言されていない別のテーブルを結合する必要があります。