From: rkv Date: Thu, 28 Feb 2013 07:11:05 +0000 (+0000) Subject: Simulation context type selection is fixed in study search. Lucene is no more used... X-Git-Tag: Root_Delivery2_2013_04_22~126 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=372a66bfd3072d7b810acddb9c58eca24baf5b9e;p=tools%2Fsiman.git Simulation context type selection is fixed in study search. Lucene is no more used for study search. Study indexing is deprecated. --- diff --git a/Workspace/Siman-Common/src/org/splat/dal/dao/kernel/AbstractGenericDAOImpl.java b/Workspace/Siman-Common/src/org/splat/dal/dao/kernel/AbstractGenericDAOImpl.java index 0aef576..64996b4 100644 --- a/Workspace/Siman-Common/src/org/splat/dal/dao/kernel/AbstractGenericDAOImpl.java +++ b/Workspace/Siman-Common/src/org/splat/dal/dao/kernel/AbstractGenericDAOImpl.java @@ -14,7 +14,9 @@ import java.util.List; import java.util.Properties; import org.hibernate.Criteria; +import org.hibernate.LockOptions; import org.hibernate.criterion.Criterion; +import org.hibernate.criterion.DetachedCriteria; import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; import org.springframework.orm.hibernate3.support.HibernateDaoSupport; @@ -128,6 +130,18 @@ public abstract class AbstractGenericDAOImpl return aCriteria.list(); } + /** + * Retrieve a list of objects which were previously persisted to the database using the given criteria. + * + * @param aDetachedCriteria + * search criteria + * @return a list of objects filtered according to the given criteria + */ + @SuppressWarnings(UNCHECKED) + public List getFilteredList(final DetachedCriteria aDetachedCriteria) { + return aDetachedCriteria.getExecutableCriteria(getSession()).list(); + } + /** * Retrieve a list of objects which were previously persisted to the database using the given criteria. * @@ -241,6 +255,40 @@ public abstract class AbstractGenericDAOImpl getSession().update(transientObject); } + /** + * Refresh a persistent object. + * + * @param transientObject + * transient instance of the object to refresh + */ + public void refresh(final T transientObject) { + getSession().refresh(transientObject); + } + + /** + * Load a persistent object. + * + * @param transientObject + * transient instance of the object to load + * @param id + * object primary key + */ + public void load(final T transientObject, final PK id) { + getSession().load(transientObject, id); + } + + /** + * Lock a persistent object. + * + * @param transientObject + * transient instance of the object to lock + * @param lockOptions + * lock options + */ + public void refresh(final T transientObject, final LockOptions lockOptions) { + getSession().refresh(transientObject, lockOptions); + } + /** * Remove an object from persistent storage in the database. * diff --git a/Workspace/Siman-Common/src/org/splat/dal/dao/kernel/GenericDAO.java b/Workspace/Siman-Common/src/org/splat/dal/dao/kernel/GenericDAO.java index fa8ee40..b4a5b9f 100644 --- a/Workspace/Siman-Common/src/org/splat/dal/dao/kernel/GenericDAO.java +++ b/Workspace/Siman-Common/src/org/splat/dal/dao/kernel/GenericDAO.java @@ -13,7 +13,9 @@ import java.io.Serializable; import java.util.List; import java.util.Properties; +import org.hibernate.LockOptions; import org.hibernate.criterion.Criterion; +import org.hibernate.criterion.DetachedCriteria; import org.hibernate.criterion.Order; /** @@ -62,6 +64,34 @@ public interface GenericDAO { */ void update(T transientObject); + /** + * Refresh a persistent object. + * + * @param transientObject + * transient instance of the object to refresh + */ + void refresh(T transientObject); + + /** + * Load a persistent object. + * + * @param transientObject + * transient instance of the object to load + * @param id + * object primary key + */ + public void load(final T transientObject, final PK id); + + /** + * Lock a persistent object. + * + * @param transientObject + * transient instance of the object to lock + * @param lockOptions + * lock options + */ + public void refresh(final T transientObject, final LockOptions lockOptions); + /** * Remove an object from persistent storage in the database. * @@ -104,6 +134,15 @@ public interface GenericDAO { */ public List getAll(Order... anOrder); + /** + * Retrieve a list of objects which were previously persisted to the database using the given criteria. + * + * @param aDetachedCriteria + * search criteria + * @return a list of objects filtered according to the given criteria + */ + public List getFilteredList(final DetachedCriteria aDetachedCriteria); + /** * Retrieve a list of objects which were previously persisted to the database using the given criteria. *