class UserRepository extends AbstractRepository {

    /**
     * User cache.
     */
    @Inject
    private UserCache userCache;

    /**
     * Public constructor.
     */
    public UserRepository() {
        super(User.USER);
    }

    @Override
    public JSONObject get(final String id) throws RepositoryException {<FILL_FUNCTION_BODY>}

    @Override
    public void update(final String id, final JSONObject user, final String... propertyNames) throws RepositoryException {
        final JSONObject old = get(id);
        if (null == old) {
            return;
        }

        userCache.removeUser(old);
        super.update(id, user, propertyNames);
        user.put(Keys.OBJECT_ID, id);
        userCache.putUser(user);
    }

    /**
     * Gets a user by the specified name.
     *
     * @param name the specified name
     * @return user, returns {@code null} if not found
     * @throws RepositoryException repository exception
     */
    public JSONObject getByName(final String name) throws RepositoryException {
        JSONObject ret = userCache.getUserByName(name);
        if (null != ret) {
            return ret;
        }

        final Query query = new Query().setPageCount(1).setFilter(new PropertyFilter(User.USER_NAME, FilterOperator.EQUAL, name));
        ret = getFirst(query);
        if (null == ret) {
            return null;
        }
        userCache.putUser(ret);
        return ret;
    }

    /**
     * Gets a user by the specified email.
     *
     * @param email the specified email
     * @return user, returns {@code null} if not found
     * @throws RepositoryException repository exception
     */
    public JSONObject getByEmail(final String email) throws RepositoryException {
        final Query query = new Query().setPageCount(1).setFilter(new PropertyFilter(User.USER_EMAIL, FilterOperator.EQUAL, email.toLowerCase().trim()));
        return getFirst(query);
    }

    /**
     * Gets the administrators.
     *
     * @return administrators, returns an empty list if not found or error
     * @throws RepositoryException repository exception
     */
    public List<JSONObject> getAdmins() throws RepositoryException {
        List<JSONObject> ret = userCache.getAdmins();
        if (ret.isEmpty()) {
            final Query query = new Query().setFilter(
                    new PropertyFilter(User.USER_ROLE, FilterOperator.EQUAL, Role.ROLE_ID_C_ADMIN)).setPageCount(1)
                    .addSort(Keys.OBJECT_ID, SortDirection.ASCENDING);
            ret = getList(query);
            userCache.putAdmins(ret);
        }

        return ret;
    }

    /**
     * Gets the anonymous user.
     *
     * @return anonymous user
     * @throws RepositoryException repository exception
     */
    public JSONObject getAnonymousUser() throws RepositoryException {
        return getByName(UserExt.ANONYMOUS_USER_NAME);
    }
}

        JSONObject ret = userCache.getUser(id);
        if (null != ret) {
            return ret;
        }

        ret = super.get(id);

        if (null == ret) {
            return null;
        }

        userCache.putUser(ret);

        return ret;
    
<no_super_class>