@Override public User getAppUserByIdentifier( UUID applicationId, Identifier identifier ) throws Exception { EntityManager em = emf.getEntityManager(applicationId); return em.get( em.getUserByIdentifier( identifier ), User.class ); }
public User getUserEntityByIdentifier( UUID applicationId, Identifier identifier ) throws Exception { EntityManager em = emf.getEntityManager( applicationId ); return em.get(em.getUserByIdentifier(identifier), User.class); }
@Override public ServiceResults getItemByName( ServiceContext context, String name ) throws Exception { EntityRef entity = null; Identifier id = Identifier.from( name ); if ( id != null ) { // get the entityRef from the unique value index entity = em.getUserByIdentifier( id ); } if ( entity == null ) { throw new ServiceResourceNotFoundException( context ); } if ( !context.moreParameters() ) { // full load the entity from the database based on the UUID from the unique value index entity = em.get( entity ); if ( entity == null ) { throw new ServiceResourceNotFoundException( context ); } entity = importEntity( context, ( Entity ) entity ); } checkPermissionsForEntity( context, entity ); List<ServiceRequest> nextRequests = context.getNextServiceRequests( entity ); return new ServiceResults( this, context, ServiceResults.Type.COLLECTION, Results.fromRef( entity ), null, nextRequests ); }