@Any mapping with Cascade in hibernate 7 (deprecation)

@Any(fetch = FetchType.LAZY, optional = false)
@AnyKeyJavaClass(UUID.class)
@JoinColumn(name = "data_id")
@Column(name = "data_dtype")
@Cascade(org.hibernate.annotations.CascadeType.ALL)
private IBaseDataType specialData;

At least inserting with Cascade seems to work with this, but in Hibernate 7 the Cascade annotation is mark for removal. But how we can configure the cascade behaviour for @Any mapping?

I guess @Any and @ManyToAny should receive a cascade member as replacement. Could you please create a Jira ticket and potentially start a discussion about this on our Zulip chat?

1 Like