1 16 17 package org.springframework.orm.hibernate3; 18 19 import java.io.Serializable ; 20 import java.util.Collection ; 21 import java.util.Iterator ; 22 import java.util.List ; 23 24 import org.hibernate.Filter; 25 import org.hibernate.LockMode; 26 import org.hibernate.ReplicationMode; 27 import org.hibernate.criterion.DetachedCriteria; 28 29 import org.springframework.dao.DataAccessException; 30 31 66 public interface HibernateOperations { 67 68 88 Object execute(HibernateCallback action) throws DataAccessException; 89 90 99 List executeFind(HibernateCallback action) throws DataAccessException; 100 101 102 106 119 Object get(Class entityClass, Serializable id) throws DataAccessException; 120 121 136 Object get(Class entityClass, Serializable id, LockMode lockMode) 137 throws DataAccessException; 138 139 152 Object get(String entityName, Serializable id) throws DataAccessException; 153 154 169 Object get(String entityName, Serializable id, LockMode lockMode) 170 throws DataAccessException; 171 172 186 Object load(Class entityClass, Serializable id) throws DataAccessException; 187 188 204 Object load(Class entityClass, Serializable id, LockMode lockMode) 205 throws DataAccessException; 206 207 221 Object load(String entityName, Serializable id) throws DataAccessException; 222 223 239 Object load(String entityName, Serializable id, LockMode lockMode) 240 throws DataAccessException; 241 242 250 List loadAll(Class entityClass) throws DataAccessException; 251 252 265 void load(Object entity, Serializable id) throws DataAccessException; 266 267 273 void refresh(Object entity) throws DataAccessException; 274 275 283 void refresh(Object entity, LockMode lockMode) throws DataAccessException; 284 285 292 boolean contains(Object entity) throws DataAccessException; 293 294 300 void evict(Object entity) throws DataAccessException; 301 302 309 void initialize(Object proxy) throws DataAccessException; 310 311 320 Filter enableFilter(String filterName) throws IllegalStateException ; 321 322 323 327 336 void lock(Object entity, LockMode lockMode) throws DataAccessException; 337 338 348 void lock(String entityName, Object entity, LockMode lockMode) throws DataAccessException; 349 350 357 Serializable save(Object entity) throws DataAccessException; 358 359 367 Serializable save(String entityName, Object entity) throws DataAccessException; 368 369 376 void update(Object entity) throws DataAccessException; 377 378 389 void update(Object entity, LockMode lockMode) throws DataAccessException; 390 391 399 void update(String entityName, Object entity) throws DataAccessException; 400 401 413 void update(String entityName, Object entity, LockMode lockMode) throws DataAccessException; 414 415 424 void saveOrUpdate(Object entity) throws DataAccessException; 425 426 436 void saveOrUpdate(String entityName, Object entity) throws DataAccessException; 437 438 447 void saveOrUpdateAll(Collection entities) throws DataAccessException; 448 449 456 void replicate(Object entity, ReplicationMode replicationMode) throws DataAccessException; 457 458 466 void replicate(String entityName, Object entity, ReplicationMode replicationMode) throws DataAccessException; 467 468 477 void persist(Object entity) throws DataAccessException; 478 479 489 void persist(String entityName, Object entity) throws DataAccessException; 490 491 509 Object merge(Object entity) throws DataAccessException; 510 511 529 Object merge(String entityName, Object entity) throws DataAccessException; 530 531 537 void delete(Object entity) throws DataAccessException; 538 539 549 void delete(Object entity, LockMode lockMode) throws DataAccessException; 550 551 559 void deleteAll(Collection entities) throws DataAccessException; 560 561 570 void flush() throws DataAccessException; 571 572 578 void clear() throws DataAccessException; 579 580 581 585 592 List find(String queryString) throws DataAccessException; 593 594 603 List find(String queryString, Object value) throws DataAccessException; 604 605 614 List find(String queryString, Object [] values) throws DataAccessException; 615 616 626 List findByNamedParam(String queryName, String paramName, Object value) 627 throws DataAccessException; 628 629 639 List findByNamedParam(String queryString, String [] paramNames, Object [] values) 640 throws DataAccessException; 641 642 652 List findByValueBean(String queryString, Object valueBean) throws DataAccessException; 653 654 655 659 667 List findByNamedQuery(String queryName) throws DataAccessException; 668 669 679 List findByNamedQuery(String queryName, Object value) throws DataAccessException; 680 681 691 List findByNamedQuery(String queryName, Object [] values) throws DataAccessException; 692 693 704 List findByNamedQueryAndNamedParam(String queryName, String paramName, Object value) 705 throws DataAccessException; 706 707 718 List findByNamedQueryAndNamedParam(String queryName, String [] paramNames, Object [] values) 719 throws DataAccessException; 720 721 732 List findByNamedQueryAndValueBean(String queryName, Object valueBean) 733 throws DataAccessException; 734 735 736 740 748 List findByCriteria(DetachedCriteria criteria) throws DataAccessException; 749 750 764 List findByCriteria(DetachedCriteria criteria, int firstResult, int maxResults) throws DataAccessException; 765 766 774 List findByExample(Object exampleEntity) throws DataAccessException; 775 776 790 List findByExample(Object exampleEntity, int firstResult, int maxResults) throws DataAccessException; 791 792 793 797 807 Iterator iterate(String queryString) throws DataAccessException; 808 809 821 Iterator iterate(String queryString, Object value) throws DataAccessException; 822 823 835 Iterator iterate(String queryString, Object [] values) throws DataAccessException; 836 837 845 void closeIterator(Iterator it) throws DataAccessException; 846 847 855 int bulkUpdate(String queryString) throws DataAccessException; 856 857 867 int bulkUpdate(String queryString, Object value) throws DataAccessException; 868 869 879 int bulkUpdate(String queryString, Object [] values) throws DataAccessException; 880 881 } 882 | Popular Tags |