1.递归树的使用
a.先看一下实体类的定义
@Entity
@Table(name = "EXAMPLE_CATEGORIES")
public class ExampleCategory implements Serializable {
private static final long serialVersionUID = -3446596720169668211L;
private long id;//主键
private Long categoryId;//上级Id
private String label;//名称
private Collection<ExampleCategory> categories;//集合属性
@OneToMany(fetch = FetchType.LAZY)
@JoinColumn(name = "CATEGORY_ID", insertable = false, updatable = false)
@OrderBy(value = "sortFlag")
public Collection<Ex
a.先看一下实体类的定义
@Entity
@Table(name = "EXAMPLE_CATEGORIES")
public class ExampleCategory implements Serializable {
private static final long serialVersionUID = -3446596720169668211L;
private long id;//主键
private Long categoryId;//上级Id
private String label;//名称
private Collection<ExampleCategory> categories;//集合属性
@OneToMany(fetch = FetchType.LAZY)
@JoinColumn(name = "CATEGORY_ID", insertable = false, updatable = false)
@OrderBy(value = "sortFlag")
public Collection<Ex