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;
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<T> 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.
*
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.
*
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;
/**
*/
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.
*
*/
public List<T> 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<T> getFilteredList(final DetachedCriteria aDetachedCriteria);
+
/**
* Retrieve a list of objects which were previously persisted to the database using the given criteria.
*