1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kns.document; |
17 | |
|
18 | |
import javax.persistence.Column; |
19 | |
import javax.persistence.Entity; |
20 | |
import javax.persistence.EntityManagerFactory; |
21 | |
import javax.persistence.Id; |
22 | |
import javax.persistence.PrePersist; |
23 | |
import javax.persistence.Table; |
24 | |
|
25 | |
import org.kuali.rice.core.framework.persistence.jpa.OrmUtils; |
26 | |
import org.kuali.rice.core.framework.persistence.jpa.annotations.Sequence; |
27 | |
import org.kuali.rice.kns.bo.PersistableBusinessObjectBase; |
28 | |
import org.kuali.rice.kns.service.KNSServiceLocator; |
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
@Entity |
35 | |
@Sequence(name="KRNS_MAINT_LOCK_S",property="lockId") |
36 | |
@Table(name="KRNS_MAINT_LOCK_T") |
37 | 0 | public class MaintenanceLock extends PersistableBusinessObjectBase { |
38 | |
private static final long serialVersionUID = 7766326835852387301L; |
39 | |
@Id |
40 | |
@Column(name="MAINT_LOCK_ID") |
41 | |
private String lockId; |
42 | |
@Column(name="MAINT_LOCK_REP_TXT") |
43 | |
private String lockingRepresentation; |
44 | |
@Column(name="DOC_HDR_ID") |
45 | |
private String documentNumber; |
46 | |
|
47 | |
public String getLockId() { |
48 | 0 | return this.lockId; |
49 | |
} |
50 | |
|
51 | |
public void setLockId(String lockId) { |
52 | 0 | this.lockId = lockId; |
53 | 0 | } |
54 | |
|
55 | |
public String getLockingRepresentation() { |
56 | 0 | return lockingRepresentation; |
57 | |
} |
58 | |
|
59 | |
public void setLockingRepresentation(String lockingRepresentation) { |
60 | 0 | this.lockingRepresentation = lockingRepresentation; |
61 | 0 | } |
62 | |
|
63 | |
public String getDocumentNumber() { |
64 | 0 | return documentNumber; |
65 | |
} |
66 | |
|
67 | |
public void setDocumentNumber(String documentNumber) { |
68 | 0 | this.documentNumber = documentNumber; |
69 | 0 | } |
70 | |
|
71 | |
|
72 | |
|
73 | |
|
74 | |
|
75 | |
|
76 | |
@PrePersist |
77 | |
protected void customPrePersist() { |
78 | 0 | final EntityManagerFactory factory = KNSServiceLocator.getApplicationEntityManagerFactory(); |
79 | 0 | OrmUtils.populateAutoIncValue(this, factory.createEntityManager()); |
80 | |
|
81 | 0 | super.prePersist(); |
82 | 0 | } |
83 | |
|
84 | |
} |
85 | |
|