private void createSystemStorageLocation(long id, String nameKey) {
    log.warn("Try to create system Location");

    User user = ctxService.getCallersUser();
    Locale locale = null;
    if (user != null) {
      try {
        locale = new Locale(user.getLocale());
      } catch (Throwable x) {
        // egal
      }
    }
    if (locale == null) {
      locale = Locale.getDefault();
    }

    String name = BundleHelper.resolve(BundleResolver.class, nameKey, locale);

    LOSStorageLocation sl;
    sl = getByName(name);
    if (sl == null) {
      sl =
          createStorageLocation(
              clService.getSystemClient(), name, slTypeService.getNoRestrictionType());
      if (sl == null) {
        log.error("Cannot create system Location");
        return;
      }
      String comment = BundleHelper.resolve(BundleResolver.class, "SYSTEM_DATA_COMMENT", locale);
      sl.setAdditionalContent(comment);
    }
    manager.flush();

    String queryStr =
        "UPDATE " + LOSStorageLocation.class.getSimpleName() + " SET id=:idNew WHERE id=:idOld";
    Query query = manager.createQuery(queryStr);
    query.setParameter("idNew", id);
    query.setParameter("idOld", sl.getId());
    query.executeUpdate();
    manager.flush();
    sl = null;
  }
  public LOSStorageLocation createStorageLocation(
      Client client, String name, LOSStorageLocationType type) {

    if ((client == null || name == null) || type == null) {
      log.info("Cannot create location. Parameter == null");
      return null;
    }

    client = manager.merge(client);
    type = manager.merge(type);

    LOSStorageLocation sl = new LOSStorageLocation();
    sl.setClient(client);
    sl.setName(name);
    sl.setType(type);

    manager.persist(sl);
    log.info("CREATED LOSStorageLocation: " + sl.toShortString());
    //        manager.flush();

    return sl;
  }