public class TestDeleteOneToOne extends BaseTestCase {
@Test
public void testCreateDeletePersistentFile() {
PersistentFile persistentFile = new PersistentFile("test.txt", new PersistentFileContent(
"test".getBytes()));
Ebean.save(persistentFile);
Integer id = persistentFile.getId();
Integer contentId = persistentFile.getPersistentFileContent().getId();
// should delete file and fileContent
Ebean.delete(PersistentFile.class, id);
PersistentFile file1 = Ebean.find(PersistentFile.class, id);
PersistentFileContent content1 = Ebean.find(PersistentFileContent.class, contentId);
Assert.assertNull(file1);
Assert.assertNull(content1);