public Entry createRoot(User user,String id,String type,String notebookId,Long modTime,Long createTime,Errors errors){
  if (user == null) {
    Errors.add(errors,errorMessages.errorUserIsNull());
    return null;
  }
  if (modTime == null) {
    Errors.add(errors,errorMessages.errorModTimeIsNull());
    return null;
  }
  if (createTime == null) {
    Errors.add(errors,errorMessages.errorCreateTimeIsNull());
    return null;
  }
  if (id != null && !idGenerator.isIdWellFormed(id)) {
    Errors.add(errors,errorMessages.errorIdIsInvalid());
    return null;
  }
  if (notebookId != null && !idGenerator.isIdWellFormed(notebookId)) {
    Errors.add(errors,errorMessages.errorNotebookIdIsInvalid());
    return null;
  }
  if (createTime.longValue() > modTime.longValue()) {
    modTime=createTime;
  }
  Entry root=new Entry();
  root.setDb(db);
  if (id == null) {
    id=idGenerator.getAnotherId();
  }
  root.setId(id);
  root.setCreateTime(createTime);
  root.setModTime(modTime);
  root.setType(type);
  root.setUserId(user.getId());
  root.setNotebookId(notebookId);
  db.persistEntry(root);
  return root;
}

public Entry createRoot ( User user , String id , String type , String notebookId , Long modTime , Long createTime , Errors errors ) { if ( user == null ) { Errors . add ( errors , errorMessages . errorUserIsNull ( ) ) ; return null ; } if ( modTime == null ) { Errors . add ( errors , errorMessages . errorModTimeIsNull ( ) ) ; return null ; } if ( createTime == null ) { Errors . add ( errors , errorMessages . errorCreateTimeIsNull ( ) ) ; return null ; } if ( id != null && ! idGenerator . isIdWellFormed ( id ) ) { Errors . add ( errors , errorMessages . errorIdIsInvalid ( ) ) ; return null ; } if ( notebookId != null && ! idGenerator . isIdWellFormed ( notebookId ) ) { Errors . add ( errors , errorMessages . errorNotebookIdIsInvalid ( ) ) ; return null ; } if ( createTime . longValue ( ) > modTime . longValue ( ) ) { modTime = createTime ; } Entry root = new Entry ( ) ; root . setDb ( db ) ; if ( id == null ) { id = idGenerator . getAnotherId ( ) ; } root . setId ( id ) ; root . setCreateTime ( createTime ) ; root . setModTime ( modTime ) ; root . setType ( type ) ; root . setUserId ( user . getId ( ) ) ; root . setNotebookId ( notebookId ) ; db . persistEntry ( root ) ; return root ; }
api method . returns a root entry .
