#992 - API Change - Change Transaction.close() to throw PersistenceException rather than IOException

This commit is contained in:
Rob Bygrave
2017-03-13 22:10:08 +13:00
parent 41a7f2c97e
commit 1d99a5c5a4
5 changed files with 95 additions and 10 deletions
@@ -1,5 +1,6 @@
package org.tests.model.draftable;
import io.ebean.Finder;
import io.ebean.annotation.DraftOnly;
import io.ebean.annotation.Draftable;
@@ -15,6 +16,8 @@ import java.util.List;
@Entity
public class Document extends BaseDomain {
public static DocumentFinder find = new DocumentFinder();
@Column(unique = true)
String title;
@@ -72,4 +75,14 @@ public class Document extends BaseDomain {
public void setWhenPublish(Timestamp whenPublish) {
this.whenPublish = whenPublish;
}
public static class DocumentFinder extends Finder<Long,Document> {
DocumentFinder() {
super(Document.class);
}
public Document asDraft(Long id) {
return query().asDraft().setId(id).findUnique();
}
}
}