Class<?> entityClass = ReflectionUtils.getTargetClass(entity);
TreeEntity treeEntity = ReflectionUtils.getAnnotation(entityClass,TreeEntity.class);
if (treeEntity != null) {
//from {0} tree where tree.{1} = {2} and (select count(c) from {0} c where c.{3}.{4} = r.{4}) = {5}
String hql = MessageFormat.format(treeEntity.refreshHql(),
persistentContext.getEntityName(),
treeEntity.leafProperty(),
treeEntity.leafValue(),
treeEntity.parentProperty(),
persistentContext.getIdName(),