【发布时间】:2018-03-11 13:53:45
【问题描述】:
我想为我的文件路径树将目录保存到数据库中,但在初始化 Hibernate 时出现此错误:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [hibernate-config.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: Could not determine type for: java.nio.file.Path, at table: BasePlan_selectedPaths, for columns: [org.hibernate.mapping.Column(selected_paths)]
Here 是我的文件路径树:
@Column(name = "selected_paths")
@ElementCollection(targetClass = Path.class)
private Set<Path> selectedPaths;
【问题讨论】:
标签: java spring hibernate hibernate-mapping