package com.codenetworkz.blog.models;

import jakarta.persistence.Entity;
import jakarta.persistence.ManyToMany;
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

@Entity
@Setter
@Getter
public class Role extends BaseModel {

    @Size(min = 3, max = 20,message ="Tag Name should be more then 3 and less then 20 character required." )
    private String name;

    @ManyToMany(mappedBy = "roles")
    private List<User> users;

    public Role() {
        super();
    }
}
