Author: epbernard
Date: 2009-12-08 10:40:12 -0500 (Tue, 08 Dec 2009)
New Revision: 18161
Modified:
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/AbstractEntityManagerImpl.java
Log:
add a comment on flush mode
Modified:
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/AbstractEntityManagerImpl.java
===================================================================
---
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/AbstractEntityManagerImpl.java 2009-12-08
15:39:37 UTC (rev 18160)
+++
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/AbstractEntityManagerImpl.java 2009-12-08
15:40:12 UTC (rev 18161)
@@ -492,6 +492,12 @@
}
}
+ /**
+ * Hibernate can be set in various flush modes that are unknown to
+ * JPA 2.0. This method can then return null.
+ * If it returns null, do em.unwrap(Session.class).getFlushMode() to get the
+ * Hibernate flush mode
+ */
public FlushModeType getFlushMode() {
FlushMode mode = getSession().getFlushMode();
if ( mode == FlushMode.AUTO ) {
@@ -501,7 +507,7 @@
this.flushModeType = FlushModeType.COMMIT;
}
else {
- return null; //TODO exception?
+ return null;
}
//otherwise this is an unknown mode for EJB3
return flushModeType;
Show replies by date