public Map<Long, KeyTag> getKeyTagMapInId(List<Long> idList) { List<KeyTag> list = this.getKeyTagListInId(idList); Map<Long, KeyTag> map = new HashMap<Long, KeyTag>(); for (KeyTag o : list) { map.put(o.getTagId(), o); } return map; }
public long createKeyTag(String name) { KeyTag o = this.getKeyTagByName(name); if (o != null) { return o.getTagId(); } Query query = manager.createQuery(); query.addField("name", name); query.addField("searchcount", 0); long id = query.insert(KeyTag.class).longValue(); return id; }