Commit 763f08f4 by Tuukka Kivilahti

new connection

1 parent 6b44766d
......@@ -73,6 +73,12 @@ public class Bill implements ModelInterface {
@ManyToOne(optional = false)
private User user;
@ManyToOne
@JoinColumn(name = "events_id", referencedColumnName = "events_id")
private Event event;
@Override
public Integer getId() {
return id;
......@@ -83,6 +89,8 @@ public class Bill implements ModelInterface {
this.id = id;
}
@Version
@Column(nullable = false)
private int jpaVersionField;
......@@ -186,4 +194,18 @@ public class Bill implements ModelInterface {
public int getJpaVersionField() {
return jpaVersionField;
}
/**
* @return the event
*/
public Event getEvent() {
return event;
}
/**
* @param event the event to set
*/
public void setEvent(Event event) {
this.event = event;
}
}
......@@ -85,6 +85,9 @@ public class Event implements ModelInterface {
@Version
@Column(nullable = false)
private int jpaVersionField;
@OneToMany(mappedBy = "event")
private List<Bill> bills;
public Event() {
}
......@@ -246,4 +249,18 @@ public class Event implements ModelInterface {
public void setJpaVersionField(int jpaVersionField) {
this.jpaVersionField = jpaVersionField;
}
/**
* @return the bills
*/
public List<Bill> getBills() {
return bills;
}
/**
* @param bills the bills to set
*/
public void setBills(List<Bill> bills) {
this.bills = bills;
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!