コード例 #1
0
ファイル: CommentAPI.java プロジェクト: hybridbpm/hybridbpm
 private Comment oDocumentToComment(ODocument doc) {
   Comment comment = new Comment();
   comment.setId(doc.getIdentity().toString());
   comment.setBody(doc.field("body").toString());
   comment.setParent(
       doc.field("parent") != null
           ? ((OIdentifiable) doc.field("parent")).getIdentity().toString()
           : null);
   comment.setTask(
       doc.field("task") != null
           ? ((OIdentifiable) doc.field("task")).getIdentity().toString()
           : null);
   comment.setCase(
       doc.field("case") != null
           ? ((OIdentifiable) doc.field("case")).getIdentity().toString()
           : null);
   comment.setCreator(
       doc.field("creator") != null
           ? ((OIdentifiable) doc.field("creator")).getIdentity().toString()
           : null);
   comment.setCreateDate(
       doc.field("createDate") != null ? (Date) doc.field("createDate", Date.class) : null);
   return comment;
 }