我的休眠實體如下:然後Hibernate的標準API多次join
@Entity
@Table(name = "EditLocks")
public class EditLock extends AuditableEntity {
/** The document that is checked out. */
@OneToOne
@JoinColumn(name = "documentId", nullable = false)
private Document document;
文件看起來是這樣的:
public class Document extends AuditableEntity {
/** Type of the document. */
@ManyToOne
@JoinColumn(name = "documentTypeId", nullable = false)
private DocumentType documentType;
基本上我想寫的查詢是:
Select * from EditLocks el, Document docs, DocumentTypes dt where el.documentId = docs.id and docs.documentTypeId = dt.id and dt.id = 'xysz';
如何用hibernate標準api來做到這一點?
是的,我想我可能已經失蹤那只是沒有辦法來測試它。謝謝! – 2010-08-03 01:20:06