我正在尝试在hibernate中映射postgresql ltree列,如下所示:
在实体中:
private String path;
@Column(name="org_path", columnDefinition="ltree")
public String getPath() {
return path;
表结构:
CREATE TABLE relationship (
relationship_id int4 NOT NULL,
parent_organization_id uuid NOT NULL,
child_organization_id uuid NOT NULL,
org_path ltree NOT NULL,
CONSTRAINT relationship_pk PRIMARY KEY (relationship_id),
CONSTRAINT organization_fk3 FOREIGN KEY (parent_organization_id) REFERENCES organization(organization_id) ON DELETE RESTRICT ON UPDATE RESTRICT,
CONSTRAINT organization_fk4 FOREIGN KEY (child_organization_id) REFERENCES organization(organization_id) ON DELETE RESTRICT ON UPDATE RESTRICT
)
收到以下错误:
wrong column type encountered in column [org_path] in table [relationship]; found [“schemaName"."ltree" (Types#OTHER)], but expecting [ltree (Types#VARCHAR)]
谁能帮助如何解决这个问题?