如我有一颗自引用的树,简单的结构如:id,parentID,name,path这样
java代码pojo
package cn;
import java.util.HashSet;
import java.util.Set;
public class Testtree implements java.io.Serializable
{
// Fields
private Long id;
private Testtree testtree;
private String name;
private String path;
private Set testtrees = new HashSet(0);
// Constructors
/** default constructor */
public Testtree()
{
}
/** minimal constructor */
public Testtree(String name)
{
this.name = name;
}
/** full constructor */
public Testtree(Testtree testtree,String name,String path,Set testtrees)
{
this.testtree = testtree;
this.name = name;
this.path = path;
this.testtrees = testtrees;
}
// Property accessors
public Long getId()
{
return this.id;
}
public void setId(Long id)
{
this.id = id;
}
public Testtree getTesttree()
{
return this.testtree;
}
public void setTesttree(Testtree testtree)
{
this.testtree = testtree;
}
public String getName()
{
return this.name;
}
public void setName(String name)
{
this.name = name;
}
public String getPath()
{
return this.path;
}
public void setPath(String path)
{
this.path = path;
}
public Set getTesttrees()
{
return this.testtrees;
}
public void setTesttrees(Set testtrees)
{
this.testtrees = testtrees;
}
}
像这样的结构会不会引起内存的无法释放