1
2
3
4
5
6
7
8
9 package org.kuali.student.r1.common.entity;
10
11 import javax.persistence.Embedded;
12 import javax.persistence.MappedSuperclass;
13
14 import org.kuali.student.common.util.UUIDHelper;
15
16 @Deprecated
17 @MappedSuperclass
18 public abstract class VersionEntity extends MetaEntity {
19
20 @Embedded
21 private Version version;
22
23 @Override
24 protected void onPrePersist(){
25 super.onPrePersist();
26 if(version == null){
27 version = new Version();
28 }
29 if(version.getSequenceNumber()==null){
30 version.setSequenceNumber(Long.valueOf(1));
31 }
32 version.setVersionIndId(UUIDHelper.genStringUUID(version.getVersionIndId()));
33 }
34
35
36 public Version getVersion() {
37 return version;
38 }
39
40 public void setVersion(Version version) {
41 this.version = version;
42 }
43 }