View Javadoc
1   /**
2    * Copyright 2005-2016 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.krad.maintenance;
17  
18  import javax.persistence.Column;
19  import javax.persistence.Entity;
20  import javax.persistence.GeneratedValue;
21  import javax.persistence.Id;
22  import javax.persistence.Table;
23  import javax.persistence.UniqueConstraint;
24  
25  import org.eclipse.persistence.annotations.Index;
26  import org.kuali.rice.krad.bo.DataObjectBase;
27  import org.kuali.rice.krad.data.jpa.PortableSequenceGenerator;
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  @Table(name="KRNS_MAINT_LOCK_T",uniqueConstraints= {
35          @UniqueConstraint(name="KRNS_MAINT_LOCK_TC0",columnNames="OBJ_ID")
36  })
37  public class MaintenanceLock extends DataObjectBase {
38  
39      private static final long serialVersionUID = 7766326835852387301L;
40  
41  	@Id
42      @GeneratedValue(generator = "KRNS_MAINT_LOCK_S")
43      @PortableSequenceGenerator(name = "KRNS_MAINT_LOCK_S")
44      @Column(name="MAINT_LOCK_ID",length=14)
45      private String lockId;
46  
47  	@Column(name="MAINT_LOCK_REP_TXT",length=500)
48  	private String lockingRepresentation;
49  
50      @Column(name="DOC_HDR_ID",length=14,nullable=false)
51      @Index(name="KRNS_MAINT_LOCK_TI2")
52  	private String documentNumber;
53  
54      public String getLockId() {
55  		return this.lockId;
56  	}
57  
58  	public void setLockId(String lockId) {
59  		this.lockId = lockId;
60  	}
61  
62  	public String getLockingRepresentation() {
63          return lockingRepresentation;
64      }
65  
66      public void setLockingRepresentation(String lockingRepresentation) {
67          this.lockingRepresentation = lockingRepresentation;
68      }
69  
70      public String getDocumentNumber() {
71          return documentNumber;
72      }
73  
74      public void setDocumentNumber(String documentNumber) {
75          this.documentNumber = documentNumber;
76      }
77  
78  }
79