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.hibernate.annotations.GenericGenerator;
28  import org.hibernate.annotations.Parameter;
29  import org.kuali.rice.core.framework.persistence.jpa.OrmUtils;
30  import org.kuali.rice.ksb.service.KSBServiceLocator;
31  
32  /**
33   * A convenience class for encapsulating the serialized version of a ServiceDefinition object, allowing it to be lazy-loaded.
34   * 
35   * @author Kuali Rice Team (rice.collab@kuali.org)
36   */
37  @Entity
38  @Table(name="KRSB_FLT_SVC_DEF_T")
39  //@Sequence(name="KRSB_FLT_SVC_DEF_S", property="flattenedServiceDefinitionId")
40  public class FlattenedServiceDefinition implements Serializable {
41  	private static final long serialVersionUID = -4622179363250818637L;
42  	
43  	@Id
44  	@GeneratedValue(generator="KRSB_FLT_SVC_DEF_S")
45  	@GenericGenerator(name="KRSB_FLT_SVC_DEF_S",strategy="org.hibernate.id.enhanced.SequenceStyleGenerator",parameters={
46  			@Parameter(name="sequence_name",value="KRSB_FLT_SVC_DEF_S"),
47  			@Parameter(name="value_column",value="id")
48  	})
49  	@Column(name="FLT_SVC_DEF_ID")  
50  	private Long flattenedServiceDefinitionId;
51  	@Lob
52  	@Column(name="FLT_SVC_DEF", length=4000)
53  	private String flattenedServiceDefinitionData;
54  	
55  	//@PrePersist
56      public void beforeInsert() {
57          OrmUtils.populateAutoIncValue(this, KSBServiceLocator.getRegistryEntityManagerFactory().createEntityManager());
58      }
59  	
60  	public FlattenedServiceDefinition() {
61  	}
62  	
63  	public FlattenedServiceDefinition(String flattenedServiceDefinitionData) {
64  		this.flattenedServiceDefinitionData = flattenedServiceDefinitionData;
65  	}
66  	
67  	public Long getFlattenedServiceDefinitionId() {
68  		return this.flattenedServiceDefinitionId;
69  	}
70  	public void setFlattenedServiceDefinitionId(Long flattenedServiceDefinitionId) {
71  		this.flattenedServiceDefinitionId = flattenedServiceDefinitionId;
72  	}
73  	
74  	public String getFlattenedServiceDefinitionData() {
75  		return this.flattenedServiceDefinitionData;
76  	}
77  	public void setFlattenedServiceDefinitionData(String flattenedServiceDefinitionData) {
78  		this.flattenedServiceDefinitionData = flattenedServiceDefinitionData;
79  	}
80  	
81  }