mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
No effective change - adjust tests for deleting OneToOne - Tire to Wheel
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
package com.avaje.tests.basic.one2one;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.avaje.ebean.BaseTestCase;
|
||||
import com.avaje.ebean.Ebean;
|
||||
import org.junit.Test;
|
||||
|
||||
public class TestOneToOneWheelTire extends BaseTestCase {
|
||||
|
||||
@@ -16,6 +15,8 @@ public class TestOneToOneWheelTire extends BaseTestCase {
|
||||
w.setTire(t);
|
||||
|
||||
Ebean.save(t);
|
||||
|
||||
Ebean.delete(t);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,39 +12,41 @@ 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.ALL)
|
||||
private Tire tire;
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.SEQUENCE)
|
||||
private Long id;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@Version
|
||||
private int version;
|
||||
|
||||
public Wheel() {
|
||||
super();
|
||||
}
|
||||
@OneToOne(mappedBy = "wheel", cascade = CascadeType.PERSIST)
|
||||
private Tire tire;
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getVersion() {
|
||||
return version;
|
||||
}
|
||||
public Wheel() {
|
||||
super();
|
||||
}
|
||||
|
||||
public void setVersion(int version) {
|
||||
this.version = version;
|
||||
}
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Tire getTire() {
|
||||
return tire;
|
||||
}
|
||||
public int getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setTire(Tire tire) {
|
||||
this.tire = tire;
|
||||
}
|
||||
public void setVersion(int version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Tire getTire() {
|
||||
return tire;
|
||||
}
|
||||
|
||||
public void setTire(Tire tire) {
|
||||
this.tire = tire;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user