1 25 package org.ofbiz.shark.instance; 26 27 import org.ofbiz.entity.GenericDelegator; 28 import org.ofbiz.entity.GenericValue; 29 import org.ofbiz.entity.GenericEntityException; 30 import org.ofbiz.base.util.UtilMisc; 31 import org.ofbiz.base.util.Debug; 32 import org.ofbiz.shark.container.SharkContainer; 33 34 import org.enhydra.shark.api.internal.instancepersistence.*; 35 36 43 public class AndJoinEntry extends InstanceEntityObject implements AndJoinEntryInterface { 44 45 public static final String module = AndJoinEntry.class.getName(); 46 47 protected GenericValue andJoin = null; 48 protected boolean newValue = false; 49 50 protected AndJoinEntry(EntityPersistentMgr mgr, GenericDelegator delegator, String andJoinId) { 51 super(mgr, delegator); 52 if (this.delegator != null) { 53 try { 54 this.andJoin = delegator.findByPrimaryKey("WfAndJoin", UtilMisc.toMap("andJoinId", andJoinId)); 55 } catch (GenericEntityException e) { 56 Debug.logError(e, module); 57 } 58 } else { 59 Debug.logError("Invalid delegator object passed", module); 60 } 61 } 62 63 protected AndJoinEntry(EntityPersistentMgr mgr, GenericValue andJoin) { 64 super(mgr, andJoin.getDelegator()); 65 this.andJoin = andJoin; 66 } 67 68 public AndJoinEntry(EntityPersistentMgr mgr, GenericDelegator delegator) { 69 super(mgr, delegator); 70 this.newValue = true; 71 this.andJoin = delegator.makeValue("WfAndJoin", UtilMisc.toMap("andJoinId", delegator.getNextSeqId("WfAndJoin"))); 72 } 73 74 public static AndJoinEntry getInstance(EntityPersistentMgr mgr, GenericValue andJoin) { 75 AndJoinEntry var = new AndJoinEntry(mgr, andJoin); 76 if (var.isLoaded()) { 77 return var; 78 } 79 return null; 80 } 81 82 public static AndJoinEntry getInstance(EntityPersistentMgr mgr, String andJoinId) { 83 AndJoinEntry var = new AndJoinEntry(mgr, SharkContainer.getDelegator(), andJoinId); 84 if (var.isLoaded()) { 85 return var; 86 } 87 return null; 88 } 89 90 public boolean isLoaded() { 91 if (andJoin == null) { 92 return false; 93 } 94 return true; 95 } 96 97 public void setProcessId(String procId) { 98 andJoin.set("processId", procId); 99 } 100 101 public String getProcessId() { 102 return andJoin.getString("processId"); 103 } 104 105 public void setActivitySetDefinitionId(String asdId) { 106 andJoin.set("activitySetDefId", asdId); 107 } 108 109 public String getActivitySetDefinitionId() { 110 return andJoin.getString("activitySetDefId"); 111 } 112 113 public void setActivityDefinitionId(String adId) { 114 andJoin.set("activityDefId", adId); 115 } 116 117 public String getActivityDefinitionId() { 118 return andJoin.getString("activityDefId"); 119 } 120 121 public void setActivityId(String actId) { 122 andJoin.set("activityId", actId); 123 } 124 125 public String getActivityId() { 126 return andJoin.getString("activityId"); 127 } 128 129 public void store() throws GenericEntityException { 130 if (newValue) { 131 newValue = false; 132 delegator.createOrStore(andJoin); 133 } else { 134 delegator.store(andJoin); 135 } 136 } 137 138 public void reload() throws GenericEntityException { 139 if (!newValue) { 140 andJoin.refresh(); 141 } 142 } 143 144 public void remove() throws GenericEntityException { 145 if (!newValue) { 146 delegator.removeValue(andJoin); 147 } 148 } 149 } 150 | Popular Tags |