当前位置: 首页>>代码示例>>Java>>正文


Java Ebean.delete方法代码示例

本文整理汇总了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"));
	}		
}
 
开发者ID:chengxp3,项目名称:galaxy,代码行数:21,代码来源:ThemeController.java

示例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"));
	}		
}
 
开发者ID:chengxp3,项目名称:galaxy,代码行数:20,代码来源:CommentController.java

示例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();
}
 
开发者ID:chengxp3,项目名称:galaxy,代码行数:20,代码来源:AlbumController.java

示例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"));
	}		
}
 
开发者ID:chengxp3,项目名称:galaxy,代码行数:41,代码来源:ArticleController.java

示例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();
}
 
开发者ID:chengxp3,项目名称:galaxy,代码行数:13,代码来源:ApplicationController.java

示例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();
}
 
开发者ID:chengxp3,项目名称:galaxy,代码行数:12,代码来源:ActivityChoiceController.java

示例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);
    }
}
 
开发者ID:chengxp3,项目名称:galaxy,代码行数:10,代码来源:UserAddressController.java

示例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();
}
 
开发者ID:chengxp3,项目名称:galaxy,代码行数:13,代码来源:ActController.java

示例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();
}
 
开发者ID:chengxp3,项目名称:galaxy,代码行数:13,代码来源:ProgramController.java

示例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();
}
 
开发者ID:chengxp3,项目名称:galaxy,代码行数:14,代码来源:ProgramContentController.java

示例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();
}
 
开发者ID:chengxp3,项目名称:galaxy,代码行数:10,代码来源:HotPeoplePicController.java

示例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"));			
	}
}
 
开发者ID:chengxp3,项目名称:galaxy,代码行数:12,代码来源:ShakeRecordController.java

示例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();
}
 
开发者ID:chengxp3,项目名称:galaxy,代码行数:13,代码来源:ActivityContentController.java

示例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"));
	}
}
 
开发者ID:chengxp3,项目名称:galaxy,代码行数:14,代码来源:ShopController.java

示例15: deleteNotification

import com.avaje.ebean.Ebean; //导入方法依赖的package包/类
@Override
public void deleteNotification(Notification toDelete) {
    Ebean.delete(toDelete);
}
 
开发者ID:peerdavid,项目名称:ComeAndGo,代码行数:5,代码来源:NotificationRepositoryImpl.java


注:本文中的com.avaje.ebean.Ebean.delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。