For optimal performance developers often define database indexes in the JPA data model classes. While this is relatively easy at entity class level, it becomes quite cumbersome if you your model consists of a deeply nested inheritance hierarchy using “mapped” super classes. I.e., there is no direct way that indexes defined for super classes will be added to entities automatically. Instead you have to repeat them every time.
In this article we show how to to circumvent this problem using Hibernate’s MetadataBuilderImplementor
SPI.
You must be logged in to post a comment.