From: <one...@us...> - 2003-04-10 09:49:49
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cfg In directory sc8-pr-cvs1:/tmp/cvs-serv4460/hibernate/cfg Modified Files: Environment.java Log Message: improvements to: * USE_REFLECTION_OPTIMIZER * Nonstrict cache * javadoc fixed bug in collection filter cache Index: Environment.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cfg/Environment.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Environment.java 8 Apr 2003 14:26:37 -0000 1.8 --- Environment.java 10 Apr 2003 09:49:15 -0000 1.9 *************** *** 26,36 **** * determined by the <tt>Environment</tt> properties. * </ul> ! * The only system-level property is * <ul> * <li><tt>hibernate.jdbc.use_streams_for_binary</tt> * </ul> * <tt>Environment</tt> properties are populated by calling <tt>System.getProperties()</tt> * and then from a resource named <tt>/hibernate.properties</tt> if it exists. System ! * properties override properties specified in <tt>hibernate.properties</tt>. * * @see SessionFactory --- 26,128 ---- * determined by the <tt>Environment</tt> properties. * </ul> ! * The only system-level properties are * <ul> * <li><tt>hibernate.jdbc.use_streams_for_binary</tt> + * <li><tt>hibernate.cglib.use_reflection_optimizer</tt> * </ul> * <tt>Environment</tt> properties are populated by calling <tt>System.getProperties()</tt> * and then from a resource named <tt>/hibernate.properties</tt> if it exists. System ! * properties override properties specified in <tt>hibernate.properties</tt>.<br> ! * <br> ! * The <tt>SessionFactory</tt> is controlled by the following properties. ! * Properties may be either be <tt>System</tt> properties, properties ! * defined in a resource named <tt>/hibernate.properties</tt> an instance of ! * <tt>java.util.Properties</tt> passed to ! * <tt>Configuration.buildSessionFactory()</tt><br> ! * <br> ! * <table> ! * <tr><td><b>property</b></td><td><b>meaning</b></td></tr> ! * <tr> ! * <td><tt>hibernate.dialect</tt></td> ! * <td>classname of <tt>net.sf.hibernate.sql.Dialect</tt> subclass</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.connection.provider_class</tt></td> ! * <td>classname of <tt>net.sf.hibernate.connection.ConnectionProvider</tt> ! * subclass (if not specified hueristics are used)</td> ! * </tr> ! * <tr><td><tt>hibernate.connection.username</tt></td><td>database username</td></tr> ! * <tr><td><tt>hibernate.connection.password</tt></td><td>database password</td></tr> ! * <tr> ! * <td><tt>hibernate.connection.url</tt></td> ! * <td>JDBC URL (when using <tt>java.sql.DriverManager</tt>)</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.connection.driver_class</tt></td> ! * <td>classname of JDBC driver</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.connection.isolation</tt></td> ! * <td>JDBC transaction isolation level (only when using ! * <tt>java.sql.DriverManager</tt>) ! * </td> ! * </tr> ! * <td><tt>hibernate.connection.pool_size</tt></td> ! * <td>the maximum size of the connection pool (only when using ! * <tt>java.sql.DriverManager</tt>) ! * </td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.statement_cache.size</tt></td> ! * <td>the maximum size of the prepared statement cache (only when using ! * <tt>java.sql.DriverManager</tt>) ! * </td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.connection.datasource</tt></td> ! * <td>databasource JNDI name (when using <tt>javax.sql.Datasource</tt>)</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.jndi.url</tt></td><td>JNDI <tt>InitialContext</tt> URL</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.jndi.class</tt></td><td>JNDI <tt>InitialContext</tt> classname</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.use_outer_join</tt></td> ! * <td>enable outer join fetching</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.jdbc.batch_size</tt></td> ! * <td>enable use of JDBC2 batch API for drivers which support it</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.jdbc.fetch_size</tt></td> ! * <td>set the JDBC fetch size</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.jdbc.use_scrollable_resultset</tt></td> ! * <td>enable use of JDBC2 scrollable resultsets (you only need this specify ! * this property when using user supplied connections)</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.default_schema</tt></td> ! * <td>use given schema name for unqualified tables (always optional)</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.session_factory_name</tt></td> ! * <td>If set, the factory attempts to bind this name to itself in the ! * JNDI context. This name is also used to support cross JVM <tt> ! * Session</tt> (de)serialization.</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.transaction.factory_class</tt></td> ! * <td>the factory to use for instantiating <tt>Transaction</tt>s. ! * (Defaults to <tt>JDBCTransactionFactory</tt>.)</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.query.imports</tt></td><td>query language package imports</td> ! * </tr> ! * </table> * * @see SessionFactory *************** *** 260,263 **** --- 352,356 ---- private static final boolean jvmSupportsProxies; private static final boolean useStreamsForBinary; + private static final boolean useReflectionOptimizer; private static final boolean jvmSupportsLinkedHashCollections; *************** *** 307,310 **** --- 400,404 ---- properties = new Properties(); + properties.setProperty( USE_REFLECTION_OPTIMIZER, Boolean.TRUE.toString() ); InputStream stream = Environment.class.getResourceAsStream("/hibernate.properties"); *************** *** 327,332 **** --- 421,428 ---- useStreamsForBinary = PropertiesHelper.getBoolean(USE_STREAMS_FOR_BINARY, properties); + useReflectionOptimizer = PropertiesHelper.getBoolean(USE_REFLECTION_OPTIMIZER, properties); if (useStreamsForBinary) log.info("using java.io streams to persist binary types"); + if (useReflectionOptimizer) log.info("using CGLIB reflection optimizer"); boolean proxySupport; *************** *** 373,376 **** --- 469,473 ---- * Should we use streams to bind binary types to JDBC IN parameters? * Property <tt>hibernate.jdbc.use_streams_for_binary</tt>. + * @see USE_STREAMS_FOR_BINARY */ public static boolean useStreamsForBinary() { *************** *** 378,381 **** --- 475,487 ---- } + /** + * Should we use CGLIB reflection optimizer? + * Property <tt>hibernate.jdbc.use_refection_optimizer</tt>. + * @see USE_REFLECTION_OPTIMIZER + */ + public static boolean useReflectionOptimizer() { + return useReflectionOptimizer; + } + private Environment() { throw new UnsupportedOperationException(); } *************** *** 396,400 **** * @see java.sql.Connection * @param isolation as defined by <tt>java.sql.Connection</tt> ! * @return String */ public static String isolationLevelToString(int isolation) { --- 502,506 ---- * @see java.sql.Connection * @param isolation as defined by <tt>java.sql.Connection</tt> ! * @return a human-readable name */ public static String isolationLevelToString(int isolation) { |