I have some long name classes which I store in the database using Hibernate.
I’ve noticed that hibernate creates the dtype column (for inheritance support) as character varying(31).
Since the class name is longer than 31 characters the insert fails.
What is the best way to resolve it?
Since I have lots of classes I prefer some global setting over adding annotation to each class.
I have some long name classes which I store in the database using Hibernate.
Share
Use
@DiscriminatorValue("some_short_name")to all your subclasses. I don’t think there is any other solution.