Skip to content
This repository was archived by the owner on Jul 1, 2025. It is now read-only.

Commit 4fe87da

Browse files
committed
Ref: #185
1 parent d7137e5 commit 4fe87da

File tree

1 file changed

+128
-125
lines changed

1 file changed

+128
-125
lines changed
Lines changed: 128 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013 EnergyOS.org
2+
* Copyright 2013, 2014, 2015 EnergyOS.org
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -21,7 +21,6 @@
2121
// Generated on: 2013.08.27 at 01:43:57 PM EDT
2222
//
2323

24-
2524
package org.energyos.espi.common.domain;
2625

2726
import java.util.Calendar;
@@ -48,12 +47,17 @@
4847
import org.hibernate.annotations.LazyCollectionOption;
4948

5049
/**
51-
* Defines the parameters of a subscription between Third Party and Data Custodian.
50+
* Defines the parameters of a subscription between Third Party and Data
51+
* Custodian.
5252
* <p/>
53-
* <p>Java class for Subscription complex type.
53+
* <p>
54+
* Java class for Subscription complex type.
5455
* <p/>
55-
* <p>The following schema fragment specifies the expected content contained within this class.
56+
* <p>
57+
* The following schema fragment specifies the expected content contained within
58+
* this class.
5659
* <p/>
60+
*
5761
* <pre>
5862
* &lt;complexType name="Subscription">
5963
* &lt;complexContent>
@@ -69,127 +73,126 @@
6973
@Table(name = "subscriptions")
7074
@XmlJavaTypeAdapter(SubscriptionAdapter.class)
7175
@NamedQueries(value = {
72-
@NamedQuery(name = Subscription.QUERY_FIND_BY_ID, query = "SELECT subscription FROM Subscription subscription WHERE subscription.id = :id"),
73-
@NamedQuery(name = Subscription.QUERY_FIND_BY_UUID, query = "SELECT subscription FROM Subscription subscription WHERE subscription.uuid = :uuid"),
74-
@NamedQuery(name = Subscription.QUERY_FIND_ALL, query = "SELECT subscription FROM Subscription subscription"),
75-
@NamedQuery(name = Subscription.QUERY_FIND_BY_HASHED_ID, query = "SELECT subscription FROM Subscription subscription WHERE subscription.hashedId = :hashedId"),
76-
@NamedQuery(name = Subscription.QUERY_FIND_ALL_IDS, query = "SELECT subscription.id FROM Subscription subscription"),
77-
@NamedQuery(name = Subscription.QUERY_FIND_BY_AUTHORIZATION_ID, query = "SELECT subscription from Subscription subscription WHERE subscription.authorization.id = :id")
78-
})
79-
80-
public class Subscription
81-
extends IdentifiedObject {
76+
@NamedQuery(name = Subscription.QUERY_FIND_BY_ID, query = "SELECT subscription FROM Subscription subscription WHERE subscription.id = :id"),
77+
@NamedQuery(name = Subscription.QUERY_FIND_BY_UUID, query = "SELECT subscription FROM Subscription subscription WHERE subscription.uuid = :uuid"),
78+
@NamedQuery(name = Subscription.QUERY_FIND_ALL, query = "SELECT subscription FROM Subscription subscription"),
79+
@NamedQuery(name = Subscription.QUERY_FIND_BY_HASHED_ID, query = "SELECT subscription FROM Subscription subscription WHERE subscription.hashedId = :hashedId"),
80+
@NamedQuery(name = Subscription.QUERY_FIND_ALL_IDS, query = "SELECT subscription.id FROM Subscription subscription"),
81+
@NamedQuery(name = Subscription.QUERY_FIND_BY_AUTHORIZATION_ID, query = "SELECT subscription from Subscription subscription WHERE subscription.authorization.id = :id") })
82+
public class Subscription extends IdentifiedObject {
8283

8384
public final static String QUERY_FIND_BY_UUID = "Subscription.findByUUID";
84-
public static final String QUERY_FIND_BY_ID = "Subscription.findById";
85+
public static final String QUERY_FIND_BY_ID = "Subscription.findById";
8586
public final static String QUERY_FIND_ALL = "Subscription.findAll";
86-
public final static String QUERY_FIND_BY_HASHED_ID = "Subscription.findByHashedID";
87-
public static final String QUERY_FIND_ALL_IDS = "Subscription.findAllIds";
88-
public static final String QUERY_FIND_BY_AUTHORIZATION_ID = "Subscription.findByAuthorizationId";
89-
90-
private String hashedId;
91-
92-
@ManyToOne
93-
@JoinColumn(name = "retail_customer_id")
94-
@NotNull
95-
@XmlTransient
96-
protected RetailCustomer retailCustomer;
97-
98-
@XmlTransient
99-
@OneToOne (cascade = CascadeType.REMOVE)
100-
private Authorization authorization;
101-
102-
@OneToOne
103-
@NotNull
104-
private ApplicationInformation applicationInformation;
105-
106-
@XmlTransient
107-
@ManyToMany (cascade = CascadeType.DETACH)
108-
@LazyCollection(LazyCollectionOption.FALSE)
109-
private List<UsagePoint> usagePoints;
110-
111-
public Calendar lastUpdate;
112-
113-
public String getHashedId() {
114-
return hashedId;
115-
}
116-
117-
public void setHashedId(String hashedId) {
118-
this.hashedId = hashedId;
119-
}
120-
121-
public RetailCustomer getRetailCustomer() {
122-
return retailCustomer;
123-
}
124-
125-
public void setRetailCustomer(RetailCustomer retailCustomer) {
126-
this.retailCustomer = retailCustomer;
127-
}
128-
129-
public ApplicationInformation getApplicationInformation() {
130-
return applicationInformation;
131-
}
132-
133-
public void setApplicationInformation(ApplicationInformation applicationInformation) {
134-
this.applicationInformation = applicationInformation;
135-
}
136-
137-
public void setLastUpdate(Calendar lastUpdate) {
138-
this.lastUpdate = lastUpdate;
139-
}
140-
141-
public Calendar getLastUpdate() {
142-
return lastUpdate;
143-
}
144-
145-
public List<UsagePoint> getUsagePoints() {
146-
return usagePoints;
147-
}
148-
149-
public void setUsagePoints(List<UsagePoint> usagePoints) {
150-
this.usagePoints = usagePoints;
151-
}
152-
153-
public void removeUsagePoint(UsagePoint up) {
154-
usagePoints.remove(up);
155-
}
156-
157-
public Authorization getAuthorization() {
158-
return authorization;
159-
}
160-
161-
public void setAuthorization(Authorization authorization) {
162-
this.authorization = authorization;
163-
}
164-
165-
@Override
166-
public void merge(IdentifiedObject resource) {
167-
super.merge(resource);
168-
if (((Subscription)resource).applicationInformation != null) {
169-
this.applicationInformation = ((Subscription)resource).applicationInformation;
170-
}
171-
if (((Subscription)resource).authorization != null){
172-
this.authorization = ((Subscription)resource).authorization;
173-
}
174-
if (((Subscription)resource).lastUpdate != null) {
175-
this.lastUpdate = ((Subscription)resource).lastUpdate;
176-
}
177-
if (((Subscription)resource).retailCustomer != null) {
178-
this.retailCustomer = ((Subscription)resource).retailCustomer;
179-
}
180-
if (((Subscription)resource).usagePoints != null) {
181-
this.usagePoints = ((Subscription)resource).usagePoints;
182-
}
183-
}
184-
185-
@Override
186-
public void unlink() {
187-
super.unlink();
188-
this.usagePoints.clear();
189-
this.authorization = null;
190-
}
191-
192-
public boolean equals (Subscription s) {
193-
return (this.getId().equals(s.getId()));
194-
}
87+
public final static String QUERY_FIND_BY_HASHED_ID = "Subscription.findByHashedID";
88+
public static final String QUERY_FIND_ALL_IDS = "Subscription.findAllIds";
89+
public static final String QUERY_FIND_BY_AUTHORIZATION_ID = "Subscription.findByAuthorizationId";
90+
91+
private String hashedId;
92+
93+
@ManyToOne
94+
@JoinColumn(name = "retail_customer_id")
95+
@NotNull
96+
@XmlTransient
97+
protected RetailCustomer retailCustomer;
98+
99+
@XmlTransient
100+
@OneToOne(cascade = CascadeType.REMOVE)
101+
private Authorization authorization;
102+
103+
@OneToOne
104+
@NotNull
105+
@XmlTransient
106+
private ApplicationInformation applicationInformation;
107+
108+
@XmlTransient
109+
@ManyToMany(cascade = CascadeType.DETACH)
110+
@LazyCollection(LazyCollectionOption.FALSE)
111+
private List<UsagePoint> usagePoints;
112+
113+
private Calendar lastUpdate;
114+
115+
public String getHashedId() {
116+
return hashedId;
117+
}
118+
119+
public void setHashedId(String hashedId) {
120+
this.hashedId = hashedId;
121+
}
122+
123+
public RetailCustomer getRetailCustomer() {
124+
return retailCustomer;
125+
}
126+
127+
public void setRetailCustomer(RetailCustomer retailCustomer) {
128+
this.retailCustomer = retailCustomer;
129+
}
130+
131+
public ApplicationInformation getApplicationInformation() {
132+
return applicationInformation;
133+
}
134+
135+
public void setApplicationInformation(
136+
ApplicationInformation applicationInformation) {
137+
this.applicationInformation = applicationInformation;
138+
}
139+
140+
public void setLastUpdate(Calendar lastUpdate) {
141+
this.lastUpdate = lastUpdate;
142+
}
143+
144+
public Calendar getLastUpdate() {
145+
return lastUpdate;
146+
}
147+
148+
public List<UsagePoint> getUsagePoints() {
149+
return usagePoints;
150+
}
151+
152+
public void setUsagePoints(List<UsagePoint> usagePoints) {
153+
this.usagePoints = usagePoints;
154+
}
155+
156+
public void removeUsagePoint(UsagePoint up) {
157+
usagePoints.remove(up);
158+
}
159+
160+
public Authorization getAuthorization() {
161+
return authorization;
162+
}
163+
164+
public void setAuthorization(Authorization authorization) {
165+
this.authorization = authorization;
166+
}
167+
168+
@Override
169+
public void merge(IdentifiedObject resource) {
170+
super.merge(resource);
171+
if (((Subscription) resource).applicationInformation != null) {
172+
this.applicationInformation = ((Subscription) resource).applicationInformation;
173+
}
174+
if (((Subscription) resource).authorization != null) {
175+
this.authorization = ((Subscription) resource).authorization;
176+
}
177+
if (((Subscription) resource).lastUpdate != null) {
178+
this.lastUpdate = ((Subscription) resource).lastUpdate;
179+
}
180+
if (((Subscription) resource).retailCustomer != null) {
181+
this.retailCustomer = ((Subscription) resource).retailCustomer;
182+
}
183+
if (((Subscription) resource).usagePoints != null) {
184+
this.usagePoints = ((Subscription) resource).usagePoints;
185+
}
186+
}
187+
188+
@Override
189+
public void unlink() {
190+
super.unlink();
191+
this.usagePoints.clear();
192+
this.authorization = null;
193+
}
194+
195+
public boolean equals(Subscription s) {
196+
return (this.getId().equals(s.getId()));
197+
}
195198
}

0 commit comments

Comments
 (0)