1 23 package com.lutris.appserver.server.sql; 24 25 import java.sql.ResultSet ; 26 import java.sql.SQLException ; 27 import org.enhydra.dods.DODS; 28 29 38 abstract public class CloneableDO extends CoreDO implements Cloneable { 39 40 43 public CloneableDO() { 44 super(); 45 } 46 47 55 public CloneableDO(ResultSet rs) throws SQLException , ObjectIdException { 56 super(rs); 57 } 58 59 68 public synchronized Object cloneUnique() 69 throws DatabaseManagerException, ObjectIdException { 70 CloneableDO dataObj = (CloneableDO) clone(); 71 72 dataObj.set_OId(DODS.getDatabaseManager().allocateObjectId()); 73 dataObj.set_Version(0); 74 dataObj.setPersistent(false); 75 return dataObj; 76 } 77 78 82 protected Object clone() { 83 Object obj = this; 84 85 try { 86 obj = super.clone(); 87 } catch (CloneNotSupportedException ex) { } 89 return obj; 90 } 91 } 92 | Popular Tags |