mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
102 lines
1.8 KiB
Java
102 lines
1.8 KiB
Java
package com.avaje.tests.model.embedded;
|
|
|
|
import java.util.Date;
|
|
|
|
import javax.persistence.AttributeOverride;
|
|
import javax.persistence.AttributeOverrides;
|
|
import javax.persistence.Column;
|
|
import javax.persistence.Embedded;
|
|
import javax.persistence.Entity;
|
|
import javax.persistence.Id;
|
|
import javax.persistence.ManyToOne;
|
|
import javax.persistence.Version;
|
|
|
|
@Entity
|
|
public class EInvoice {
|
|
|
|
public enum State {
|
|
New, Processing, Approved
|
|
}
|
|
|
|
@Id
|
|
Long id;
|
|
|
|
@Version
|
|
Long version;
|
|
|
|
Date invoiceDate;
|
|
|
|
State state;
|
|
|
|
@ManyToOne
|
|
EPerson person;
|
|
|
|
@Embedded
|
|
@AttributeOverrides({
|
|
@AttributeOverride(name = "street", column = @Column(name = "ship_street")),
|
|
@AttributeOverride(name = "suburb", column = @Column(name = "ship_suburb")),
|
|
@AttributeOverride(name = "city", column = @Column(name = "ship_city"))
|
|
})
|
|
EAddress shipAddress;
|
|
|
|
@Embedded
|
|
EAddress billAddress;
|
|
|
|
public Long getId() {
|
|
return id;
|
|
}
|
|
|
|
public void setId(Long id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public Long getVersion() {
|
|
return version;
|
|
}
|
|
|
|
public void setVersion(Long version) {
|
|
this.version = version;
|
|
}
|
|
|
|
public State getState() {
|
|
return state;
|
|
}
|
|
|
|
public void setState(State state) {
|
|
this.state = state;
|
|
}
|
|
|
|
public Date getInvoiceDate() {
|
|
return invoiceDate;
|
|
}
|
|
|
|
public void setInvoiceDate(Date invoiceDate) {
|
|
this.invoiceDate = invoiceDate;
|
|
}
|
|
|
|
public EPerson getPerson() {
|
|
return person;
|
|
}
|
|
|
|
public void setPerson(EPerson person) {
|
|
this.person = person;
|
|
}
|
|
|
|
public EAddress getShipAddress() {
|
|
return shipAddress;
|
|
}
|
|
|
|
public void setShipAddress(EAddress shipAddress) {
|
|
this.shipAddress = shipAddress;
|
|
}
|
|
|
|
public EAddress getBillAddress() {
|
|
return billAddress;
|
|
}
|
|
|
|
public void setBillAddress(EAddress billAddress) {
|
|
this.billAddress = billAddress;
|
|
}
|
|
|
|
}
|