Allow to switch off index annotations
Description
duplicates
Activity
Yoann Rodière May 27, 2020 at 8:58 AM
Carsten Hammer October 5, 2015 at 10:31 AM
No, (maybe yes, but currently It seems performance impact is low enough - needs some testing though) for hibernate validator: 1)there are installations where I need to change a column to be longer than what is configured into the validator annotation. Currently I would have to recompile. Switching off check or only switch off throwing the exception would be fine. 2) there are installations upgrading from an old versions where no hibernate-validator has been used from my side and there are codeparts of customer code not really restricting the column length as required. That should better run through and put records into the database (warning is ok) even if there now is a length restriction checked with hibernate-validator. There are database dialects that require field lengths so you have to apply it even if you do not want it (think of hsql that creates a @lob annotated field to a lenght 256) and there are cases where the database table has been changed after the database has been created to be longer.
Sanne Grinovero October 5, 2015 at 9:26 AM
Just curious to try better understand your use case: in case of Hibernate Validator, would you also need to do this for performance reasons?
Carsten Hammer October 5, 2015 at 8:03 AM
Another remark: if possible it would be great if there was a common way to switch off search and validation (hibernate-validation) per column via a similar api call.
Carsten Hammer October 2, 2015 at 12:03 PM
I will have a look at this, thank you very much for your suggestions. If you think about adding something to make it possible to switch off single columns index I would prefer a way where I could either switch off via a system property or programmatically one or more columns at once. That would be great to reflect the requirements in our test environments.
It would be great to be able to switch off a single or a group of indexes at runtime. Of course consistency is not given any longer then. On the other hand I have some performance critical indexes that I currently can only switch off by a recompilation of the database layer with the annotation commented. In my use case the performance critical indexes are about logging information that can be written a lot or not at all depending on settings of the application. So in my case consistency is not a big issue. I want to get rid of index information for archived runs anyway. Alternative would be to directly use lucene and manage it myself which would not let me make use of hibernate-search - at least that is how I understand it currently.