looking at the way the constructor is written for the CategorizedItem pojo, I think there could be some issues, setting the id properties if we just created a new Category and user objects that are nor persisted. because calling category.getId() will return null.
public CategorizedItem(String username, Category category, Item item) {
this.username = username;
this.category = category;
this.item = item;
// Set primary key
this.id = new Id(category.getId(), item.getId());
// Guarantee referential integrity
category.getCategorizedItems().add(this);
item.getCategorizedItems().add(this);
}
|