public class BambooHibernateUtils extends Object
Modifier and Type | Field and Description |
---|---|
static AtomicInteger |
counter |
Modifier and Type | Method and Description |
---|---|
static <T> T |
createObjectWithId(Class<T> aClass,
long id) |
static String |
describePropertyChanges(Map<String,org.apache.commons.lang3.tuple.Pair<Object,Object>> propertyChanges) |
static void |
disableSqlLogging()
For debugging only
|
static void |
enableSqlLogging()
For debugging only
|
static void |
flushIfNeeded(org.hibernate.Session session) |
static int |
getConcurrentPoolSize(com.atlassian.config.db.HibernateConfig hibernateConfig)
Tries to get the maximum # of connections available in the connection pool and returns the lower of that and the
total number of processors available
|
static int |
getMaxConnectionPoolSize(com.atlassian.config.db.HibernateConfig hibernateConfig)
Tries to get the maximum # of connections available in the connection pool.
|
static Object |
getPropertyByName(String name,
String[] propertyNames,
Object[] values) |
static Map<String,org.apache.commons.lang3.tuple.Pair<Object,Object>> |
getPropertyChanges(Object[] currentState,
Object[] previousState,
String[] propertyNames) |
static List |
listWithSqlLogged(org.hibernate.Criteria criteria,
String message)
For debugging only
|
static org.hibernate.Session |
timed(org.hibernate.Session session) |
static <T> T |
timed(T objectToTime) |
static <T> T |
withSqlLogged(Callable<T> callable,
String message)
For debugging only
|
public static final AtomicInteger counter
public static void enableSqlLogging()
public static void disableSqlLogging()
public static <T> T withSqlLogged(@NotNull Callable<T> callable, @Nullable String message) throws org.hibernate.HibernateException
org.hibernate.HibernateException
public static List listWithSqlLogged(@NotNull org.hibernate.Criteria criteria, @Nullable String message) throws org.hibernate.HibernateException
org.hibernate.HibernateException
public static int getMaxConnectionPoolSize(@NotNull com.atlassian.config.db.HibernateConfig hibernateConfig)
AvailableSettings.C3P0_MAX_SIZE
property is not defined
then default value is returned: 15.public static int getConcurrentPoolSize(@NotNull com.atlassian.config.db.HibernateConfig hibernateConfig)
hibernateConfig
- public static <T> T createObjectWithId(Class<T> aClass, long id)
public static <T> T timed(T objectToTime)
public static void flushIfNeeded(org.hibernate.Session session)
@NotNull public static Map<String,org.apache.commons.lang3.tuple.Pair<Object,Object>> getPropertyChanges(Object[] currentState, Object[] previousState, String[] propertyNames)
@NotNull public static String describePropertyChanges(Map<String,org.apache.commons.lang3.tuple.Pair<Object,Object>> propertyChanges)
@Nullable public static Object getPropertyByName(String name, String[] propertyNames, Object[] values)
public static org.hibernate.Session timed(org.hibernate.Session session)
Copyright © 2020 Atlassian Software Systems Pty Ltd. All rights reserved.