Hi,
I have an @Any relationship, like the below:
Code:
public class Customer {
private String name;
...other attributes
@Any(metaColumn = @Column(name = "type"))
@AnyMetaDef(idType = "long", metaType = "string", metaValues = {
@MetaValue(value = "Personal", targetEntity = Personal.class),
@MetaValue(value = "Business", targetEntity = Business.class) })
@JoinColumn(name = "codeType")
private CustomerType type;
}
[*]
When I'm trying to persist the customer.
There is an error:
org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushingCan I apply a cascade to the @Any to avoid persist the CustomerType?