Class RoleServiceImpl

  • All Implemented Interfaces:
    RoleService

    @Transactional
    @Service("roleService")
    public class RoleServiceImpl
    extends java.lang.Object
    implements RoleService
    Implements the RoleService interface
    • Constructor Summary

      Constructors 
      Constructor Description
      RoleServiceImpl()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void delete​(long id)
      Deletes the role record based off the provided primary key
      void deleteAll()
      Deletes all records and their associated records from the database
      java.util.List<Role> findAll()
      Returns a list of all the roles
      Role findRoleById​(long id)
      Returns the role with the given primary key
      Role findRoleByName​(java.lang.String name)
      Returns the role with the given name
      Role save​(Role role)
      Given a complete role object, saves that role object in the database If a primary key is provided, the record is completely replaced If no primary key is provided, one is automatically generated and the record is added to the database
      Role update​(Role role, long id)
      Updates the provided fields in the role record referenced by the primary key
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RoleServiceImpl

        public RoleServiceImpl()
    • Method Detail

      • findAll

        public java.util.List<Role> findAll()
        Description copied from interface: RoleService
        Returns a list of all the roles
        Specified by:
        findAll in interface RoleService
        Returns:
        List of roles
      • findRoleById

        public Role findRoleById​(long id)
        Description copied from interface: RoleService
        Returns the role with the given primary key
        Specified by:
        findRoleById in interface RoleService
        Returns:
        Role object with the given primarry key or throws an exception if not found
      • findRoleByName

        public Role findRoleByName​(java.lang.String name)
        Description copied from interface: RoleService
        Returns the role with the given name
        Specified by:
        findRoleByName in interface RoleService
        Parameters:
        name - The name (String) of the role you seek
        Returns:
        Role object with given name or throws an exception if not found
      • save

        @Transactional
        public Role save​(Role role)
        Description copied from interface: RoleService
        Given a complete role object, saves that role object in the database If a primary key is provided, the record is completely replaced If no primary key is provided, one is automatically generated and the record is added to the database
        Specified by:
        save in interface RoleService
        Parameters:
        role - The role object (Role) to be saved
        Returns:
        The saved role object including any automatically generated fields
      • update

        @Transactional
        public Role update​(Role role,
                           long id)
        Description copied from interface: RoleService
        Updates the provided fields in the role record referenced by the primary key
        Specified by:
        update in interface RoleService
        Parameters:
        role - Only the role fields to be updated
        id - The primary key (long) of the user to be updated
        Returns:
        Update role object
      • delete

        @Transactional
        public void delete​(long id)
        Description copied from interface: RoleService
        Deletes the role record based off the provided primary key
        Specified by:
        delete in interface RoleService
        Parameters:
        id - The primary key (long) of the role to be deleted
      • deleteAll

        @Transactional
        public void deleteAll()
        Description copied from interface: RoleService
        Deletes all records and their associated records from the database
        Specified by:
        deleteAll in interface RoleService