public static MapdeletePerson(DispatchContext dctx, Map context) {
MapresultMap = ServiceUtil.returnSuccess();
String id = (String) context.get("id");
try {
GenericValue personGV = delegator.findOne("Person", UtilMisc.toMap("id", id), false);
if (personGV != null && !personGV.isEmpty()) {
personGV.remove();
}
} catch (GenericEntityException e) {
return ServiceUtil.returnError("Failed. " +e.getMessage());
}
return resultMap;
}
Deleting a Record in OFBiz using Java
This is an example on how to delete a record in OFBiz using Java. I am assuming that the you have created the service of this method in you service.xml.
Labels:
delegator,
DispatchContext,
findOne,
GenericEntityException,
GenericValue,
Java,
Map,
OFBiz,
remove(),
ServiceUtil
Subscribe to:
Post Comments (Atom)
You could do a .removeByPrimaryKey and save yourself a step... if you wanted.
ReplyDeleteyou have a nice site. thanks for sharing this site. there are various kinds of ebooks are available here
ReplyDeletehttp://feboook.blogspot.com
0204全裸網,777露點聊天室,Hiav潮吹聊天館,utlive脫衣秀聊天室,口交俱樂部,18禁聊天館,影音俱樂部,無碼俱樂部,uthome脫衣秀做愛聊天室,Hiav下載裸照聊天館,777口交自慰俱樂部,0204正妹淫叫俱樂部,uthome脫衣秀做愛,av辣妹大奶,777口交影音,0204正妹淫叫,utlive網,av聊天館,777俱樂部,0204俱樂部,0204全裸網,Hiav潮吹聊天館,777露點聊天室,utlive脫衣秀聊天室,口交俱樂部,18禁聊天館,影音俱樂部,無碼俱樂部,0204正妹淫叫俱樂部,777口交自慰俱樂部,Hiav下載裸照聊天館,uthome脫衣秀做愛聊天室,0204正妹淫叫,777口交影音,av辣妹大奶,uthome脫衣秀做愛,0204俱樂部,777俱樂部,av聊天館,utlive網
ReplyDelete18禁貼圖寫真視訊援交露點爆乳潮吹裸體裸照裸女愛愛無碼尋夢視訊聊天a漫a片a圖一夜情一葉情人妻激情情色寫真美女自拍辣妹自拍正妹自拍美女走光辣妹走光正妹走光脫衣秀脫衣走光色情自慰自拍
ReplyDeletemay the blessing be with you.........................................
ReplyDelete.removeByPrimaryKey is a deprecated method.
ReplyDelete