【发布时间】:2010-08-02 16:14:32
【问题描述】:
我的休眠实体如下:
@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';
如何使用休眠条件 api 执行此操作?
【问题讨论】:
标签: java hibernate orm criteria hibernate-criteria