mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
53 lines
942 B
Java
53 lines
942 B
Java
package org.tests.basic.one2one;
|
|
|
|
import javax.persistence.CascadeType;
|
|
import javax.persistence.Entity;
|
|
import javax.persistence.GeneratedValue;
|
|
import javax.persistence.GenerationType;
|
|
import javax.persistence.Id;
|
|
import javax.persistence.OneToOne;
|
|
import javax.persistence.Table;
|
|
import javax.persistence.Version;
|
|
|
|
@Entity
|
|
@Table(name = "wheel")
|
|
public class Wheel {
|
|
@Id
|
|
@GeneratedValue(strategy = GenerationType.SEQUENCE)
|
|
private Long id;
|
|
|
|
@Version
|
|
private int version;
|
|
|
|
@OneToOne(mappedBy = "wheel", cascade = CascadeType.PERSIST)
|
|
private Tire tire;
|
|
|
|
public Long getId() {
|
|
return id;
|
|
}
|
|
|
|
public Wheel() {
|
|
super();
|
|
}
|
|
|
|
public void setId(Long id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public int getVersion() {
|
|
return version;
|
|
}
|
|
|
|
public void setVersion(int version) {
|
|
this.version = version;
|
|
}
|
|
|
|
public Tire getTire() {
|
|
return tire;
|
|
}
|
|
|
|
public void setTire(Tire tire) {
|
|
this.tire = tire;
|
|
}
|
|
}
|