View Javadoc

1   /**
2    * Copyright 2005-2013 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.ksb.messaging;
17  
18  import java.io.Serializable;
19  
20  import javax.persistence.Column;
21  import javax.persistence.Entity;
22  import javax.persistence.GeneratedValue;
23  import javax.persistence.Id;
24  import javax.persistence.Lob;
25  import javax.persistence.Table;
26  
27  import org.kuali.rice.core.framework.persistence.jpa.OrmUtils;
28  import org.kuali.rice.ksb.service.KSBServiceLocator;
29  
30  /**
31   * A convenience class for encapsulating the serialized version of a ServiceDefinition object, allowing it to be lazy-loaded.
32   * 
33   * @author Kuali Rice Team (rice.collab@kuali.org)
34   */
35  @Entity
36  @Table(name="KRSB_FLT_SVC_DEF_T")
37  //@Sequence(name="KRSB_FLT_SVC_DEF_S", property="flattenedServiceDefinitionId")
38  public class FlattenedServiceDefinition implements Serializable {
39  	private static final long serialVersionUID = -4622179363250818637L;
40  	
41  	@Id
42  	@GeneratedValue(generator="KRSB_FLT_SVC_DEF_S")
43  	@Column(name="FLT_SVC_DEF_ID")
44  	private Long flattenedServiceDefinitionId;
45  	@Lob
46  	@Column(name="FLT_SVC_DEF", length=4000)
47  	private String flattenedServiceDefinitionData;
48  	
49  	//@PrePersist
50      public void beforeInsert() {
51          OrmUtils.populateAutoIncValue(this, KSBServiceLocator.getRegistryEntityManagerFactory().createEntityManager());
52      }
53  	
54  	public FlattenedServiceDefinition() {
55  	}
56  	
57  	public FlattenedServiceDefinition(String flattenedServiceDefinitionData) {
58  		this.flattenedServiceDefinitionData = flattenedServiceDefinitionData;
59  	}
60  	
61  	public Long getFlattenedServiceDefinitionId() {
62  		return this.flattenedServiceDefinitionId;
63  	}
64  	public void setFlattenedServiceDefinitionId(Long flattenedServiceDefinitionId) {
65  		this.flattenedServiceDefinitionId = flattenedServiceDefinitionId;
66  	}
67  	
68  	public String getFlattenedServiceDefinitionData() {
69  		return this.flattenedServiceDefinitionData;
70  	}
71  	public void setFlattenedServiceDefinitionData(String flattenedServiceDefinitionData) {
72  		this.flattenedServiceDefinitionData = flattenedServiceDefinitionData;
73  	}
74  	
75  }