initial add of EbeanORM server based on v2.8.1

This commit is contained in:
rbygrave
2012-09-14 00:40:39 +12:00
parent 2b74d0f9d9
commit 96ce4c0ddf
1188 changed files with 135034 additions and 0 deletions
@@ -0,0 +1,38 @@
package com.avaje.tests.basic;
import org.junit.Assert;
import com.avaje.ebean.Ebean;
import com.avaje.tests.model.basic.PFile;
import com.avaje.tests.model.basic.PFileContent;
import junit.framework.TestCase;
public class TestDeleteImportedPartial extends TestCase {
public void test() {
PFile persistentFile = new PFile("test.txt", new PFileContent("test".getBytes()));
Ebean.save(persistentFile);
Integer id = persistentFile.getId();
Integer contentId = persistentFile.getFileContent().getId();
PFile partialPfile = Ebean.find(PFile.class)
.select("id")
.where().idEq(persistentFile.getId())
.findUnique();
// should delete file and fileContent
Ebean.delete(partialPfile);
System.out.println("finished delete");
PFile file1 = Ebean.find(PFile.class, id);
PFileContent content1 = Ebean.find(PFileContent.class, contentId);
Assert.assertNull(file1);
Assert.assertNull(content1);
}
}