add a comment on flush mode

git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@18161 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Emmanuel Bernard 2009-12-08 15:40:12 +00:00
parent 084d84b8f8
commit e71c0e4ba4
1 changed files with 7 additions and 1 deletions

View File

@ -492,6 +492,12 @@ public abstract class AbstractEntityManagerImpl implements HibernateEntityManage
}
}
/**
* 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 @@ public abstract class AbstractEntityManagerImpl implements HibernateEntityManage
this.flushModeType = FlushModeType.COMMIT;
}
else {
return null; //TODO exception?
return null;
}
//otherwise this is an unknown mode for EJB3
return flushModeType;