@ SuppressWarnings ( "unchecked" ) public Permission getPermission ( final String name ) { final Query query = pm . newQuery ( Permission . class , "name == :name" ) ; final List < Permission > result = ( List < Permission > ) query . execute ( name ) ; return Collections . isEmpty ( result ) ? null : result . get ( 0 ) ; }
Retrieves a Permission by its name .