@Component public class Project implements Cloneable{ public Object clone() throws CloneNotSupportedException { return super.clone(); } }
Project newProject=null; try { newProject =(Project) project.clone(); } catch (CloneNotSupportedException e) { newProject = new Project(); }
思路:
Project类实现Clonable接口