1 24 package org.ofbiz.entity; 25 26 import java.util.Map ; 27 28 import javolution.realtime.ObjectFactory; 29 30 import org.ofbiz.entity.model.ModelEntity; 31 32 39 public class GenericPK extends GenericEntity { 40 41 protected static final ObjectFactory genericPKFactory = new ObjectFactory() { 42 protected Object create() { 43 return new GenericPK(); 44 } 45 }; 46 47 protected GenericPK() { } 48 49 50 public static GenericPK create(ModelEntity modelEntity) { 51 GenericPK newPK = (GenericPK) genericPKFactory.object(); 52 newPK.init(modelEntity); 53 return newPK; 54 } 55 56 57 public static GenericPK create(ModelEntity modelEntity, Map fields) { 58 GenericPK newPK = (GenericPK) genericPKFactory.object(); 59 newPK.init(modelEntity, fields); 60 return newPK; 61 } 62 63 64 public static GenericPK create(GenericPK value) { 65 GenericPK newPK = (GenericPK) genericPKFactory.object(); 66 newPK.init(value); 67 return newPK; 68 } 69 70 73 public Object clone() { 74 GenericPK newEntity = GenericPK.create(this); 75 newEntity.setDelegator(internalDelegator); 76 return newEntity; 77 } 78 } 79 | Popular Tags |