【发布时间】:2014-03-11 12:25:40
【问题描述】:
我使用 Play Framework 1.2.5.3 和 PostgreSQL 9.x。
我有 WorkArea 类作为带有字段的数据库模型
@Column(columnDefinition = "ltree", insertable = false, updatable = false)
public String tree;
在 postgre 中,它是一个数据库表 workareas,字段为 tree(类型 ltree)
我想将 Hibernate 查询与 postgres ltree 操作一起使用。例如:
List<WorkArea> workAreas = WorkArea.find("tree @> :tree").bind("tree", otherArea.tree).fetch();
或者
List<WorkArea> workAreas = WorkArea.find("ltree_isparent(:tree, tree)").bind("tree", otherArea.tree).fetch();
我该怎么做?
【问题讨论】:
标签: hibernate postgresql playframework-1.x ltree