예제 #1
0
  @Override
  public boolean equals(Object obj) {
    if (obj == null) {
      return false;
    }
    if (this == obj) {
      return true;
    }
    if (!(obj instanceof Tag)) {
      return false;
    }

    Tag other = (Tag) obj;
    return this.getName() == other.getName();
  }
예제 #2
0
  public static Set<String> synonym(String wow_names) {
    String[] names = wow_names.split(",");

    Set<String> temp = new HashSet<String>();
    for (String name : names) {
      Tag tag = Tag.where("name=:name", map("name", name)).single_fetch();
      if (tag == null) continue;
      List<Tag> tags =
          Tag.where("tag_synonym=:tag_synonym", map("tag_synonym", tag.tag_synonym)).fetch();
      for (Tag tag1 : tags) {
        temp.add(tag1.attr("name", String.class));
      }
    }
    return temp;
  }