function ids = getCollectionIDs(conn, cid)
% GETCOLLECTIONIDS  Return the IDs of the object composing a collection.
%
% CALL:
%
%   ids = utils.repository.getCollectionIDs(conn, cid)
%
% PARAMETERS:
%
%   CONN   database connection implementing java.sql.Connection
%   CID    collection id
%

  rows = utils.mysql.execute(conn, 'SELECT nobjs, obj_ids FROM collections WHERE id = ?', cid);
  if isempty(rows)
    error('### collection %d not found', cid);
  end
  nobjs = rows{1};
  ids = strread(rows{2}, '%d', 'delimiter', ',');
  if length(ids) ~= nobjs
    error('### inconsistent collection description');
  end
  % transform column vector in row vector
  ids = ids';
  
end
