Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
03-26-2019 07:10 AM
Hi all,
class Cat {
@Id @GeneratedValue private Long id;
@Properties(prefix = "property", allowCast = true) private Map<String, Object> property;
}
Cat cat = new Cat();
Map<String, Object> map = new HashMap<>();
map.put("dummy", new HashMap<>());
cat.setProperty(map);
cat = catRepository.save(cat);
System.out.print(cat.getProperty().get("dummy")) // it is {}
// when I do this
Cat newCat = catRepository.findById(cat.getId());
System.out.print(newCat.getProperty().get("dummy")) // it is null
Why is it so?
04-04-2019 12:26 AM
Dynamic properties only work for one level, not nested documents.
It only works by accident in the first case.
All the sessions of the conference are now available online