code: private void setFkWhere(Where<MetadataReference, Void> where, long fileId,
  			Long parentId) throws SQLException {
  
  		where.eq(MetadataReference.COLUMN_FILE_ID, fileId);
  		if (parentId == null) {
  			where.and().isNull(MetadataReference.COLUMN_PARENT_ID);
  		} else {
  			where.and().eq(MetadataReference.COLUMN_PARENT_ID, parentId);
  		}
  
  	}
docs: Set the foreign key column criteria in the where clause
  
  @param where
  where clause
  @param fileId
  file id
  @param parentId
  parent id
  @throws SQLException