package <%=packageName%>.domain;

<% if (hibernateCache != 'no' && databaseType == 'sql') { %>import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;<% } %><% if (databaseType == 'nosql') { %>
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;<% } %><% if (databaseType == 'sql') { %>
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;<% } %>
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * An authority (a security role) used by Spring Security.
 */
<% if (databaseType == 'sql') { %>@Entity
@Table(name = "T_AUTHORITY")<% if (hibernateCache != 'no') { %>
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)<% } %><% } %><% if (databaseType == 'nosql') { %>
@Document(collection = "T_AUTHORITY")<% } %>
public class Authority implements Serializable {

    @NotNull
    @Size(min = 0, max = 50)
    @Id
    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        Authority authority = (Authority) o;

        if (name != null ? !name.equals(authority.name) : authority.name != null) {
            return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        return name != null ? name.hashCode() : 0;
    }

    @Override
    public String toString() {
        return "Authority{" +
                "name='" + name + '\'' +
                "}";
    }
}

@@ -473,16 +473,49 @@
 e.Table;
+%0Aimport javax.persistence.Column;
 %3C%25 %7D %25%3E%0A
@@ -1060,16 +1060,82 @@
 %0A    @Id
+%3C%25 if (databaseType == 'sql') %7B %25%3E%0A    @Column(length = 50)%3C%25 %7D %25%3E
 %0A    pri

Set column length = 50 to match liquibase and constraint validation