@Transactional
@Override
public synchronized void persist() {
ClusterEntity clusterEntity = clusterDAO.findById(cluster.getClusterId());
ClusterConfigEntity entity = new ClusterConfigEntity();
entity.setClusterEntity(clusterEntity);
entity.setClusterId(Long.valueOf(cluster.getClusterId()));
entity.setType(type);
entity.setTag(getVersionTag());
entity.setTimestamp(new Date().getTime());
entity.setData(gson.toJson(getProperties()));
clusterDAO.createConfig(entity);
clusterEntity.getClusterConfigEntities().add(entity);
clusterDAO.merge(clusterEntity);
cluster.refresh();
}