本文整理汇总了Java中com.avaje.ebean.Ebean.delete方法的典型用法代码示例。如果您正苦于以下问题:Java Ebean.delete方法的具体用法?Java Ebean.delete怎么用?Java Ebean.delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.avaje.ebean.Ebean
的用法示例。
在下文中一共展示了Ebean.delete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: themeExit
import com.avaje.ebean.Ebean; //导入方法依赖的package包/类
public Result themeExit(String theme_id) {
try {
MyTheme themeClass = MyTheme.find.where()
.eq("theme_id", theme_id)
.eq("account_id", Account.find.where().eq("id", (session("userId"))).findUnique().id)
.findUnique();
if (themeClass == null) {
return status(ErrDefinition.E_THEME_EXIT_ERROR,
Messages.get("themejoin.failure"));
}
Ebean.delete(themeClass);
return ok(Json.toJson( themeClass));
}
catch (Throwable e) {
return status(ErrDefinition.E_THEME_JOIN_ERROR,
Messages.get("themeexit.failure"));
}
}
示例2: delete
import com.avaje.ebean.Ebean; //导入方法依赖的package包/类
public static Result delete(String article) {
try {
List<Comments> deleteComment = Comments.find.where()
.eq("article_id", article )
.findList();
for(Comments itera:deleteComment) {
CommentLevel2Controller.delete(itera.comments);
Ebean.delete(itera);
}
return ok(Json.toJson(""));
}
catch (Throwable e) {
return status(ErrDefinition.E_COMMENT_DELETE_ERROR,
Messages.get("commentdelete.failure"));
}
}
示例3: delete
import com.avaje.ebean.Ebean; //导入方法依赖的package包/类
public Result delete(String id) {
try {
String userId = session("userId");
Album album = Album.find.byId(id);
if (album != null) {
if (album.userId.compareToIgnoreCase(userId) == 0) {
Ebean.delete(Album.class, id);
}
}
}
catch (Throwable e) {
return status(ErrDefinition.E_ALBUM_DELETE_FAILED,
Messages.get("album.failure"));
}
return ok();
}
示例4: delete
import com.avaje.ebean.Ebean; //导入方法依赖的package包/类
public Result delete() {
Form<Article> ArticleForm =
Form.form(Article.class).bindFromRequest();
if (ArticleForm.hasErrors()) {
return status(ErrDefinition.E_ARTICLE_FORM_ERROR,
Messages.get("article.failure"));
}
try {
Article deleteArticle = ArticleForm.get();
// Check the updated article is by author
Article originArticle = Article.find.where()
.eq("article_id", deleteArticle.article_id )
.findUnique();
if (originArticle == null)
{
return status(ErrDefinition.E_ARTICLE_DELETE_ERROR,
Messages.get("commentdelete.failure"));
}
if (session("userId").equals(originArticle.author.id) ||(Account.find.where().eq("id", (session("userId"))).findUnique()!=null && Account.find.where().eq("id", (session("userId"))).findUnique().role>=1)) {
CommentController.delete(originArticle.article_id);
Ebean.delete(originArticle);
return ok(Json.toJson(originArticle));
}
else
{
return status(ErrDefinition.E_ARTICLE_DELETE_ERROR,
Messages.get("articledelete.failure"));
}
}
catch (Throwable e) {
return status(ErrDefinition.E_ARTICLE_DELETE_ERROR,
Messages.get("articledelete.failure"));
}
}
示例5: delete
import com.avaje.ebean.Ebean; //导入方法依赖的package包/类
@AccessLevel(level=2)
public Result delete(String id) {
try {
Ebean.delete(Application.class, id);
}
catch (Throwable e) {
return status(ErrDefinition.E_APP_NOT_FOUND,
Messages.get("application.actionfailed"));
}
return ok();
}
示例6: delete
import com.avaje.ebean.Ebean; //导入方法依赖的package包/类
@AccessLevel(level = 2)
public Result delete(String id) {
try {
Ebean.delete(ActivityChoice.class, id);
} catch (Throwable e) {
return status(ErrDefinition.E_ACTIVITY_CHOICE_DELETE_FAILED,
Messages.get("activitychoice.failure"));
}
return ok();
}
示例7: delete
import com.avaje.ebean.Ebean; //导入方法依赖的package包/类
public Result delete() {
try {
Ebean.delete(UserAddress.class, new AccountAppId(session("userId"), session("appId")));
return ok();
}
catch (Throwable e) {
return status(ErrDefinition.E_USER_ADDRESS_DELETE_ERROR);
}
}
示例8: delete
import com.avaje.ebean.Ebean; //导入方法依赖的package包/类
@AccessLevel(level=2)
public Result delete(String id) {
try {
Ebean.delete(Activity.class, id);
}
catch (Throwable e) {
return status(ErrDefinition.E_ACTIVITY_DELETE_FAILED,
Messages.get("activity.failure"));
}
return ok();
}
示例9: delete
import com.avaje.ebean.Ebean; //导入方法依赖的package包/类
@AccessLevel(level=2)
public Result delete(String id) {
try {
Ebean.delete(Program.class, id);
}
catch (Throwable e) {
return status(ErrDefinition.E_PROGRAM_DELETE_FAILED,
Messages.get("program.failure"));
}
return ok();
}
示例10: delete
import com.avaje.ebean.Ebean; //导入方法依赖的package包/类
@AccessLevel(level=2)
public Result delete(String id) {
try {
Ebean.delete(ProgramContent.class, id);
}
catch (Throwable e) {
return status(ErrDefinition.E_PROGRAM_CONTENT_DELETE_FAILED,
Messages.get("programcontent.failure"));
}
return ok();
}
示例11: deleteOne
import com.avaje.ebean.Ebean; //导入方法依赖的package包/类
public Result deleteOne(String picId){
HotPeoplePic pic = HotPeoplePic.find.byId(picId);
if(pic == null) {
return status(ErrDefinition.E_HOT_PIC_DELETE_FAILED,
Messages.get("hotpicDelete.failure"));
}
Ebean.delete(pic);
return ok();
}
示例12: delete
import com.avaje.ebean.Ebean; //导入方法依赖的package包/类
@AccessLevel(level=2)
public Result delete(String id) {
try {
Ebean.delete(ShakeRecord.class, id);
return ok();
}
catch (Throwable e) {
return status(ErrDefinition.E_SHAKE_RECORD_DELETE_ERROR,
Messages.get("shakerecord.failure"));
}
}
示例13: delete
import com.avaje.ebean.Ebean; //导入方法依赖的package包/类
@AccessLevel(level=2)
public Result delete(String id) {
try {
Ebean.delete(ActivityContent.class, id);
}
catch (Throwable e) {
return status(ErrDefinition.E_ACTIVITY_CONTENT_DELETE_FAILED,
Messages.get("activitycontent.failure"));
}
return ok();
}
示例14: delete
import com.avaje.ebean.Ebean; //导入方法依赖的package包/类
@AccessLevel(level=2)
public Result delete(String id) {
try {
Ebean.delete(Shop.class, id);
return ok();
}
catch (Throwable e) {
Logger.info(e.getMessage());
return status(ErrDefinition.E_SHOP_DELETE_ERROR,
Messages.get("shop.failure"));
}
}
示例15: deleteNotification
import com.avaje.ebean.Ebean; //导入方法依赖的package包/类
@Override
public void deleteNotification(Notification toDelete) {
Ebean.delete(toDelete);
}