Skip to content

Commit b32786a

Browse files
committed
Registration VO
1 parent efcda10 commit b32786a

3 files changed

Lines changed: 244 additions & 0 deletions

File tree

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
package com.devnexus.ting.core.model.registration;
2+
3+
import com.devnexus.ting.core.model.BaseModelObject;
4+
import com.devnexus.ting.core.model.Event;
5+
import java.util.HashSet;
6+
import java.util.Set;
7+
import javax.persistence.Cacheable;
8+
import javax.persistence.Entity;
9+
import javax.persistence.ManyToMany;
10+
import javax.persistence.ManyToOne;
11+
import javax.validation.constraints.NotNull;
12+
import javax.xml.bind.annotation.XmlAccessType;
13+
import javax.xml.bind.annotation.XmlAccessorType;
14+
import javax.xml.bind.annotation.XmlRootElement;
15+
import javax.xml.bind.annotation.XmlTransient;
16+
import org.hibernate.annotations.Cache;
17+
import org.hibernate.annotations.CacheConcurrencyStrategy;
18+
19+
@Entity
20+
@Cacheable()
21+
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) //, include="non-lazy"
22+
@XmlRootElement
23+
@XmlAccessorType(XmlAccessType.FIELD)
24+
public class EventSignup extends BaseModelObject {
25+
26+
@ManyToMany
27+
private Set<PurchaseGroup> groups = new HashSet<>();
28+
29+
@ManyToOne
30+
//@JoinColumn(name="EVENT_ID")
31+
@NotNull
32+
@XmlTransient
33+
private Event event;
34+
35+
public Set<PurchaseGroup> getGroups() {
36+
return groups;
37+
}
38+
39+
public void setGroups(Set<PurchaseGroup> groups) {
40+
this.groups = groups;
41+
}
42+
43+
public Event getEvent() {
44+
return event;
45+
}
46+
47+
public void setEvent(Event event) {
48+
this.event = event;
49+
}
50+
51+
52+
53+
}
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
package com.devnexus.ting.core.model.registration;
2+
3+
import com.devnexus.ting.core.model.BaseModelObject;
4+
import com.devnexus.ting.core.model.Event;
5+
import java.util.HashSet;
6+
import java.util.Set;
7+
import javax.persistence.Cacheable;
8+
import javax.persistence.Entity;
9+
import javax.persistence.ManyToMany;
10+
import javax.persistence.ManyToOne;
11+
import javax.validation.constraints.NotNull;
12+
import javax.validation.constraints.Size;
13+
import javax.xml.bind.annotation.XmlAccessType;
14+
import javax.xml.bind.annotation.XmlAccessorType;
15+
import javax.xml.bind.annotation.XmlRootElement;
16+
import javax.xml.bind.annotation.XmlTransient;
17+
import org.hibernate.annotations.Cache;
18+
import org.hibernate.annotations.CacheConcurrencyStrategy;
19+
import org.hibernate.validator.constraints.NotEmpty;
20+
21+
/**
22+
* A purchase group is a collection if Items of which only one may be purchased.
23+
*
24+
* @author summers
25+
*/
26+
@Entity
27+
@Cacheable()
28+
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) //, include="non-lazy"
29+
@XmlRootElement
30+
@XmlAccessorType(XmlAccessType.FIELD)
31+
public class PurchaseGroup extends BaseModelObject {
32+
33+
@ManyToMany
34+
private Set<PurchaseItem> items = new HashSet<>();
35+
36+
@ManyToOne
37+
//@JoinColumn(name="EVENT_ID")
38+
@NotNull
39+
@XmlTransient
40+
private Event event;
41+
42+
@NotEmpty
43+
@Size(max = 255)
44+
protected String label;
45+
46+
@ManyToOne
47+
@NotNull
48+
@XmlTransient
49+
protected EventSignup eventSignup;
50+
51+
public Set<PurchaseItem> getItems() {
52+
return items;
53+
}
54+
55+
public void setItems(Set<PurchaseItem> items) {
56+
this.items = items;
57+
}
58+
59+
public Event getEvent() {
60+
return event;
61+
}
62+
63+
public void setEvent(Event event) {
64+
this.event = event;
65+
}
66+
67+
public String getLabel() {
68+
return label;
69+
}
70+
71+
public void setLabel(String label) {
72+
this.label = label;
73+
}
74+
75+
public EventSignup getEventSignup() {
76+
return eventSignup;
77+
}
78+
79+
public void setEventSignup(EventSignup eventSignup) {
80+
this.eventSignup = eventSignup;
81+
}
82+
83+
84+
85+
}
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
package com.devnexus.ting.core.model.registration;
2+
3+
import com.devnexus.ting.core.model.BaseModelObject;
4+
import com.devnexus.ting.core.model.Event;
5+
import java.math.BigDecimal;
6+
import java.util.Date;
7+
import javax.persistence.Cacheable;
8+
import javax.persistence.Entity;
9+
import javax.persistence.ManyToOne;
10+
import javax.persistence.Temporal;
11+
import javax.persistence.TemporalType;
12+
import javax.validation.constraints.NotNull;
13+
import javax.validation.constraints.Size;
14+
import javax.xml.bind.annotation.XmlAccessType;
15+
import javax.xml.bind.annotation.XmlAccessorType;
16+
import javax.xml.bind.annotation.XmlRootElement;
17+
import javax.xml.bind.annotation.XmlTransient;
18+
import org.hibernate.annotations.Cache;
19+
import org.hibernate.annotations.CacheConcurrencyStrategy;
20+
import org.hibernate.validator.constraints.NotEmpty;
21+
22+
@Entity
23+
@Cacheable()
24+
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) //, include="non-lazy"
25+
@XmlRootElement
26+
@XmlAccessorType(XmlAccessType.FIELD)
27+
public class PurchaseItem extends BaseModelObject {
28+
29+
@ManyToOne
30+
@NotNull
31+
@XmlTransient
32+
private PurchaseGroup purchaseGroup;
33+
34+
@ManyToOne
35+
//@JoinColumn(name="EVENT_ID")
36+
@NotNull
37+
@XmlTransient
38+
private Event event;
39+
40+
@NotEmpty
41+
@Size(max = 255)
42+
protected String label;
43+
44+
@Size(max = 255)
45+
private String value;
46+
47+
@NotEmpty
48+
private BigDecimal price;
49+
50+
@Temporal(TemporalType.DATE)
51+
private Date openDate;
52+
53+
@Temporal(TemporalType.DATE)
54+
private Date closeDate;
55+
56+
public PurchaseGroup getPurchaseGroup() {
57+
return purchaseGroup;
58+
}
59+
60+
public void setPurchaseGroup(PurchaseGroup purchaseGroup) {
61+
this.purchaseGroup = purchaseGroup;
62+
}
63+
64+
public Event getEvent() {
65+
return event;
66+
}
67+
68+
public void setEvent(Event event) {
69+
this.event = event;
70+
}
71+
72+
public String getLabel() {
73+
return label;
74+
}
75+
76+
public void setLabel(String label) {
77+
this.label = label;
78+
}
79+
80+
public BigDecimal getPrice() {
81+
return price;
82+
}
83+
84+
public void setPrice(BigDecimal price) {
85+
this.price = price;
86+
}
87+
88+
public Date getOpenDate() {
89+
return openDate;
90+
}
91+
92+
public void setOpenDate(Date openDate) {
93+
this.openDate = openDate;
94+
}
95+
96+
public Date getCloseDate() {
97+
return closeDate;
98+
}
99+
100+
public void setCloseDate(Date closeDate) {
101+
this.closeDate = closeDate;
102+
}
103+
104+
105+
106+
}

0 commit comments

Comments
 (0)