Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have a JPA entity that is not currently annotated with either @DynamicUpdate or @DynamicInsert. This table has around 30+ columns and a couple of CLOBs too.

Let's say, I already have an entry with ID=123 in the table and need to update a few columns for the same record during request processing. I am updating the respective columns using DTO and then calling the saveAndFlush() method to push the changes into DB.

So, I have two queries related to the following operation

  • For the respective operation, what should I use @DynamicUpdate or @DynamicInsert
  • Whether either of the annotation i.e. @DynamicUpdate/@DynamicInsert will have any performance impact on the SQL execution

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
405 views
Welcome To Ask or Share your Answers For Others

1 Answer

The only impact is that different statements might be created (depending on combinations of attributes set) which reduces the probability for a statement cache hit.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...