001    /**
002     * Copyright 2005-2012 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     */
016    package org.kuali.rice.ken.bo;
017    
018    import org.hibernate.annotations.GenericGenerator;
019    import org.hibernate.annotations.Parameter;
020    import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
021    
022    import javax.persistence.*;
023    
024    /**
025     * A reviewer for a notification publications to a NotificationChannel
026     * @author Kuali Rice Team (rice.collab@kuali.org)
027     */
028    @Entity
029    @Table(name="KREN_RVWER_T")
030    public class NotificationChannelReviewer extends PersistableBusinessObjectBase{
031        @Id
032        @GeneratedValue(generator="KREN_RVWER_S")
033            @GenericGenerator(name="KREN_RVWER_S",strategy="org.hibernate.id.enhanced.SequenceStyleGenerator",parameters={
034                            @Parameter(name="sequence_name",value="KREN_RVWER_S"),
035                            @Parameter(name="value_column",value="id")
036            })
037            @Column(name="RVWER_ID")
038            private Long id;
039        @OneToOne(fetch=FetchType.EAGER, cascade={CascadeType.REFRESH, CascadeType.DETACH })
040            @JoinColumn(name="CHNL_ID")
041            private NotificationChannel channel;
042        @Column(name="TYP", nullable=false)
043            private String reviewerType;
044        @Column(name="PRNCPL_ID", nullable=false)
045            private String reviewerId;
046    
047        /**
048         * Returns the primary key value
049         * @return the primary key value
050         */
051        public Long getId() {
052            return id;
053        }
054    
055        /**
056         * Sets the primary key value
057         * @param id the primary key value
058         */
059        public void setId(Long id) {
060            this.id = id;
061        }
062        
063        /**
064         * Returns the channel with which this reviewer is associated
065         * @return the channel with which this reviewer is associated
066         */
067        public NotificationChannel getChannel() {
068            return channel;
069        }
070    
071        /**
072         * Sets the channel with which this reviewer is associated
073         * @param channel the channel with which this reviewer is associated
074         */
075        public void setChannel(NotificationChannel channel) {
076            this.channel = channel;
077        }
078    
079        /**
080         * Returns the user id of the reviewer.  This is abstract but ultimately
081         * will need to be resolved to a KEW user/group
082         * @return the user id of the reviewer
083         */
084        public String getReviewerId() {
085            return reviewerId;
086        }
087        
088        /**
089         * Sets the user id of the reviewer
090         * @param reviewerId the user id of the reviewer
091         */
092        public void setReviewerId(String reviewerId) {
093            this.reviewerId = reviewerId;
094        }
095        
096        /**
097         * Returns the type of reviewer, USER or GROUP
098         * @return the type of reviewer, USER or GROUP
099         */
100        public String getReviewerType() {
101            return reviewerType;
102        }
103    
104        /**
105         * Sets the type of reviewer, USER or GROUP
106         * @param reviewerType the type of reviewer, USER or GROUP
107         */
108        public void setReviewerType(String reviewerType) {
109            this.reviewerType = reviewerType;
110        }
111    }