我想知道如何注释界面
@Entity
@Table(name = "FOLDER_TABLE")
public class Folder implements Serializable, Hierarchy {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "folder_id", updatable = false, nullable = false)
private int fId;
@Column(name = "folder_name")
private String folderName;
@OneToMany(cascade = CascadeType.ALL)
@JoinTable(name = "FOLDER_JOIN_FILE_INFORMATION_TABLE", joinColumns =
{ @JoinColumn(name = "folder_id") }, inverseJoinColumns =
{ @JoinColumn(name = "file_information_id") })
private List< Hierarchy > fileInformation = new ArrayList< Hierarchy >();
}
上面和下面是 2 个实现名为 Hierarchy 的接口的类,文件夹类有一个层次结构列表,即文件夹或文件信息类
@Entity
@Table(name = "FILE_INFORMATION_TABLE")
public class FileInformation implements Serializable, Hierarchy {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "file_information_id", updatable = false, nullable = false)
private int ieId;
@Column (name = "location")
private String location;
}
我已经在网上搜索了某种注释或解决方法,但我无法映射界面,这就是这个
public interface Hierarchy {
}
我在带有文件夹的层次结构列表上得到一个映射异常,但我不知道如何正确映射该类。