1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.juddi.model;
18
19 import javax.persistence.EmbeddedId;
20 import javax.persistence.Entity;
21 import javax.persistence.JoinColumn;
22 import javax.persistence.ManyToOne;
23 import javax.persistence.Table;
24
25
26
27
28 @Entity
29 @Table(name = "j3_service_projection")
30 public class ServiceProjection implements java.io.Serializable {
31
32 private static final long serialVersionUID = -8404899558507142913L;
33 @EmbeddedId
34 private ServiceProjectionId id = new ServiceProjectionId();
35 @ManyToOne
36 @JoinColumn(name = "business_key", insertable = false, updatable = false)
37 private BusinessEntity businessEntity;
38 @ManyToOne
39 @JoinColumn(name = "service_key", insertable = false, updatable = false)
40 private BusinessService businessService;
41
42 public ServiceProjection() {
43 }
44
45 public ServiceProjection(BusinessEntity businessEntity, BusinessService businessService) {
46 this.businessEntity = businessEntity;
47 this.businessService = businessService;
48
49 this.id.businessKey = businessEntity.entityKey;
50 this.id.serviceKey = businessService.entityKey;
51
52 businessEntity.getServiceProjections().add(this);
53 businessService.getProjectingBusinesses().add(this);
54 }
55
56 public ServiceProjectionId getId() {
57 return id;
58 }
59 public void setId(ServiceProjectionId id) {
60 this.id = id;
61 }
62
63 public BusinessEntity getBusinessEntity() {
64 return businessEntity;
65 }
66 public void setBusinessEntity(BusinessEntity businessEntity) {
67 this.businessEntity = businessEntity;
68 }
69
70 public BusinessService getBusinessService() {
71 return businessService;
72 }
73 public void setBusinessService(BusinessService businessService) {
74 this.businessService = businessService;
75 }
76
77 }