mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#992 - API Change - Change Transaction.close() to throw PersistenceException rather than IOException
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user