public class HibernateDaoUtils extends Object
Modifier and Type | Method and Description |
---|---|
static void |
bindQueryParameters(org.hibernate.Query query,
Map<String,Object> params)
Binds named parameters to the
Query . |
static void |
deleteAll(org.hibernate.Session session,
List entities) |
static <E extends BambooObject> |
execute(org.springframework.orm.hibernate4.support.HibernateDaoSupport dao,
org.springframework.orm.hibernate4.HibernateCallback action)
Deprecated.
since 5.12, use session objects directly
|
static boolean |
exists(org.springframework.orm.hibernate4.support.HibernateDaoSupport dao,
org.springframework.orm.hibernate4.HibernateCallback action)
Deprecated.
since 5.12, use session objects directly
|
static void |
save(org.springframework.orm.hibernate4.HibernateOperations hibernateOperations,
Object object,
Serializable id)
Deprecated.
since 5.8
|
static void |
save(org.hibernate.Session session,
Object object,
Serializable id)
Deprecated.
since 5.8
|
static void |
saveAll(org.springframework.orm.hibernate4.support.HibernateDaoSupport dao,
Collection<? extends BambooObject> entities)
Deprecated.
since 5.12, use
saveOrUpdateAll(Session, Iterable) |
static void |
saveOrUpdate(org.springframework.orm.hibernate4.support.HibernateDaoSupport dao,
BambooObject entity)
Deprecated.
since 5.12, use
saveOrUpdate(Session, BambooObject) |
static void |
saveOrUpdate(org.hibernate.Session session,
BambooObject entity) |
static void |
saveOrUpdateAll(org.springframework.orm.hibernate4.HibernateOperations hibernateTemplate,
Iterable<?> entities)
Deprecated.
since 5.12, use
HibernateTemplate.execute(HibernateCallback) |
static void |
saveOrUpdateAll(org.hibernate.Session session,
Iterable<?> entities) |
static <T extends BambooObject> |
saveOrUpdateFunction(org.springframework.orm.hibernate4.HibernateTemplate hibernateTemplate)
Deprecated.
since 5.12, use Java 8 features instead
|
static <T extends com.atlassian.core.bean.EntityObject> |
setId(T bambooObject,
long id)
Sets the id on the supplied object and returns it.
|
static void |
updateTimestamp(BambooObject bambooObject) |
public static void updateTimestamp(BambooObject bambooObject)
@Deprecated public static void saveOrUpdate(@NotNull org.springframework.orm.hibernate4.support.HibernateDaoSupport dao, BambooObject entity)
saveOrUpdate(Session, BambooObject)
public static void saveOrUpdate(@NotNull org.hibernate.Session session, BambooObject entity)
@Deprecated public static void saveAll(@NotNull org.springframework.orm.hibernate4.support.HibernateDaoSupport dao, Collection<? extends BambooObject> entities)
saveOrUpdateAll(Session, Iterable)
public static void saveOrUpdateAll(org.hibernate.Session session, @NotNull Iterable<?> entities)
@Deprecated public static void saveOrUpdateAll(org.springframework.orm.hibernate4.HibernateOperations hibernateTemplate, Iterable<?> entities) throws org.springframework.dao.DataAccessException
HibernateTemplate.execute(HibernateCallback)
org.springframework.dao.DataAccessException
@Deprecated @Nullable public static <E extends BambooObject> E execute(@NotNull org.springframework.orm.hibernate4.support.HibernateDaoSupport dao, @NotNull org.springframework.orm.hibernate4.HibernateCallback action) throws org.springframework.dao.DataAccessException
org.springframework.dao.DataAccessException
@Deprecated public static boolean exists(@NotNull org.springframework.orm.hibernate4.support.HibernateDaoSupport dao, @NotNull org.springframework.orm.hibernate4.HibernateCallback action) throws org.springframework.dao.DataAccessException
org.springframework.dao.DataAccessException
@Deprecated public static void save(org.springframework.orm.hibernate4.HibernateOperations hibernateOperations, Object object, Serializable id)
@Deprecated public static void save(org.hibernate.Session session, Object object, Serializable id)
public static void deleteAll(org.hibernate.Session session, List entities)
@Deprecated public static <T extends BambooObject> com.google.common.base.Function<T,T> saveOrUpdateFunction(@NotNull org.springframework.orm.hibernate4.HibernateTemplate hibernateTemplate)
public static void bindQueryParameters(@NotNull org.hibernate.Query query, @NotNull Map<String,Object> params) throws org.hibernate.HibernateException
Query
. For each Map.Entry
, the key would be the parameter name and
the value would be the value to bind.
If the value is a Collection
, it will be bound using Query.setParameterList(String, Collection)
.
If the value is a Date
, it will be bound using Query.setDate(String, Date)
.
In any other case Query.setParameter(String, Object)
will be used.
query
- the queryparams
- params to bind (values mapped by parameter names)org.hibernate.HibernateException
public static <T extends com.atlassian.core.bean.EntityObject> T setId(T bambooObject, long id)
Copyright © 2016 Atlassian Software Systems Pty Ltd. All rights reserved.