public static void fillId(TagDao tagDao, Tag tag) throws NoSuchTagException {
if (hasMissingId(tag) == true) {
Tag obj = getTag(tagDao, tag.getLabel());
if (obj == null) {
throw new NoSuchTagException("no such tag=" + tag);
}
tag.setId(obj.getId());
}
}