4
import javax.persistence.*;
7
import play.data.validation.*;
10
public class Tag extends Model implements Comparable<Tag> {
15
private Tag(String name) {
19
public static Tag findOrCreateByName(String name) {
20
Tag tag = Tag.find("byName", name).one();
27
public static List<Map> getCloud() {
28
List<Map> result = Tag.find(
29
"select new map(t.name as tag, count(p.id) as pound) from Post p join p.tags as t group by t.name"
34
public String toString() {
38
public int compareTo(Tag otherTag) {
39
return name.compareTo(otherTag.name);
b'\\ No newline at end of file'