1 package org.hibernate; 3 4 import java.io.Serializable ; 5 import java.sql.Connection ; 6 7 import org.hibernate.stat.SessionStatistics; 8 9 68 public interface Session extends Serializable { 69 70 75 public EntityMode getEntityMode(); 76 77 86 public Session getSession(EntityMode entityMode); 87 88 97 public void flush() throws HibernateException; 98 99 109 public void setFlushMode(FlushMode flushMode); 110 115 public FlushMode getFlushMode(); 116 117 120 public void setCacheMode(CacheMode cacheMode); 121 124 public CacheMode getCacheMode(); 125 126 130 public SessionFactory getSessionFactory(); 131 132 140 public Connection connection() throws HibernateException; 141 142 153 public Connection disconnect() throws HibernateException; 154 155 162 public void reconnect() throws HibernateException; 163 164 172 public void reconnect(Connection connection) throws HibernateException; 173 174 183 public Connection close() throws HibernateException; 184 185 189 public void cancelQuery() throws HibernateException; 190 191 196 public boolean isOpen(); 197 198 203 public boolean isConnected(); 204 205 212 public boolean isDirty() throws HibernateException; 213 214 224 public Serializable getIdentifier(Object object) throws HibernateException; 225 231 public boolean contains(Object object); 232 240 public void evict(Object object) throws HibernateException; 241 242 252 public Object load(Class theClass, Serializable id, LockMode lockMode) throws HibernateException; 253 254 264 public Object load(String entityName, Serializable id, LockMode lockMode) throws HibernateException; 265 266 279 public Object load(Class theClass, Serializable id) throws HibernateException; 280 281 294 public Object load(String entityName, Serializable id) throws HibernateException; 295 296 304 public void load(Object object, Serializable id) throws HibernateException; 305 306 313 public void replicate(Object object, ReplicationMode replicationMode) throws HibernateException; 314 315 322 public void replicate(String entityName, Object object, ReplicationMode replicationMode) throws HibernateException; 323 324 334 public Serializable save(Object object) throws HibernateException; 335 336 345 public void save(Object object, Serializable id) throws HibernateException; 346 347 357 public Serializable save(String entityName, Object object) throws HibernateException; 358 359 368 public void save(String entityName, Object object, Serializable id) throws HibernateException; 369 370 382 public void saveOrUpdate(Object object) throws HibernateException; 383 384 396 public void saveOrUpdate(String entityName, Object object) throws HibernateException; 397 398 407 public void update(Object object) throws HibernateException; 408 409 419 public void update(Object object, Serializable id) throws HibernateException; 420 421 430 public void update(String entityName, Object object) throws HibernateException; 431 432 442 public void update(String entityName, Object object, Serializable id) throws HibernateException; 443 444 458 public Object merge(Object object) throws HibernateException; 459 460 474 public Object merge(String entityName, Object object) throws HibernateException; 475 476 484 public void persist(Object object) throws HibernateException; 485 493 public void persist(String entityName, Object object) throws HibernateException; 494 495 505 public void delete(Object object) throws HibernateException; 506 507 518 public void delete(String entityName, Object object) throws HibernateException; 519 520 531 public void lock(Object object, LockMode lockMode) throws HibernateException; 532 533 544 public void lock(String entityName, Object object, LockMode lockMode) throws HibernateException; 545 546 560 public void refresh(Object object) throws HibernateException; 561 562 572 public void refresh(Object object, LockMode lockMode) throws HibernateException; 573 574 581 public LockMode getCurrentLockMode(Object object) throws HibernateException; 582 583 594 public Transaction beginTransaction() throws HibernateException; 595 596 603 public Criteria createCriteria(Class persistentClass); 604 605 612 public Criteria createCriteria(Class persistentClass, String alias); 613 614 620 public Criteria createCriteria(String entityName); 621 622 629 public Criteria createCriteria(String entityName, String alias); 630 631 638 public Query createQuery(String queryString) throws HibernateException; 639 640 647 public SQLQuery createSQLQuery(String queryString) throws HibernateException; 648 649 657 public Query createFilter(Object collection, String queryString) throws HibernateException; 658 659 667 public Query getNamedQuery(String queryName) throws HibernateException; 668 669 674 public void clear(); 675 676 686 public Object get(Class clazz, Serializable id) throws HibernateException; 687 688 699 public Object get(Class clazz, Serializable id, LockMode lockMode) throws HibernateException; 700 701 711 public Object get(String entityName, Serializable id) throws HibernateException; 712 713 724 public Object get(String entityName, Serializable id, LockMode lockMode) throws HibernateException; 725 726 727 734 public String getEntityName(Object object) throws HibernateException; 735 736 742 public Filter enableFilter(String filterName); 743 744 750 public Filter getEnabledFilter(String filterName); 751 752 757 public void disableFilter(String filterName); 758 759 762 public SessionStatistics getStatistics(); 763 764 771 public void setReadOnly(Object entity, boolean readOnly); 772 773 } 774 | Popular Tags |