View Javadoc
1   package ca.uhn.fhir.jpa.entity;
2   
3   /*
4    * #%L
5    * HAPI FHIR JPA Server
6    * %%
7    * Copyright (C) 2014 - 2018 University Health Network
8    * %%
9    * Licensed under the Apache License, Version 2.0 (the "License");
10   * you may not use this file except in compliance with the License.
11   * You may obtain a copy of the License at
12   * 
13   *      http://www.apache.org/licenses/LICENSE-2.0
14   * 
15   * Unless required by applicable law or agreed to in writing, software
16   * distributed under the License is distributed on an "AS IS" BASIS,
17   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18   * See the License for the specific language governing permissions and
19   * limitations under the License.
20   * #L%
21   */
22  
23  import javax.persistence.*;
24  import java.util.Date;
25  
26  @Entity
27  @Table(name = "HFJ_SUBSCRIPTION_STATS", uniqueConstraints = {
28  	@UniqueConstraint(name = "IDX_SUBSC_RESID", columnNames = {"RES_ID"}),
29  })
30  public class SubscriptionTable {
31  
32  	@Temporal(TemporalType.TIMESTAMP)
33  	@Column(name = "CREATED_TIME", nullable = false, insertable = true, updatable = false)
34  	private Date myCreated;
35  
36  	@Id
37  	@GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ_SUBSCRIPTION_ID")
38  	@SequenceGenerator(name = "SEQ_SUBSCRIPTION_ID", sequenceName = "SEQ_SUBSCRIPTION_ID")
39  	@Column(name = "PID", insertable = false, updatable = false)
40  	private Long myId;
41  
42  	@Column(name = "RES_ID", insertable = false, updatable = false)
43  	private Long myResId;
44  
45  	@OneToOne()
46  	@JoinColumn(name = "RES_ID", insertable = true, updatable = false, referencedColumnName = "RES_ID",
47  		foreignKey = @ForeignKey(name = "FK_SUBSC_RESOURCE_ID")
48  	)
49  	private ResourceTable mySubscriptionResource;
50  
51  	/**
52  	 * Constructor
53  	 */
54  	public SubscriptionTable() {
55  		super();
56  	}
57  
58  
59  	public Date getCreated() {
60  		return myCreated;
61  	}
62  
63  	public void setCreated(Date theCreated) {
64  		myCreated = theCreated;
65  	}
66  
67  	public Long getId() {
68  		return myId;
69  	}
70  
71  	public ResourceTable getSubscriptionResource() {
72  		return mySubscriptionResource;
73  	}
74  
75  	public void setSubscriptionResource(ResourceTable theSubscriptionResource) {
76  		mySubscriptionResource = theSubscriptionResource;
77  	}
78  
79  }