我们需要从旧版本 3.4 导出和导入配置到新的 Keycloak 版本 5。但它在导入时显示错误:
{"errorMessage":"角色定义中不存在应用:领域管理"}
是否有任何选项可以将领域导入新版本?
是否可以比较当前"脏"版本(具有某些属性已更改但尚未保留的对象)与"原始"版本(数据仍在数据库中)之间的实体对象的状态.
我的假设是我可能有一个"脏"的对象,然后从数据库中提取一个新的对象并比较两者.例如:
$entity = $em->getRepository('MyContentBundle:DynamicContent')->find($id);
$editForm = $this->createContentForm($entity);
$editForm->bind($request);
if ($editForm->isValid()) {
$db_entity = $em->getRepository('MyContentBundle:DynamicContent')->find($id);
// compare $entity to $db_entity
$em->persist($entity);
$em->flush();
return $this->redirect($this->generateUrl('content_edit', array('id' => $id)));
}
Run Code Online (Sandbox Code Playgroud)
但根据我的经验,$ entity和$ db_entity始终是相同的对象(并且在$ request bind形式之后具有与$ entity相同的数据).有没有办法得到一个新的版本的$实体和"脏"版本为了比较的缘故?我见过的解决方案都会在表单绑定发生之前提取所需的数据,但我宁愿没有这个限制.
更新:为了澄清,我不仅要查看实体属性的更改,还要查看其相关的实体集合.