Class PrincipalTasks.PrincipalConverter

java.lang.Object
ch.tocco.nice2.userbase.impl.auth.PrincipalTasks.PrincipalConverter
All Implemented Interfaces:
OptionalTask<Entity,Principal>, PersistTask<Entity,Principal>
Enclosing class:
PrincipalTasks

public static class PrincipalTasks.PrincipalConverter extends Object implements OptionalTask<Entity,Principal>
Converts a principal entity into a Principal object. The roles are *not* loaded. But the relations to the type, status and interface language are resolved, as well as to the user entity.

The unique_ids of the status, type and interface language are set as attributes into the principal. Additionally, the primary key of the principal and the related user entity are set into the principal. The primary key of the principal is set as an object array as retrieved from PrimaryKey#getValues() whereas the primary key of the related user is stored as the long value. If the principal has no related user, the value -1L is used.