View Javadoc

1   /*
2    * Copyright 2007-2008 The Kuali Foundation
3    * 
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    * http://www.opensource.org/licenses/ecl2.php
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.kns.document;
17  
18  import java.util.LinkedHashMap;
19  
20  import javax.persistence.Column;
21  import javax.persistence.Entity;
22  import javax.persistence.Id;
23  import javax.persistence.Table;
24  
25  import org.kuali.rice.core.jpa.annotations.Sequence;
26  import org.kuali.rice.kns.bo.PersistableBusinessObjectBase;
27  import org.kuali.rice.kns.util.KNSPropertyConstants;
28  
29  /**
30   * List of business objects that this maintenance document is locking (prevents two documents from being routed trying to update the same object)
31   * Most maintenance documents have only one lock, but globals have many 
32   */
33  @Entity
34  @Sequence(name="KRNS_MAINT_LOCK_S", property="lockId")
35  @Table(name="KRNS_MAINT_LOCK_T")
36  public class MaintenanceLock extends PersistableBusinessObjectBase {
37      private static final long serialVersionUID = 7766326835852387301L;
38  	@Id
39      @Column(name="MAINT_LOCK_ID")
40      private String lockId;
41  	@Column(name="MAINT_LOCK_REP_TXT")
42  	private String lockingRepresentation;
43      @Column(name="DOC_HDR_ID")
44  	private String documentNumber;
45  
46      public String getLockId() {
47  		return this.lockId;
48  	}
49  
50  	public void setLockId(String lockId) {
51  		this.lockId = lockId;
52  	}
53  
54  	public String getLockingRepresentation() {
55          return lockingRepresentation;
56      }
57  
58      public void setLockingRepresentation(String lockingRepresentation) {
59          this.lockingRepresentation = lockingRepresentation;
60      }
61      
62      public String getDocumentNumber() {
63          return documentNumber;
64      }
65  
66      public void setDocumentNumber(String documentNumber) {
67          this.documentNumber = documentNumber;
68      }
69  
70      /**
71       * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper()
72       */
73      @SuppressWarnings("unchecked")
74  	protected LinkedHashMap toStringMapper() {
75          LinkedHashMap m = new LinkedHashMap();
76          m.put("lockingRepresentation", this.lockingRepresentation);
77          m.put(KNSPropertyConstants.DOCUMENT_NUMBER, getDocumentNumber());
78          return m;
79      }
80  }
81