com.loy.upm.sys.domain.entity.RoleEntity Maven / Gradle / Ivy
/*
* Copyright Loy Fu. 付厚俊
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.loy.upm.sys.domain.entity;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.loy.e.core.entity.BaseEntity;
import com.loy.e.core.entity.LogicDeleteable;
/**
*
* @author Loy Fu qq群 540553957 http://www.17jee.com
* @since 1.7
* @version 1.0.0
*
*/
@Entity
@Table(name = "loy_role")
public class RoleEntity extends BaseEntity implements LogicDeleteable {
private static final long serialVersionUID = 4826881461196601489L;
@Column(length = 100)
private String name;
@Column(length = 255)
private String description;
@JsonIgnore
@ManyToMany(fetch = FetchType.EAGER)
@JoinTable(name = "loy_role_resource", joinColumns = {
@JoinColumn(name = "role_id") }, inverseJoinColumns = {
@JoinColumn(name = "resource_id") })
//@Cache(region = "all", usage = CacheConcurrencyStrategy.READ_WRITE)
private Set resources = new HashSet();
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@Override
public void markDeleted() {
}
public Set getResources() {
return resources;
}
public void setResources(Set resources) {
this.resources = resources;
}
}