All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.robe.admin.hibernate.entity.Role Maven / Gradle / Ivy

There is a newer version: 0.5.0.0-1039
Show newest version
package io.robe.admin.hibernate.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.robe.auth.data.entry.RoleEntry;
import io.robe.hibernate.entity.BaseEntity;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

@Entity
@Table
public class Role extends BaseEntity implements RoleEntry {

    @Length(min = 2, max = 32)
    @NotEmpty
    @Column(length = 32, unique = true, nullable = false)
    private String code;

    @Length(min = 3, max = 50)
    @NotEmpty
    @Column(length = 50, nullable = false)
    private String name;

    public String getName() {
        return name;
    }

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

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @JsonIgnore
    @Override
    public String getId() {
        return getOid();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy