| There are currently 2 ways (AFAIK) to enable the dynamic update/insert feature of the framework:
- Use (deprecated) @Entity(dynamicUpdate = true/false, dynamicInsert=true/false) annotation
- Use @DynamicUpdate/@DynamicInsert annotation(s)
This way makes the decision whether to use dynamic update/insert "hardwired" - i.e., deciding to switch to/from dynamic mode requires adding/removing the relevant annotations and re-compiling the code. My suggestion is as follows:
- Provide a global configuration flag (e.g., hibernate.dynamic.update.default=true/false) that defines the default behavior unless an entity is explicitly annotated with one of the annotations (default value=false for backward compatibility).
- Consider providing also some programmatic way to enable/disable this global behavior - e.g., Configuration#useDynamicUpdate().
|