Filter:   InfoImg
download SessionFactoryImplementor.java
Language: Java
LOC: 30
Project Info
Hibernate
Server: SourceForge
Type: cvs
...te\cirrus\hibernate\engine\
   Batcher.java
   Cascades.java
   Key.java
   Mapping.java
   ...FactoryImplementor.java
   SessionImplementor.java
   Versioning.java

//$Id: SessionFactoryImplementor.java,v 1.6 2002/12/28 02:25:49 oneovthafew Exp $
package cirrus.hibernate.engine;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Collection;

import cirrus.hibernate.HibernateException;
import cirrus.hibernate.MappingException;
import cirrus.hibernate.impl.CollectionPersister;
import cirrus.hibernate.persister.ClassPersister;
import cirrus.hibernate.sql.Dialect;
import cirrus.hibernate.type.Type;

/** 
 * Defines the internal contract between the <tt>SessionFactory</tt> and other parts of
 * Hibernate such as implementors of <tt>Type</tt>.
 * @see cirrus.hibernate.SessionFactory
 * @see cirrus.hibernate.impl.SessionFactoryImpl
 */
public interface SessionFactoryImplementor extends Mapping {
	
	/**
	 * Get the persister for a class
	 */
	public ClassPersister getPersister(Class clazz) throws MappingException;
	/**
	 * Get the persister for the named class
	 */
	public ClassPersister getPersister(String className) throws MappingException;
	/**
	 * Get the persister object for a collection role
	 */
	public CollectionPersister getCollectionPersister(String role) throws MappingException;
	
	/**
	 * Is outerjoin fetching enabled?
	 */
	public boolean enableJoinedFetch();
	/**
	 * Are scrollable <tt>ResultSet</tt>s supported?
	 */
	public boolean useScrollableResultSets();
	/**
	 * Get the database schema specified in <tt>hibernate.default_schema</tt>
	 */
	public String getDefaultSchema();
	/**
	 * Get the SQL <tt>Dialect</tt>
	 */
	public Dialect getDialect();

	/**
	 * Get the return types of a query
	 */
	public Type[] getReturnTypes(String queryString) throws HibernateException;
	
	/**
	 * Get the named parameter names for a query
	 * @return a collection of strings
	 */
	public Collection getNamedParameters(String queryString) throws HibernateException;	
	/**
	 * Obtain a JDBC connection
	 */
	public Connection openConnection() throws SQLException;
	/**
	 * Release a JDBC connection
	 */
	public void closeConnection(Connection conn) throws SQLException;
	/**
	 * Get the names of all persistent classes that implement/extend the given interface/class
	 */
	public String[] getImplementors(Class clazz);
	/**
	 * Get the list of query imports
	 */
	public String[] getImports();
	
	/**
	 * Dispose of a prepared statement
	 */
	public void closePreparedStatement(PreparedStatement ps) throws SQLException;
	
	/**
	 * Obtain a prepared statement
	 */
	public PreparedStatement getPreparedStatement(final Connection conn, final String sql, boolean scrollable) throws SQLException;
	
	/**
	 * Get the JDBC batch size
	 */
	public int getJdbcBatchSize();
	
	/**
	 * Set the fetch size
	 */
	public void setFetchSize(PreparedStatement statement) throws SQLException;
}