Changeset 5395
- Timestamp:
- 08/28/08 21:35:15 (3 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openmrs/branches/data_synchronization_bidirectional/metadata/api/hibernate/org/openmrs/api/db/hibernate/Program.hbm.xml
r4969 r5395 47 47 48 48 <!-- bi-directional one-to-many association to ProgramWorkflow --> 49 <set name=" workflows" inverse="true" lazy="false" cascade="all-delete-orphan" order-by="date_created asc" access="field">49 <set name="allWorkflows" inverse="true" lazy="false" cascade="all-delete-orphan" order-by="date_created asc" access="field"> 50 50 <key column="program_id" not-null="true"/> 51 51 <one-to-many class="ProgramWorkflow" /> openmrs/branches/data_synchronization_bidirectional/src/api/org/openmrs/Program.java
r5138 r5395 47 47 private Date dateChanged; 48 48 private Boolean retired = false; 49 private Set<ProgramWorkflow> workflows;49 private Set<ProgramWorkflow> allWorkflows; 50 50 private String guid; 51 51 private transient String lastRecordGuid; 52 53 public String getLastRecordGuid() {54 return lastRecordGuid;55 }56 57 public void setLastRecordGuid(String lastRecordGuid) {58 this.lastRecordGuid = lastRecordGuid;59 }60 61 public String getGuid() {62 return guid;63 }64 65 public void setGuid(String guid) {66 this.guid = guid;67 }68 52 69 53 // ****************** … … 72 56 73 57 /** Default Constructor */ 74 public Program() { 75 workflows = new HashSet<ProgramWorkflow>(); 76 } 58 public Program() { } 77 59 78 60 /** Constructor with id */ … … 225 207 this.retired = retired; 226 208 } 209 210 public String getLastRecordGuid() { 211 return lastRecordGuid; 212 } 213 214 public void setLastRecordGuid(String lastRecordGuid) { 215 this.lastRecordGuid = lastRecordGuid; 216 } 217 218 public String getGuid() { 219 return guid; 220 } 221 222 public void setGuid(String guid) { 223 this.guid = guid; 224 } 227 225 228 226 /** … … 233 231 public Set<ProgramWorkflow> getWorkflows() { 234 232 Set<ProgramWorkflow> ret = new HashSet<ProgramWorkflow>(); 235 236 if (this.workflows != null) { 237 for (ProgramWorkflow workflow : this.workflows) { 238 if (workflow.isRetired() == false) 239 ret.add(workflow); 240 } 241 } 242 233 for (ProgramWorkflow workflow : getAllWorkflows()) { 234 if (workflow.isRetired() == false) 235 ret.add(workflow); 236 } 243 237 return ret; 244 238 } … … 246 240 /** 247 241 * Get all workflows...including the retired ones 248 *249 242 * @return 250 243 */ 251 244 public Set<ProgramWorkflow> getAllWorkflows() { 252 return workflows; 253 } 254 255 public void setWorkflows(Set<ProgramWorkflow> workflows) { 256 this.workflows = workflows; 245 if (allWorkflows == null) { 246 allWorkflows = new HashSet<ProgramWorkflow>(); 247 } 248 return allWorkflows; 249 } 250 251 public void setAllWorkflows(Set<ProgramWorkflow> allWorkflows) { 252 this.allWorkflows = allWorkflows; 257 253 } 258 254