001/** 002 * Copyright 2005-2016 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.kuali.rice.kim.impl.group; 017 018import java.util.List; 019import java.util.Map; 020 021import javax.persistence.Column; 022import javax.persistence.MappedSuperclass; 023import javax.persistence.Transient; 024 025import org.kuali.rice.kim.api.group.Group; 026import org.kuali.rice.kim.api.identity.Person; 027import org.kuali.rice.kim.api.services.KimApiServiceLocator; 028import org.kuali.rice.kim.framework.group.GroupEbo; 029import org.kuali.rice.kim.impl.type.KimTypeBo; 030import org.kuali.rice.krad.bo.DataObjectBase; 031import org.kuali.rice.krad.data.jpa.converters.BooleanYNConverter; 032 033@MappedSuperclass 034public abstract class GroupBase extends DataObjectBase implements GroupEbo { 035 private static final long serialVersionUID = 1L; 036 037 @Column(name="GRP_NM") 038 private String name; 039 040 @Column(name="GRP_DESC",length=4000) 041 private String description; 042 043 @Column(name="ACTV_IND") 044 @javax.persistence.Convert(converter=BooleanYNConverter.class) 045 private boolean active; 046 047 @Column(name="KIM_TYP_ID") 048 private String kimTypeId; 049 050 @Column(name="NMSPC_CD") 051 private String namespaceCode; 052 053 @Transient 054 private List<Person> memberPersons; 055 056 @Transient 057 private List<Group> memberGroups; 058 059 @Transient 060 protected Map<String,String> attributes; 061 062 063 @Override 064 public Map<String,String> getAttributes() { 065 return attributes; 066 } 067 068 public void setAttributes(Map<String, String> attributes) { 069 this.attributes = attributes; 070 } 071 072 @Override 073 public String getName() { 074 return name; 075 } 076 077 public void setName(String name) { 078 this.name = name; 079 } 080 081 @Override 082 public String getDescription() { 083 return description; 084 } 085 086 public void setDescription(String description) { 087 this.description = description; 088 } 089 090 @Override 091 public boolean isActive() { 092 return active; 093 } 094 095 public void setActive(boolean active) { 096 this.active = active; 097 } 098 099 @Override 100 public String getKimTypeId() { 101 return kimTypeId; 102 } 103 104 public void setKimTypeId(String kimTypeId) { 105 this.kimTypeId = kimTypeId; 106 } 107 108 @Override 109 public String getNamespaceCode() { 110 return namespaceCode; 111 } 112 113 public void setNamespaceCode(String namespaceCode) { 114 this.namespaceCode = namespaceCode; 115 } 116 117 public KimTypeBo getKimTypeInfo() { 118 return KimTypeBo.from(KimApiServiceLocator.getKimTypeInfoService().getKimType(this.kimTypeId)); 119 } 120 121 @Override 122 public void refresh() { 123 } 124}