Java Persistence: Flush Modes, Entity Mapping, and Primary Keys
1. Flush Mode Types
In Java Persistence, you can control and change the default flush behavior using the javax.persistence.FlushModeType enumeration. It has two values:
- AUTO : This is the default behavior. When performing a query, any updates made within the transaction are flushed to ensure the query reflects these changes.
- COMMIT : Changes are flushed only when the transaction commits, not before any query.
You can set the FlushModeType by calling the setFlushMode() method on the EntityManager .
The default AUTO flush behavior makes sense because it ensures tha
Java Persistence: Flush Modes, Mapping & Keys
超级会员免费看
订阅专栏 解锁全文
4907

被折叠的 条评论
为什么被折叠?



