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 <E extends BambooObject> |
execute(org.springframework.orm.hibernate3.support.HibernateDaoSupport dao,
org.springframework.orm.hibernate3.HibernateCallback action)
Deprecated.
since 5.9, use
HibernateTemplate.execute(HibernateCallback) |
static boolean |
exists(org.springframework.orm.hibernate3.support.HibernateDaoSupport dao,
org.springframework.orm.hibernate3.HibernateCallback action) |
static void |
save(org.springframework.orm.hibernate3.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.hibernate3.support.HibernateDaoSupport dao,
Collection<? extends BambooObject> entities) |
static void |
saveOrUpdate(org.springframework.orm.hibernate3.support.HibernateDaoSupport dao,
BambooObject entity) |
static void |
saveOrUpdateAll(org.springframework.orm.hibernate3.HibernateOperations hibernateTemplate,
Iterable<?> entities) |
static <T extends BambooObject> |
saveOrUpdateFunction(org.springframework.orm.hibernate3.HibernateTemplate hibernateTemplate) |
static <T extends BambooEntityObject> |
setId(T bambooObject,
long id)
Sets the id on the supplied object and returns it.
|
static void |
updateTimestamp(BambooObject bambooObject) |
static <T extends BambooObject> |
updateTimestampFunction() |
public static void updateTimestamp(BambooObject bambooObject)
public static void saveOrUpdate(@NotNull org.springframework.orm.hibernate3.support.HibernateDaoSupport dao, BambooObject entity)
public static void saveAll(@NotNull org.springframework.orm.hibernate3.support.HibernateDaoSupport dao, Collection<? extends BambooObject> entities)
public static void saveOrUpdateAll(org.springframework.orm.hibernate3.HibernateOperations hibernateTemplate, Iterable<?> entities) throws org.springframework.dao.DataAccessException
org.springframework.dao.DataAccessException
@Deprecated @Nullable public static <E extends BambooObject> E execute(@NotNull org.springframework.orm.hibernate3.support.HibernateDaoSupport dao, @NotNull org.springframework.orm.hibernate3.HibernateCallback action) throws org.springframework.dao.DataAccessException
HibernateTemplate.execute(HibernateCallback)
org.springframework.dao.DataAccessException
public static boolean exists(@NotNull org.springframework.orm.hibernate3.support.HibernateDaoSupport dao, @NotNull org.springframework.orm.hibernate3.HibernateCallback action) throws org.springframework.dao.DataAccessException
org.springframework.dao.DataAccessException
@Deprecated public static void save(org.springframework.orm.hibernate3.HibernateOperations hibernateOperations, Object object, Serializable id)
@Deprecated public static void save(org.hibernate.Session session, Object object, Serializable id)
public static <T extends BambooObject> com.google.common.base.Function<T,T> saveOrUpdateFunction(@NotNull org.springframework.orm.hibernate3.HibernateTemplate hibernateTemplate)
public static <T extends BambooObject> com.google.common.base.Function<T,T> updateTimestampFunction()
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 BambooEntityObject> T setId(T bambooObject, long id)
Copyright © 2016 Atlassian Software Systems Pty Ltd. All rights reserved.