I have several entities with unidirectional OneToMany association:
@Entity
public class UserGridSettingsSortItem {
@EmbeddedId
private UserGridSettingsSortItemId id;
private int ordinalNumber;
private boolean ascending;
...
}
@Embeddable
public class UserGridSettingsSortItemId implements Serializable {
private UUID userGridSettingsId;
private String columnId;
...
}
@Entity
public class UserGridSettings {
@Id
private UUID id;
@OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
@JoinColumn(name = "userGridSettingsId")
@OrderBy("ordinalNumber")
@MapsId("id")
private List<UserGridSettingsSortItem> sortItemList;
...
}
When I try to remove children from sortItemList with remove method I got the following error:
Hibernate:
update
user_grid_settings_sort_item
set
user_grid_settings_id=null
where
user_grid_settings_id=?
and column_id=?
and user_grid_settings_id=?
WARN SQL Error: 0, SQLState: 22023
o.h.engine.jdbc.spi.SqlExceptionHelper Parameter 3 is not specified
What is wrong? Why does hibernate generate update with orphanRemoval = true? Why are there 3 parameters instead of 2?
Thanks in advance!
BR,
Anatoly Shirokov