1 16 17 package org.springframework.orm.hibernate; 18 19 import java.io.Serializable ; 20 import java.util.Collection ; 21 import java.util.Iterator ; 22 import java.util.List ; 23 24 import net.sf.hibernate.LockMode; 25 import net.sf.hibernate.ReplicationMode; 26 import net.sf.hibernate.type.Type; 27 28 import org.springframework.dao.DataAccessException; 29 30 65 public interface HibernateOperations { 66 67 85 Object execute(HibernateCallback action) throws DataAccessException; 86 87 95 List executeFind(HibernateCallback action) throws DataAccessException; 96 97 98 102 115 Object get(Class entityClass, Serializable id) throws DataAccessException; 116 117 132 Object get(Class entityClass, Serializable id, LockMode lockMode) 133 throws DataAccessException; 134 135 149 Object load(Class entityClass, Serializable id) throws DataAccessException; 150 151 167 Object load(Class entityClass, Serializable id, LockMode lockMode) 168 throws DataAccessException; 169 170 178 List loadAll(Class entityClass) throws DataAccessException; 179 180 189 void load(Object entity, Serializable id) throws DataAccessException; 190 191 197 void refresh(Object entity) throws DataAccessException; 198 199 207 void refresh(Object entity, LockMode lockMode) throws DataAccessException; 208 209 216 boolean contains(Object entity) throws DataAccessException; 217 218 224 void evict(Object entity) throws DataAccessException; 225 226 233 void initialize(Object proxy) throws DataAccessException; 234 235 236 240 251 void lock(Object entity, LockMode lockMode) throws DataAccessException; 252 253 260 Serializable save(Object entity) throws DataAccessException; 261 262 269 void save(Object entity, Serializable id) throws DataAccessException; 270 271 277 void update(Object entity) throws DataAccessException; 278 279 291 void update(Object entity, LockMode lockMode) throws DataAccessException; 292 293 301 void saveOrUpdate(Object entity) throws DataAccessException; 302 303 311 void saveOrUpdateAll(Collection entities) throws DataAccessException; 312 313 325 Object saveOrUpdateCopy(Object entity) throws DataAccessException; 326 327 334 void replicate(Object entity, ReplicationMode replicationMode) throws DataAccessException; 335 336 342 void delete(Object entity) throws DataAccessException; 343 344 356 void delete(Object entity, LockMode lockMode) throws DataAccessException; 357 358 366 void deleteAll(Collection entities) throws DataAccessException; 367 368 376 void flush() throws DataAccessException; 377 378 384 void clear() throws DataAccessException; 385 386 387 391 399 List find(String queryString) throws DataAccessException; 400 401 411 List find(String queryString, Object value) throws DataAccessException; 412 413 424 List find(String queryString, Object value, Type type) throws DataAccessException; 425 426 436 List find(String queryString, Object [] values) throws DataAccessException; 437 438 449 List find(String queryString, Object [] values, Type[] types) throws DataAccessException; 450 451 462 List findByNamedParam(String queryName, String paramName, Object value) 463 throws DataAccessException; 464 465 477 List findByNamedParam(String queryName, String paramName, Object value, Type type) 478 throws DataAccessException; 479 480 491 List findByNamedParam(String queryString, String [] paramNames, Object [] values) 492 throws DataAccessException; 493 494 506 List findByNamedParam(String queryString, String [] paramNames, Object [] values, Type[] types) 507 throws DataAccessException; 508 509 519 List findByValueBean(String queryString, Object valueBean) throws DataAccessException; 520 521 522 526 535 List findByNamedQuery(String queryName) throws DataAccessException; 536 537 548 List findByNamedQuery(String queryName, Object value) throws DataAccessException; 549 550 562 List findByNamedQuery(String queryName, Object value, Type type) throws DataAccessException; 563 564 575 List findByNamedQuery(String queryName, Object [] values) throws DataAccessException; 576 577 589 List findByNamedQuery(String queryName, Object [] values, Type[] types) 590 throws DataAccessException; 591 592 604 List findByNamedQueryAndNamedParam(String queryName, String paramName, Object value) 605 throws DataAccessException; 606 607 620 List findByNamedQueryAndNamedParam(String queryName, String paramName, Object value, Type type) 621 throws DataAccessException; 622 623 635 List findByNamedQueryAndNamedParam(String queryName, String [] paramNames, Object [] values) 636 throws DataAccessException; 637 638 651 List findByNamedQueryAndNamedParam(String queryName, String [] paramNames, Object [] values, Type[] types) 652 throws DataAccessException; 653 654 665 List findByNamedQueryAndValueBean(String queryName, Object valueBean) 666 throws DataAccessException; 667 668 669 673 683 Iterator iterate(String queryString) throws DataAccessException; 684 685 697 Iterator iterate(String queryString, Object value) throws DataAccessException; 698 699 712 Iterator iterate(String queryString, Object value, Type type) throws DataAccessException; 713 714 726 Iterator iterate(String queryString, Object [] values) throws DataAccessException; 727 728 741 Iterator iterate(String queryString, Object [] values, Type[] types) throws DataAccessException; 742 743 750 void closeIterator(Iterator it) throws DataAccessException; 751 752 760 int delete(String queryString) throws DataAccessException; 761 762 772 int delete(String queryString, Object value, Type type) throws DataAccessException; 773 774 784 int delete(String queryString, Object [] values, Type[] types) throws DataAccessException; 785 786 } 787 | Popular Tags |