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 java.util.ArrayList;
19  import java.util.List;
20  import javax.persistence.CascadeType;
21  import javax.persistence.Column;
22  import javax.persistence.Entity;
23  import javax.persistence.FetchType;
24  import javax.persistence.GeneratedValue;
25  import javax.persistence.GenerationType;
26  import javax.persistence.Id;
27  import javax.persistence.JoinColumn;
28  import javax.persistence.Lob;
29  import javax.persistence.ManyToOne;
30  import javax.persistence.OneToMany;
31  import javax.persistence.OrderBy;
32  import javax.persistence.Table;
33  
34  /**
35   *
36   */
37  @Entity
38  @Table(name="j3_reference")
39  public class Reference {
40      private static final long serialVersionUID = -3233157941119408701L;
41      
42      private Long id;
43      private SignedInfo signedInfo;
44      private List<SignatureTransform> transforms = new ArrayList<SignatureTransform>(0);
45      private String digestMethod;
46      private byte[] digestValue;
47      private String xmlID;
48      private String uri;
49      private String type;
50      
51      @Id
52      @GeneratedValue(strategy=GenerationType.AUTO)
53      public Long getId() {
54          return id;
55      }
56  
57      public void setId(Long id) {
58          this.id = id;
59      }
60  
61      @ManyToOne(fetch = FetchType.LAZY)
62      @JoinColumn(name = "signed_info_key", nullable = false)
63      public SignedInfo getSignedInfo() {
64          return signedInfo;
65      }
66  
67      public void setSignedInfo(SignedInfo signedInfo) {
68          this.signedInfo = signedInfo;
69      }
70      
71      @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "reference")
72      @OrderBy
73      public List<SignatureTransform> getTransforms() {
74          return transforms;
75      }
76  
77      public void setTransforms(List<SignatureTransform> transforms) {
78          this.transforms = transforms;
79      }
80  
81      @Column(name="digest_method")
82      public String getDigestMethod() {
83          return digestMethod;
84      }
85  
86      public void setDigestMethod(String digestMethod) {
87          this.digestMethod = digestMethod;
88      }
89  
90      @Lob
91      @Column(name="digest_value", length = 65636)
92      public byte[] getDigestValue() {
93          return digestValue;
94      }
95  
96      public void setDigestValue(byte[] digestValue) {
97          this.digestValue = digestValue;
98      }
99  
100     @Column(name="uri")
101     public String getUri() {
102         return uri;
103     }
104 
105     public void setUri(String uri) {
106         this.uri = uri;
107     }
108 
109     public String getType() {
110         return type;
111     }
112 
113     public void setType(String type) {
114         this.type = type;
115     }
116     
117     @Column(name="xml_id")
118     public String getXmlID() {
119         return xmlID;
120     }
121 
122     public void setXmlID(String xmlID) {
123         this.xmlID = xmlID;
124     }
125 }