mirror of https://github.com/apache/cloudstack.git
Adding back code that S3 merge overwrote
This commit is contained in:
parent
b0ccfc9d14
commit
2986d31e04
|
|
@ -69,29 +69,29 @@ public class EntityDao<T> {
|
|||
|
||||
@SuppressWarnings("unchecked")
|
||||
public T get(Serializable id) {
|
||||
Session session = PersistContext.getSession();
|
||||
Session session = PersistContext.getSession(isCloudStackSession);
|
||||
return (T)session.get(clazz, id);
|
||||
}
|
||||
|
||||
public T save(T entity) {
|
||||
Session session = PersistContext.getSession();
|
||||
Session session = PersistContext.getSession(isCloudStackSession);
|
||||
session.saveOrUpdate(entity);
|
||||
return entity;
|
||||
}
|
||||
|
||||
public T update(T entity) {
|
||||
Session session = PersistContext.getSession();
|
||||
Session session = PersistContext.getSession(isCloudStackSession);
|
||||
session.saveOrUpdate(entity);
|
||||
return entity;
|
||||
}
|
||||
|
||||
public void delete(T entity) {
|
||||
Session session = PersistContext.getSession();
|
||||
Session session = PersistContext.getSession(isCloudStackSession);
|
||||
session.delete(entity);
|
||||
}
|
||||
|
||||
public T queryEntity(String hql, Object[] params) {
|
||||
Session session = PersistContext.getSession();
|
||||
Session session = PersistContext.getSession(isCloudStackSession);
|
||||
Query query = session.createQuery(hql);
|
||||
query.setMaxResults(1);
|
||||
QueryHelper.bindParameters(query, params);
|
||||
|
|
@ -99,7 +99,7 @@ public class EntityDao<T> {
|
|||
}
|
||||
|
||||
public List<T> queryEntities(String hql, Object[] params) {
|
||||
Session session = PersistContext.getSession();
|
||||
Session session = PersistContext.getSession(isCloudStackSession);
|
||||
Query query = session.createQuery(hql);
|
||||
QueryHelper.bindParameters(query, params);
|
||||
|
||||
|
|
@ -107,7 +107,7 @@ public class EntityDao<T> {
|
|||
}
|
||||
|
||||
public List<T> queryEntities(String hql, int offset, int limit, Object[] params) {
|
||||
Session session = PersistContext.getSession();
|
||||
Session session = PersistContext.getSession(isCloudStackSession);
|
||||
Query query = session.createQuery(hql);
|
||||
QueryHelper.bindParameters(query, params);
|
||||
query.setFirstResult(offset);
|
||||
|
|
@ -116,7 +116,7 @@ public class EntityDao<T> {
|
|||
}
|
||||
|
||||
public int executeUpdate(String hql, Object[] params) {
|
||||
Session session = PersistContext.getSession();
|
||||
Session session = PersistContext.getSession(isCloudStackSession);
|
||||
Query query = session.createQuery(hql);
|
||||
QueryHelper.bindParameters(query, params);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue