Methods to deal with the differences in different Hibernate versions
| Type | Name and description |
|---|---|
static org.hibernate.Query |
createQuery(org.hibernate.Session session, java.lang.String query)Creates a query |
static org.hibernate.FlushMode |
getFlushMode(org.hibernate.Session session)Get the native Hibernate FlushMode, adapting between Hibernate 5.0/5.1 and 5.2+. |
static boolean |
isAtLeastVersion(java.lang.String required)Check the current hibernate version |
static void |
setFlushMode(org.hibernate.Session session, org.hibernate.FlushMode flushMode)Set the native Hibernate FlushMode, adapting between Hibernate 5.0/5.1 and 5.2+. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Creates a query
session - The sessionquery - The queryGet the native Hibernate FlushMode, adapting between Hibernate 5.0/5.1 and 5.2+.
null)session - the Hibernate Session to get the flush mode fromCheck the current hibernate version
required - The required versionSet the native Hibernate FlushMode, adapting between Hibernate 5.0/5.1 and 5.2+.
null)session - the Hibernate Session to get the flush mode from