View Javadoc
1   /*
2    * Copyright 2012 The Apache Software Foundation.
3    *
4    * Licensed under the Apache 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.apache.org/licenses/LICENSE-2.0
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.apache.juddi.model;
17  
18  import javax.persistence.Column;
19  import javax.persistence.Entity;
20  import javax.persistence.FetchType;
21  import javax.persistence.GeneratedValue;
22  import javax.persistence.GenerationType;
23  import javax.persistence.Id;
24  import javax.persistence.JoinColumn;
25  import javax.persistence.Lob;
26  import javax.persistence.ManyToOne;
27  import javax.persistence.Table;
28  
29  /**
30   *
31   */
32  @Entity
33  @Table(name="j3_object_type_content")
34  public class ObjectTypeContent implements java.io.Serializable {
35      private static final long serialVersionUID = -3233157941119408715L;
36      
37      private Long id;
38      private ObjectType objectType;
39      private byte[] content;
40      
41      @Id
42      @GeneratedValue(strategy=GenerationType.AUTO)
43      public Long getId() {
44          return id;
45      }
46  
47      public void setId(Long id) {
48          this.id = id;
49      }
50  
51      @ManyToOne(fetch = FetchType.LAZY)
52      @JoinColumn(name = "object_type_key", nullable = false)
53      public ObjectType getObjectType() {
54          return objectType;
55      }
56  
57      public void setObjectType(ObjectType objectType) {
58          this.objectType = objectType;
59      }
60      
61      @Lob
62      @Column(length = 65636)
63      public byte[] getContent() {
64          return content;
65      }
66      
67      public void setContent(byte[] content) {
68          this.content = content;
69      }
70  }