mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
29 lines
661 B
Java
29 lines
661 B
Java
package com.avaje.tests.softdelete;
|
|
|
|
import com.avaje.ebean.BaseTestCase;
|
|
import com.avaje.ebean.Ebean;
|
|
import com.avaje.tests.model.softdelete.ESoftDelMid;
|
|
import org.junit.Test;
|
|
|
|
import static org.assertj.core.api.StrictAssertions.assertThat;
|
|
|
|
public class TestSoftDeleteOptionalRelationship extends BaseTestCase {
|
|
|
|
@Test
|
|
public void testFindWhenNullRelationship() {
|
|
|
|
ESoftDelMid mid1 = new ESoftDelMid(null, "mid1");
|
|
Ebean.save(mid1);
|
|
|
|
ESoftDelMid bean = Ebean.find(ESoftDelMid.class)
|
|
.setId(mid1.getId())
|
|
.fetch("top")
|
|
.findUnique();
|
|
|
|
assertThat(bean).isNotNull();
|
|
assertThat(bean.getTop()).isNull();
|
|
}
|
|
|
|
|
|
}
|