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?