@ RunAsSystem public Group getGroup ( String groupName ) { Fetch roleFetch = new Fetch ( ) . field ( RoleMetadata . NAME ) . field ( RoleMetadata . LABEL ) ; Fetch fetch = new Fetch ( ) . field ( GroupMetadata . ROLES , roleFetch ) . field ( GroupMetadata . NAME ) . field ( GroupMetadata . LABEL ) . field ( GroupMetadata . DESCRIPTION ) . field ( GroupMetadata . ID ) . field ( GroupMetadata . PUBLIC ) . field ( GroupMetadata . ROOT_PACKAGE ) ; Group group = dataService . query ( GroupMetadata . GROUP , Group . class ) . eq ( GroupMetadata . NAME , groupName ) . fetch ( fetch ) . findOne ( ) ; if ( group == null ) { throw new UnknownEntityException ( groupMetadata , groupMetadata . getAttribute ( GroupMetadata . NAME ) , groupName ) ; } return group ; }
Get the group entity by its unique name .