Coverage Report - org.directdemocracyportal.democracy.model.application.Authority
 
Classes in this File Line Coverage Branch Coverage Complexity
Authority
27%
3/11
N/A
1
 
 1  
 /*
 2  
 Copyright 2010 James Pether Sörling Licensed under the Apache License, Version 2.0 (the "License"); 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. 
 3  
         $Id
 4  
 */
 5  
 package org.directdemocracyportal.democracy.model.application;
 6  
 
 7  
 import javax.persistence.Entity;
 8  
 import javax.persistence.GeneratedValue;
 9  
 import javax.persistence.GenerationType;
 10  
 import javax.persistence.Id;
 11  
 
 12  
 import org.directdemocracyportal.democracy.model.core.BaseEntity;
 13  
 import org.hibernate.annotations.Cache;
 14  
 import org.hibernate.annotations.CacheConcurrencyStrategy;
 15  
 
 16  
 /**
 17  
  * The Class Authority.
 18  
  */
 19  
 @Entity
 20  
 @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
 21  
 public class Authority extends BaseEntity
 22  
 {
 23  
 
 24  
     /** The Constant serialVersionUID. */
 25  
     private static final long serialVersionUID = 5016030282926576514L;
 26  
 
 27  
     /** The id. */
 28  
     private Long id;
 29  
 
 30  
     /** The user role. */
 31  
     private SecurityRoleType userRole;
 32  
 
 33  
     /**
 34  
      * Instantiates a new authority.
 35  
      */
 36  1
     public Authority() {
 37  1
     }
 38  
 
 39  
     /**
 40  
      * Instantiates a new authority.
 41  
      *
 42  
      * @param userRole the user role
 43  
      */
 44  0
     public Authority(SecurityRoleType userRole) {
 45  0
         this.userRole = userRole;
 46  0
     }
 47  
 
 48  
     /*
 49  
      * (non-Javadoc)
 50  
      *
 51  
      * @see org.directdemocracyportal.democracy.model.core.BaseEntity#getId()
 52  
      */
 53  
     @Override
 54  
     @Id
 55  
     @GeneratedValue(strategy = GenerationType.AUTO)
 56  
     public Long getId() {
 57  1
         return this.id;
 58  
     }
 59  
 
 60  
     /**
 61  
      * Sets the id.
 62  
      *
 63  
      * @param id the new id
 64  
      */
 65  
     public void setId(Long id) {
 66  0
         this.id = id;
 67  0
     }
 68  
 
 69  
     /**
 70  
      * Gets the user role.
 71  
      *
 72  
      * @return the user role
 73  
      */
 74  
     public SecurityRoleType getUserRole() {
 75  0
         return userRole;
 76  
     }
 77  
 
 78  
     /**
 79  
      * Sets the user role.
 80  
      *
 81  
      * @param userRole the new user role
 82  
      */
 83  
     public void setUserRole(SecurityRoleType userRole) {
 84  0
         this.userRole = userRole;
 85  0
     }
 86  
 }