Hibernate SVN: r13927 - in core/trunk/documentation/manual: pt-BR/src/main/docbook/modules and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: d.plentz
Date: 2007-08-16 08:46:28 -0400 (Thu, 16 Aug 2007)
New Revision: 13927
Modified:
core/trunk/documentation/manual/en-US/src/main/docbook/modules/performance.xml
core/trunk/documentation/manual/pt-BR/src/main/docbook/modules/performance.xml
Log:
[HHH-2156] Section 19.3, "Managing the caches" doesn't document CacheMode.IGNORE
Modified: core/trunk/documentation/manual/en-US/src/main/docbook/modules/performance.xml
===================================================================
--- core/trunk/documentation/manual/en-US/src/main/docbook/modules/performance.xml 2007-08-16 08:13:46 UTC (rev 13926)
+++ core/trunk/documentation/manual/en-US/src/main/docbook/modules/performance.xml 2007-08-16 12:46:28 UTC (rev 13927)
@@ -949,6 +949,12 @@
</listitem>
<listitem>
<para>
+ <literal>CacheMode.IGNORE</literal> - never write nor read items from the second-level cache,
+ except when updating data.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
<literal>CacheMode.GET</literal> - read items from the second-level cache, but don't write to
the second-level cache except when updating data
</para>
Modified: core/trunk/documentation/manual/pt-BR/src/main/docbook/modules/performance.xml
===================================================================
--- core/trunk/documentation/manual/pt-BR/src/main/docbook/modules/performance.xml 2007-08-16 08:13:46 UTC (rev 13926)
+++ core/trunk/documentation/manual/pt-BR/src/main/docbook/modules/performance.xml 2007-08-16 12:46:28 UTC (rev 13927)
@@ -1,4 +1,4 @@
-<chapter id="performance">
+<chapter id="performance">
<title>Aumentando a performance</title>
<sect1 id="performance-fetching" revision="2">
@@ -940,26 +940,32 @@
<itemizedlist>
<listitem>
<para>
- <literal>CacheMode.NORMAL</literal> - read items from and write items to the second-level cache
+ <literal>CacheMode.NORMAL</literal> - read items from and write items to the second-level cache.
</para>
</listitem>
<listitem>
<para>
+ <literal>CacheMode.IGNORE</literal> - never write nor read items from the second-level cache,
+ except when updating data.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
<literal>CacheMode.GET</literal> - read items from the second-level cache, but don't write to
- the second-level cache except when updating data
+ the second-level cache except when updating data.
</para>
</listitem>
<listitem>
<para>
<literal>CacheMode.PUT</literal> - write items to the second-level cache, but don't read from
- the second-level cache
+ the second-level cache.
</para>
</listitem>
<listitem>
<para>
<literal>CacheMode.REFRESH</literal> - write items to the second-level cache, but don't read from
the second-level cache, bypass the effect of <literal>hibernate.cache.use_minimal_puts</literal>, forcing
- a refresh of the second-level cache for all items read from the database
+ a refresh of the second-level cache for all items read from the database.
</para>
</listitem>
</itemizedlist>
16 years, 8 months
Hibernate SVN: r13926 - in sandbox/trunk/jdbc-proxy/src: main/java/org/hibernate/jdbc/impl and 3 other directories.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2007-08-16 04:13:46 -0400 (Thu, 16 Aug 2007)
New Revision: 13926
Removed:
sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/AbstractStatementProxy.java
sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/ResultSetProxy.java
Modified:
sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/JDBCContainer.java
sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/JDBCContainerBuilder.java
sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/JDBCServices.java
sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/impl/ConnectionObserver.java
sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/impl/LogicalConnectionImpl.java
sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/impl/LogicalConnectionImplementor.java
sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/AbstractStatementProxyHandler.java
sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/ConnectionProxyHandler.java
sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/util/ExceptionHelper.java
sandbox/trunk/jdbc-proxy/src/test/java/org/hibernate/jdbc/proxy/BasicConnectionProxyTest.java
Log:
javadocs + initial after_statement release logic
Modified: sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/JDBCContainer.java
===================================================================
--- sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/JDBCContainer.java 2007-08-16 06:38:43 UTC (rev 13925)
+++ sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/JDBCContainer.java 2007-08-16 08:13:46 UTC (rev 13926)
@@ -19,19 +19,57 @@
import java.sql.Statement;
/**
- * JDBCContainer contract
+ * Contract for a JDBCContainer, which acts as a container (or holder) for JDBC objects.
*
* @author Steve Ebersole
*/
public interface JDBCContainer {
+ /**
+ * Register a JDBC statement with the container.
+ *
+ * @param statement The statement to register.
+ */
public void register(Statement statement);
+
+ /**
+ * Release a statement (un-register it).
+ *
+ * @param statement The statement to release.
+ */
public void release(Statement statement);
+ /**
+ * Register a JDBC resultset with the container.
+ *
+ * @param resultSet The resultset to register.
+ */
public void register(ResultSet resultSet);
+
+ /**
+ * Release a resultset (un-register it).
+ *
+ * @param resultSet The resultset to release.
+ */
public void release(ResultSet resultSet);
+ /**
+ * Does this container currently have registered resources?
+ *
+ * @return True if the container does have registered resources; false otherwise.
+ */
public boolean hasRegisteredResources();
+ /**
+ * Release all registered resources.
+ */
public void releaseResources();
+
+ /**
+ * Close this container. Also releases resources, but additionally indicates that
+ * the container is expected to no longer be used. As such the implemntation is
+ * free to render itself unusable.
+ *
+ * @see #releaseResources()
+ */
public void close();
}
Modified: sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/JDBCContainerBuilder.java
===================================================================
--- sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/JDBCContainerBuilder.java 2007-08-16 06:38:43 UTC (rev 13925)
+++ sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/JDBCContainerBuilder.java 2007-08-16 08:13:46 UTC (rev 13926)
@@ -24,5 +24,10 @@
* @author Steve Ebersole
*/
public interface JDBCContainerBuilder {
+ /**
+ * Build a container.
+ *
+ * @return The container.
+ */
public JDBCContainer buildJdbcContainer();
}
Modified: sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/JDBCServices.java
===================================================================
--- sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/JDBCServices.java 2007-08-16 06:38:43 UTC (rev 13925)
+++ sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/JDBCServices.java 2007-08-16 08:13:46 UTC (rev 13926)
@@ -20,13 +20,37 @@
import org.hibernate.jdbc.util.SQLStatementLogger;
/**
- * Contract for services around JDBC operations.
+ * Contract for services around JDBC operations. These represent
+ * shared resources, aka not varied by session/use.
*
* @author Steve Ebersole
*/
public interface JDBCServices {
+ /**
+ * Obtain service for providing JDBC connections.
+ *
+ * @return The connection provider.
+ */
public ConnectionProvider getConnectionProvider();
+
+ /**
+ * Obtain service for building JDBCContainers instances.
+ *
+ * @return The JDBCContainer builder.
+ */
public JDBCContainerBuilder getJdbcContainerBuilder();
+
+ /**
+ * Obtain service for logging SQL statements.
+ *
+ * @return The SQL statement logger.
+ */
public SQLStatementLogger getSqlStatementLogger();
+
+ /**
+ * Obtain service for dealing with exceptions.
+ *
+ * @return The exception helper service.
+ */
public ExceptionHelper getExceptionHelper();
}
Modified: sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/impl/ConnectionObserver.java
===================================================================
--- sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/impl/ConnectionObserver.java 2007-08-16 06:38:43 UTC (rev 13925)
+++ sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/impl/ConnectionObserver.java 2007-08-16 08:13:46 UTC (rev 13926)
@@ -15,13 +15,28 @@
*/
package org.hibernate.jdbc.impl;
+import java.sql.Connection;
+
/**
- * ConnectionObserver contract
+ * An observer of logical connection events.
*
* @author Steve Ebersole
*/
public interface ConnectionObserver {
- public void physicalConnectionObtained();
+ /**
+ * A physical connection was obtained.
+ *
+ * @param connection The physical connection just obtained.
+ */
+ public void physicalConnectionObtained(Connection connection);
+
+ /**
+ * A physical connection was released.
+ */
public void physicalConnectionReleased();
+
+ /**
+ * The logical connection was closed.
+ */
public void logicalConnectionClosed();
}
Modified: sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/impl/LogicalConnectionImpl.java
===================================================================
--- sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/impl/LogicalConnectionImpl.java 2007-08-16 06:38:43 UTC (rev 13925)
+++ sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/impl/LogicalConnectionImpl.java 2007-08-16 08:13:46 UTC (rev 13926)
@@ -43,6 +43,7 @@
private final JDBCServices jdbcServices;
private final JDBCContainer jdbcContainer;
private final List observers = new ArrayList();
+ private boolean releasesEnabled = true;
private final boolean isUserSuppliedConnection;
private boolean isClosed;
@@ -51,6 +52,11 @@
Connection userSuppliedConnection,
ConnectionReleaseMode connectionReleaseMode,
JDBCServices jdbcServices) {
+ if ( connectionReleaseMode == ConnectionReleaseMode.AFTER_STATEMENT &&
+ ! jdbcServices.getConnectionProvider().supportsAggressiveRelease() ) {
+ log.debug( "connection provider reports to not support aggressive release; overriding" );
+ connectionReleaseMode = ConnectionReleaseMode.AFTER_TRANSACTION;
+ }
this.physicalConnection = userSuppliedConnection;
this.connectionReleaseMode = connectionReleaseMode;
this.jdbcServices = jdbcServices;
@@ -69,13 +75,6 @@
/**
* {@inheritDoc}
*/
- public ConnectionReleaseMode getConnectionReleaseMode() {
- return connectionReleaseMode;
- }
-
- /**
- * {@inheritDoc}
- */
public JDBCContainer getJdbcContainer() {
return jdbcContainer;
}
@@ -151,15 +150,56 @@
// }
/**
+ * {@inheritDoc}
+ */
+ public ConnectionReleaseMode getConnectionReleaseMode() {
+ return connectionReleaseMode;
+ }
+
+ public void afterStatementExecution() {
+ log.trace( "starting after statement execution processing [{}]", connectionReleaseMode );
+ if ( connectionReleaseMode == ConnectionReleaseMode.AFTER_STATEMENT ) {
+ if ( ! releasesEnabled ) {
+ log.debug( "skipping aggressive release due to manual disabling" );
+ return;
+ }
+ if ( jdbcContainer.hasRegisteredResources() ) {
+ log.debug( "skipping aggressive release due to registered resources" );
+ return;
+ }
+ releaseConnection();
+ }
+ }
+
+ public void afterTransaction() {
+ if ( connectionReleaseMode == ConnectionReleaseMode.AFTER_STATEMENT ||
+ connectionReleaseMode == ConnectionReleaseMode.AFTER_TRANSACTION ) {
+ if ( jdbcContainer.hasRegisteredResources() ) {
+ log.info( "forcing container resource cleanup on transaction completion" );
+ jdbcContainer.releaseResources();
+ }
+ aggressiveRelease();
+ }
+ }
+
+ public void disableReleases() {
+ log.trace( "disabling releases" );
+ releasesEnabled = false;
+ }
+
+ public void enableReleases() {
+ log.trace( "(re)enabling releases" );
+ releasesEnabled = true;
+ afterStatementExecution();
+ }
+
+ /**
* Force aggresive release of the underlying connection.
*/
public void aggressiveRelease() {
if ( isUserSuppliedConnection ) {
log.debug( "cannot aggresively release user-supplied connection; skipping" );
}
- else if ( ! getJdbcServices().getConnectionProvider().supportsAggressiveRelease() ) {
- log.debug( "connection provider reports to not support aggreswsive release; skipping" );
- }
else {
log.debug( "aggressively releasing JDBC connection" );
if ( physicalConnection != null ) {
@@ -179,7 +219,7 @@
try {
physicalConnection = getJdbcServices().getConnectionProvider().getConnection();
for ( Iterator itr = observers.iterator(); itr.hasNext(); ) {
- ( ( ConnectionObserver ) itr.next() ).physicalConnectionObtained();
+ ( ( ConnectionObserver ) itr.next() ).physicalConnectionObtained( physicalConnection );
}
log.debug( "obtained JDBC connection" );
}
Modified: sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/impl/LogicalConnectionImplementor.java
===================================================================
--- sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/impl/LogicalConnectionImplementor.java 2007-08-16 06:38:43 UTC (rev 13925)
+++ sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/impl/LogicalConnectionImplementor.java 2007-08-16 08:13:46 UTC (rev 13926)
@@ -26,14 +26,55 @@
* @author Steve Ebersole
*/
public interface LogicalConnectionImplementor extends LogicalConnection {
-
+ /**
+ * Obtains the JDBC services associated with this logical connection.
+ *
+ * @return JDBC services
+ */
public JDBCServices getJdbcServices();
- public ConnectionReleaseMode getConnectionReleaseMode();
-
+ /**
+ * Obtains the JDBC object container associated with this logical connection.
+ *
+ * @return The JDBC object container.
+ */
public JDBCContainer getJdbcContainer();
+ /**
+ * Add an observer interested in notification of connection events.
+ *
+ * @param observer The observer.
+ */
public void addObserver(ConnectionObserver observer);
- public void aggressiveRelease();
+ /**
+ * The release mode under which this logical connection is operating.
+ *
+ * @return the release mode.
+ */
+ public ConnectionReleaseMode getConnectionReleaseMode();
+
+ /**
+ * Used to signify that a statement has completed execution which may
+ * indicate that this logical connection need to perform an
+ * aggressive release of its physical connection.
+ */
+ public void afterStatementExecution();
+
+ /**
+ * Used to signify that a transaction has completed which may indicate
+ * that this logical connection need to perform an aggressive release
+ * of its physical connection.
+ */
+ public void afterTransaction();
+
+ /**
+ * Manually (and termporarily) circumvent aggressive release processing.
+ */
+ public void disableReleases();
+
+ /**
+ * Re enable aggressive release processing (after a prior {@link #disableReleases()} call.
+ */
+ public void enableReleases();
}
Deleted: sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/AbstractStatementProxy.java
===================================================================
--- sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/AbstractStatementProxy.java 2007-08-16 06:38:43 UTC (rev 13925)
+++ sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/AbstractStatementProxy.java 2007-08-16 08:13:46 UTC (rev 13926)
@@ -1,139 +0,0 @@
-/*
- * Copyright (c) 2007, Red Hat Middleware, LLC. All rights reserved.
- *
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, v. 2.1. This program is distributed in the
- * hope that it will be useful, but WITHOUT A WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details. You should have received a
- * copy of the GNU Lesser General Public License, v.2.1 along with this
- * distribution; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Red Hat Author(s): Steve Ebersole
- */
-package org.hibernate.jdbc.proxy;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.hibernate.HibernateException;
-import org.hibernate.jdbc.JDBCContainer;
-import org.hibernate.jdbc.JDBCServices;
-
-/**
- * AbstractStatementProxy implementation
- *
- * @author Steve Ebersole
- */
-public abstract class AbstractStatementProxy implements InvocationHandler {
-
- private static final Logger log = LoggerFactory.getLogger( AbstractStatementProxy.class );
-
- private boolean valid = true;
- private Statement statement;
- private ConnectionProxy connectionProxy;
-
- protected AbstractStatementProxy(Statement statement, ConnectionProxy connectionProxy) {
- this.statement = statement;
- this.connectionProxy = connectionProxy;
- }
-
- protected Statement getStatement() {
- if ( !valid ) {
- throw new HibernateException( "statment proxy is no longer valid" );
- }
- return statement;
- }
-
- protected ConnectionProxy getConnectionProxy() {
- return connectionProxy;
- }
-
- protected JDBCServices getJdbcServices() {
- return getConnectionProxy().getJdbcServices();
- }
-
- protected JDBCContainer getJdbcContainer() {
- return getConnectionProxy().getJdbcContainer();
- }
-
- public final Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
- String methodName = method.getName();
- log.trace( "Handling invocation of statement method [{}]", methodName );
-
- if ( "toString".equals( methodName ) ) {
- return this.toString();
- }
-
- if ( "close".equals( methodName ) ) {
- explicitClose( ( Statement ) proxy );
- return null;
- }
-
- if ( "invalidate".equals( methodName ) ) {
- invalidateHandle();
- return null;
- }
-
- if ( "getWrappedStatement".equals( methodName ) ) {
- return getStatement();
- }
-
- if ( !valid ) {
- throw new HibernateException( "connection handle is no longer valid" );
- }
-
- beginningInvocationHandling( method, args );
-
- try {
- boolean exposingResultSet = doesMethodExposeResultSet( method );
-
- Object result = method.invoke( statement, args );
-
- if ( exposingResultSet ) {
- result = ProxyBuilder.buildResultSet( ( ResultSet ) result, this );
- getJdbcContainer().register( ( ResultSet ) result );
- }
-
- return result;
- }
- catch ( InvocationTargetException e ) {
- Throwable realException = e.getTargetException();
- if ( SQLException.class.isInstance( realException ) ) {
- throw connectionProxy.getJdbcServices().getExceptionHelper().convert( ( SQLException ) realException, "???", "???" );
- }
- else {
- throw realException;
- }
- }
- }
-
- protected void beginningInvocationHandling(Method method, Object[] args) {
- }
-
- private void explicitClose(Statement proxy) {
- if ( valid ) {
- getJdbcContainer().release( proxy );
- }
- }
-
- private void invalidateHandle() {
- connectionProxy = null;
- statement = null;
- valid = false;
- }
-
- protected boolean doesMethodExposeResultSet(Method method) {
- return ResultSet.class.isAssignableFrom( method.getReturnType() )
- && !method.getName().equals( "getGeneratedKeys" );
- }
-}
Modified: sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/AbstractStatementProxyHandler.java
===================================================================
--- sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/AbstractStatementProxyHandler.java 2007-08-16 06:38:43 UTC (rev 13925)
+++ sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/AbstractStatementProxyHandler.java 2007-08-16 08:13:46 UTC (rev 13926)
@@ -29,6 +29,7 @@
import org.hibernate.HibernateException;
import org.hibernate.jdbc.JDBCContainer;
import org.hibernate.jdbc.JDBCServices;
+import org.hibernate.jdbc.impl.LogicalConnectionImplementor;
/**
* The InvocationHandler for intercepting messages to {@link Statement} proxies.
@@ -148,7 +149,9 @@
private void explicitClose(Statement proxy) {
if ( valid ) {
+ LogicalConnectionImplementor lc = getConnectionProxy().getLogicalConnection();
getJdbcContainer().release( proxy );
+ lc.afterStatementExecution();
}
}
Modified: sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/ConnectionProxyHandler.java
===================================================================
--- sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/ConnectionProxyHandler.java 2007-08-16 06:38:43 UTC (rev 13925)
+++ sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/ConnectionProxyHandler.java 2007-08-16 08:13:46 UTC (rev 13926)
@@ -189,7 +189,7 @@
/**
* {@inheritDoc}
*/
- public void physicalConnectionObtained() {
+ public void physicalConnectionObtained(Connection connection) {
}
/**
Deleted: sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/ResultSetProxy.java
===================================================================
--- sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/ResultSetProxy.java 2007-08-16 06:38:43 UTC (rev 13925)
+++ sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/ResultSetProxy.java 2007-08-16 08:13:46 UTC (rev 13926)
@@ -1,122 +0,0 @@
-/*
- * Copyright (c) 2007, Red Hat Middleware, LLC. All rights reserved.
- *
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, v. 2.1. This program is distributed in the
- * hope that it will be useful, but WITHOUT A WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details. You should have received a
- * copy of the GNU Lesser General Public License, v.2.1 along with this
- * distribution; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Red Hat Author(s): Steve Ebersole
- */
-package org.hibernate.jdbc.proxy;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.InvocationTargetException;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.hibernate.HibernateException;
-import org.hibernate.jdbc.JDBCServices;
-import org.hibernate.jdbc.JDBCContainer;
-
-/**
- * ResultSetProxy implementation
- *
- * @author Steve Ebersole
- */
-public class ResultSetProxy implements InvocationHandler {
-
- private static final Logger log = LoggerFactory.getLogger( ResultSetProxy.class );
-
- private boolean valid = true;
- private ResultSet physicalResultSet;
- private AbstractStatementProxy associatedStatementProxy;
-
- public ResultSetProxy(ResultSet physicalResultSet, AbstractStatementProxy associatedStatementProxy) {
- this.physicalResultSet = physicalResultSet;
- this.associatedStatementProxy = associatedStatementProxy;
- associatedStatementProxy.getJdbcContainer().register( physicalResultSet );
- }
-
- protected ResultSet getResultSet() {
- errorIfInvalid();
- return physicalResultSet;
- }
-
- protected void errorIfInvalid() {
- if ( !valid ) {
- throw new HibernateException( "resultset handle is no longer valid" );
- }
- }
-
- protected AbstractStatementProxy getStatementProxy() {
- return associatedStatementProxy;
- }
-
- protected JDBCServices getJdbcServices() {
- return getStatementProxy().getJdbcServices();
- }
-
- protected JDBCContainer getJdbcContainer() {
- return getStatementProxy().getJdbcContainer();
- }
-
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
- String methodName = method.getName();
- log.trace( "Handling invocation of resultset method [{}]", methodName );
-
- if ( "toString".equals( methodName ) ) {
- return this.toString();
- }
-
- if ( "close".equals( methodName ) ) {
- explicitClose( ( ResultSet ) proxy );
- return null;
- }
-
- if ( "invalidate".equals( methodName ) ) {
- invalidateHandle();
- return null;
- }
-
- if ( "getWrappedStatement".equals( methodName ) ) {
- return getResultSet();
- }
-
- errorIfInvalid();
-
- try {
- return method.invoke( physicalResultSet, args );
- }
- catch ( InvocationTargetException e ) {
- Throwable realException = e.getTargetException();
- if ( SQLException.class.isInstance( realException ) ) {
- throw getJdbcServices().getExceptionHelper().convert( ( SQLException ) realException, "???" );
- }
- else {
- throw realException;
- }
- }
- }
-
- private void explicitClose(ResultSet proxy) {
- if ( valid ) {
- associatedStatementProxy.getJdbcContainer().release( proxy );
- }
- }
-
- private void invalidateHandle() {
- associatedStatementProxy = null;
- physicalResultSet = null;
- valid = false;
- }
-}
Modified: sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/util/ExceptionHelper.java
===================================================================
--- sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/util/ExceptionHelper.java 2007-08-16 06:38:43 UTC (rev 13925)
+++ sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/util/ExceptionHelper.java 2007-08-16 08:13:46 UTC (rev 13926)
@@ -24,10 +24,12 @@
import org.hibernate.JDBCException;
import org.hibernate.exception.SQLExceptionConverter;
+import org.hibernate.exception.SQLStateConverter;
+import org.hibernate.exception.ViolatedConstraintNameExtracter;
import org.hibernate.util.StringHelper;
/**
- * ExceptionHelper implementation
+ * Helper for handling SQLExceptions in various manners.
*
* @author Steve Ebersole
*/
@@ -35,31 +37,83 @@
public static final String DEFAULT_EXCEPTION_MSG = "SQL Exception";
public static final String DEFAULT_WARNING_MSG = "SQL Warning";
+ public static final SQLExceptionConverter DEFAULT_CONVERTER = new SQLStateConverter(
+ new ViolatedConstraintNameExtracter() {
+ public String extractConstraintName(SQLException e) {
+ return null;
+ }
+ }
+ );
+
private static final Logger log = LoggerFactory.getLogger( ExceptionHelper.class );
private SQLExceptionConverter sqlExceptionConverter;
+ /**
+ * Create an exception helper with a default exception converter.
+ */
+ public ExceptionHelper() {
+ sqlExceptionConverter = DEFAULT_CONVERTER;
+ }
+
+ /**
+ * Create an exception helper with a specific exception converter.
+ *
+ * @param sqlExceptionConverter The exception converter to use.
+ */
public ExceptionHelper(SQLExceptionConverter sqlExceptionConverter) {
this.sqlExceptionConverter = sqlExceptionConverter;
}
+ /**
+ * Access the current exception converter being used internally.
+ *
+ * @return The current exception converter.
+ */
public SQLExceptionConverter getSqlExceptionConverter() {
return sqlExceptionConverter;
}
+ /**
+ * Inject the exception converter to use.
+ * <p/>
+ * NOTE : <tt>null</tt> is allowed and signifies to use the default.
+ *
+ * @param sqlExceptionConverter The converter to use.
+ */
public void setSqlExceptionConverter(SQLExceptionConverter sqlExceptionConverter) {
- this.sqlExceptionConverter = sqlExceptionConverter;
+ this.sqlExceptionConverter = ( sqlExceptionConverter == null ? DEFAULT_CONVERTER : sqlExceptionConverter );
}
+ /**
+ * Convert an SQLException using the current converter, doing some logging first.
+ *
+ * @param sqle The exception to convert
+ * @param message An error message.
+ * @return The converted exception
+ */
public JDBCException convert(SQLException sqle, String message) {
return convert( sqle, message, "n/a" );
}
+ /**
+ * Convert an SQLException using the current converter, doing some logging first.
+ *
+ * @param sqle The exception to convert
+ * @param message An error message.
+ * @param sql The SQL being executed when the exception occurred
+ * @return The converted exception
+ */
public JDBCException convert(SQLException sqle, String message, String sql) {
logExceptions( sqle, message + " [" + sql + "]" );
return sqlExceptionConverter.convert( sqle, message, sql );
}
+ /**
+ * Log any {@link SQLWarning}s registered with the connection.
+ *
+ * @param connection The connection to check for warnings.
+ */
public void logAndClearWarnings(Connection connection) {
if ( log.isWarnEnabled() ) {
try {
@@ -80,10 +134,21 @@
}
+ /**
+ * Log the given (and any nested) warning.
+ *
+ * @param warning The warning
+ */
public void logWarnings(SQLWarning warning) {
logWarnings( warning, null );
}
+ /**
+ * Log the given (and any nested) warning.
+ *
+ * @param warning The warning
+ * @param message The message text to use as a preamble.
+ */
public void logWarnings(SQLWarning warning, String message) {
if ( log.isWarnEnabled() ) {
if ( log.isDebugEnabled() && warning != null ) {
@@ -103,25 +168,36 @@
}
}
- public void logExceptions(SQLException ex) {
- logExceptions( ex, null );
+ /**
+ * Log the given (and any nested) exception.
+ *
+ * @param sqlException The exception to log
+ */
+ public void logExceptions(SQLException sqlException) {
+ logExceptions( sqlException, null );
}
- public void logExceptions(SQLException ex, String message) {
+ /**
+ * Log the given (and any nested) exception.
+ *
+ * @param sqlException The exception to log
+ * @param message The message text to use as a preamble.
+ */
+ public void logExceptions(SQLException sqlException, String message) {
if ( log.isErrorEnabled() ) {
if ( log.isDebugEnabled() ) {
message = StringHelper.isNotEmpty( message ) ? message : DEFAULT_EXCEPTION_MSG;
- log.debug( message, ex );
+ log.debug( message, sqlException );
}
- while ( ex != null ) {
+ while ( sqlException != null ) {
StringBuffer buf = new StringBuffer( 30 )
.append( "SQL Error: " )
- .append( ex.getErrorCode() )
+ .append( sqlException.getErrorCode() )
.append( ", SQLState: " )
- .append( ex.getSQLState() );
+ .append( sqlException.getSQLState() );
log.warn( buf.toString() );
- log.error( ex.getMessage() );
- ex = ex.getNextException();
+ log.error( sqlException.getMessage() );
+ sqlException = sqlException.getNextException();
}
}
}
Modified: sandbox/trunk/jdbc-proxy/src/test/java/org/hibernate/jdbc/proxy/BasicConnectionProxyTest.java
===================================================================
--- sandbox/trunk/jdbc-proxy/src/test/java/org/hibernate/jdbc/proxy/BasicConnectionProxyTest.java 2007-08-16 06:38:43 UTC (rev 13925)
+++ sandbox/trunk/jdbc-proxy/src/test/java/org/hibernate/jdbc/proxy/BasicConnectionProxyTest.java 2007-08-16 08:13:46 UTC (rev 13926)
@@ -72,8 +72,10 @@
stmnt.execute( "drop table SANDBOX_JDBC_TST if exists" );
stmnt.execute( "create table SANDBOX_JDBC_TST ( ID integer, NAME varchar(100) )" );
assertTrue( logicalConnection.getJdbcContainer().hasRegisteredResources() );
- logicalConnection.getJdbcContainer().releaseResources();
+ assertTrue( logicalConnection.isPhysicallyConnected() );
+ stmnt.close();
assertFalse( logicalConnection.getJdbcContainer().hasRegisteredResources() );
+ assertTrue( logicalConnection.isPhysicallyConnected() ); // after_transaction specified
PreparedStatement ps = proxiedConnection.prepareStatement( "insert into SANDBOX_JDBC_TST( ID, NAME ) values ( ?, ? )" );
ps.setLong( 1, 1 );
16 years, 8 months
Hibernate SVN: r13925 - in sandbox/trunk/jdbc-proxy/src: test/java/org/hibernate/jdbc/proxy and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2007-08-16 02:38:43 -0400 (Thu, 16 Aug 2007)
New Revision: 13925
Added:
sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/AbstractStatementProxyHandler.java
sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/BasicStatementProxyHandler.java
sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/ConnectionProxyHandler.java
sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/PreparedStatementProxyHandler.java
sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/ResultSetProxyHandler.java
Removed:
sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/ConnectionProxy.java
sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/PreparedStatementProxy.java
sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/StatementProxy.java
Modified:
sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/ProxyBuilder.java
sandbox/trunk/jdbc-proxy/src/test/java/org/hibernate/jdbc/proxy/BasicConnectionProxyTest.java
Log:
cleanup and renaming
Copied: sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/AbstractStatementProxyHandler.java (from rev 12934, sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/AbstractStatementProxy.java)
===================================================================
--- sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/AbstractStatementProxyHandler.java (rev 0)
+++ sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/AbstractStatementProxyHandler.java 2007-08-16 06:38:43 UTC (rev 13925)
@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 2007, Red Hat Middleware, LLC. All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, v. 2.1. This program is distributed in the
+ * hope that it will be useful, but WITHOUT A WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details. You should have received a
+ * copy of the GNU Lesser General Public License, v.2.1 along with this
+ * distribution; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Red Hat Author(s): Steve Ebersole
+ */
+package org.hibernate.jdbc.proxy;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.hibernate.HibernateException;
+import org.hibernate.jdbc.JDBCContainer;
+import org.hibernate.jdbc.JDBCServices;
+
+/**
+ * The InvocationHandler for intercepting messages to {@link Statement} proxies.
+ *
+ * @author Steve Ebersole
+ */
+public abstract class AbstractStatementProxyHandler implements InvocationHandler {
+ private static final Logger log = LoggerFactory.getLogger( AbstractStatementProxyHandler.class );
+
+ private ConnectionProxyHandler connectionProxyHandler;
+ private Connection connectionProxy;
+ private Statement statement;
+ private boolean valid = true;
+ private final int hashCode;
+
+ protected AbstractStatementProxyHandler(
+ Statement statement,
+ ConnectionProxyHandler connectionProxyHandler,
+ Connection connectionProxy) {
+ this.statement = statement;
+ this.connectionProxyHandler = connectionProxyHandler;
+ this.connectionProxy = connectionProxy;
+ this.hashCode = statement.hashCode();
+ }
+
+ private void errorIfInvalid() {
+ if ( !valid ) {
+ throw new HibernateException( "statment proxy is no longer valid" );
+ }
+ }
+
+ protected ConnectionProxyHandler getConnectionProxy() {
+ errorIfInvalid();
+ return connectionProxyHandler;
+ }
+
+ protected JDBCServices getJdbcServices() {
+ return getConnectionProxy().getJdbcServices();
+ }
+
+ protected JDBCContainer getJdbcContainer() {
+ return getConnectionProxy().getJdbcContainer();
+ }
+
+ protected Statement getStatement() {
+ errorIfInvalid();
+ return statement;
+ }
+
+ protected Statement getStatementWithoutChecks() {
+ return statement;
+ }
+
+ public final Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+ String methodName = method.getName();
+ log.trace( "Handling invocation of statement method [{}]", methodName );
+
+ // basic Object methods ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ if ( "toString".equals( methodName ) ) {
+ return this.toString();
+ }
+ if ( "equals".equals( methodName ) ) {
+ return this.equals( args[0] );
+ }
+ if ( "hashCode".equals( methodName ) ) {
+ return this.hashCode();
+ }
+
+ // other methods allowed while invalid ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ if ( "close".equals( methodName ) ) {
+ explicitClose( ( Statement ) proxy );
+ return null;
+ }
+ if ( "invalidate".equals( methodName ) ) {
+ invalidateHandle();
+ return null;
+ }
+
+ errorIfInvalid();
+
+ if ( "getWrappedStatement".equals( methodName ) ) {
+ return getStatementWithoutChecks();
+ }
+
+ if ( "getConnection".equals( methodName ) ) {
+ return connectionProxy;
+ }
+
+ beginningInvocationHandling( method, args );
+
+ try {
+ boolean exposingResultSet = doesMethodExposeResultSet( method );
+
+ Object result = method.invoke( statement, args );
+
+ if ( exposingResultSet ) {
+ result = ProxyBuilder.buildResultSet( ( ResultSet ) result, this, ( Statement ) proxy );
+ getJdbcContainer().register( ( ResultSet ) result );
+ }
+
+ return result;
+ }
+ catch ( InvocationTargetException e ) {
+ Throwable realException = e.getTargetException();
+ if ( SQLException.class.isInstance( realException ) ) {
+ throw connectionProxyHandler.getJdbcServices().getExceptionHelper()
+ .convert( ( SQLException ) realException, realException.getMessage() );
+ }
+ else {
+ throw realException;
+ }
+ }
+ }
+
+ protected void beginningInvocationHandling(Method method, Object[] args) {
+ }
+
+ private void explicitClose(Statement proxy) {
+ if ( valid ) {
+ getJdbcContainer().release( proxy );
+ }
+ }
+
+ private void invalidateHandle() {
+ connectionProxyHandler = null;
+ statement = null;
+ valid = false;
+ }
+
+ protected boolean doesMethodExposeResultSet(Method method) {
+ // todo : we still need to handle getGeneratedKeys, since the resultset there would expose the statement
+ return ResultSet.class.isAssignableFrom( method.getReturnType() )
+ && !method.getName().equals( "getGeneratedKeys" );
+ }
+
+ public String toString() {
+ return super.toString() + "[valid=" + valid + "]";
+ }
+
+ public int hashCode() {
+ return hashCode;
+ }
+}
Copied: sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/BasicStatementProxyHandler.java (from rev 12914, sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/StatementProxy.java)
===================================================================
--- sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/BasicStatementProxyHandler.java (rev 0)
+++ sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/BasicStatementProxyHandler.java 2007-08-16 06:38:43 UTC (rev 13925)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2007, Red Hat Middleware, LLC. All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, v. 2.1. This program is distributed in the
+ * hope that it will be useful, but WITHOUT A WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details. You should have received a
+ * copy of the GNU Lesser General Public License, v.2.1 along with this
+ * distribution; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Red Hat Author(s): Steve Ebersole
+ */
+package org.hibernate.jdbc.proxy;
+
+import java.sql.Statement;
+import java.sql.Connection;
+import java.lang.reflect.Method;
+
+/**
+ * BasicStatementProxyHandler implementation
+ *
+ * @author Steve Ebersole
+ */
+public class BasicStatementProxyHandler extends AbstractStatementProxyHandler {
+ public BasicStatementProxyHandler(
+ Statement statement,
+ ConnectionProxyHandler connectionProxyHandler,
+ Connection connectionProxy) {
+ super( statement, connectionProxyHandler, connectionProxy );
+ }
+
+ protected void beginningInvocationHandling(Method method, Object[] args) {
+ if ( isExecution( method ) ) {
+ getJdbcServices().getSqlStatementLogger().logStatement( ( String ) args[0] );
+ }
+ }
+
+ private boolean isExecution(Method method) {
+ String methodName = method.getName();
+ return "execute".equals( methodName )
+ || "executeQuery".equals( methodName )
+ || "executeUpdate".equals( methodName );
+ }
+}
Deleted: sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/ConnectionProxy.java
===================================================================
--- sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/ConnectionProxy.java 2007-08-16 04:34:59 UTC (rev 13924)
+++ sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/ConnectionProxy.java 2007-08-16 06:38:43 UTC (rev 13925)
@@ -1,145 +0,0 @@
-/*
- * Copyright (c) 2007, Red Hat Middleware, LLC. All rights reserved.
- *
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, v. 2.1. This program is distributed in the
- * hope that it will be useful, but WITHOUT A WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details. You should have received a
- * copy of the GNU Lesser General Public License, v.2.1 along with this
- * distribution; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Red Hat Author(s): Steve Ebersole
- */
-package org.hibernate.jdbc.proxy;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.sql.CallableStatement;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.SQLException;
-import java.sql.Statement;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.hibernate.HibernateException;
-import org.hibernate.jdbc.JDBCContainer;
-import org.hibernate.jdbc.JDBCServices;
-import org.hibernate.jdbc.impl.ConnectionObserver;
-import org.hibernate.jdbc.impl.LogicalConnectionImplementor;
-
-/**
- * ConnectionProxy implementation
- *
- * @author Steve Ebersole
- */
-public class ConnectionProxy implements InvocationHandler, ConnectionObserver {
-
- private static final Logger log = LoggerFactory.getLogger( ConnectionProxy.class );
-
- private boolean valid = true;
- private LogicalConnectionImplementor logicalConnection;
-
- public ConnectionProxy(LogicalConnectionImplementor logicalConnection) {
- this.logicalConnection = logicalConnection;
- this.logicalConnection.addObserver( this );
- }
-
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
- String methodName = method.getName();
- log.trace( "Handling invocation of connection method [{}]", methodName );
-
- if ( "close".equals( methodName ) ) {
- explicitClose();
- return null;
- }
-
- if ( "toString".equals( methodName ) ) {
- return this.toString();
- }
-
- if ( !valid ) {
- throw new HibernateException( "connection handle is invalid" );
- }
-
- if ( "getWrappedConnection".equals( methodName ) ) {
- return extractPhysicalConnection();
- }
-
- try {
- boolean creatingBasicStatement = "createStatement".equals( methodName );
- boolean creatingPreparedStatement = "prepareStatement".equals( methodName );
- boolean creatingCallableStatement = "prepareCall".equals( methodName );
-
- Object result = method.invoke( extractPhysicalConnection(), args );
-
- if ( creatingBasicStatement || creatingPreparedStatement || creatingCallableStatement ) {
- if ( creatingPreparedStatement ) {
- result = ProxyBuilder.buildPreparedStatement( ( String ) args[0], ( PreparedStatement ) result, this );
- }
- else if ( creatingCallableStatement ) {
- result = ProxyBuilder.buildCallableStatement( ( String ) args[0], ( CallableStatement ) result, this );
- }
- else {
- result = ProxyBuilder.buildStatement( ( Statement ) result, this );
- }
- getJdbcContainer().register( ( Statement ) result );
- }
-
- return result;
- }
- catch( InvocationTargetException e ) {
- Throwable realException = e.getTargetException();
- if ( SQLException.class.isInstance( realException ) ) {
- throw logicalConnection.getJdbcServices().getExceptionHelper().convert( ( SQLException ) realException, realException.getMessage(), "???" );
- }
- else {
- throw realException;
- }
- }
- }
-
- private void explicitClose() {
- if ( valid ) {
- invalidateHandle();
- }
- }
-
- private void invalidateHandle() {
- log.trace( "Invalidating connection handle" );
- logicalConnection = null;
- valid = false;
- }
-
- private Connection extractPhysicalConnection() {
- return logicalConnection.getConnection();
- }
-
- /*package-protected*/ JDBCServices getJdbcServices() {
- return logicalConnection.getJdbcServices();
- }
-
- /*package-protected*/ JDBCContainer getJdbcContainer() {
- return logicalConnection.getJdbcContainer();
- }
-
- // JDBC ConnectionObserver impl ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- public void physicalConnectionObtained() {
- }
-
- public void physicalConnectionReleased() {
- log.info( "logical connection releasing its physical connection");
- }
-
- public void logicalConnectionClosed() {
- log.info( "*** logical connection closed ***" );
- invalidateHandle();
- }
-
-}
Copied: sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/ConnectionProxyHandler.java (from rev 12934, sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/ConnectionProxy.java)
===================================================================
--- sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/ConnectionProxyHandler.java (rev 0)
+++ sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/ConnectionProxyHandler.java 2007-08-16 06:38:43 UTC (rev 13925)
@@ -0,0 +1,217 @@
+/*
+ * Copyright (c) 2007, Red Hat Middleware, LLC. All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, v. 2.1. This program is distributed in the
+ * hope that it will be useful, but WITHOUT A WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details. You should have received a
+ * copy of the GNU Lesser General Public License, v.2.1 along with this
+ * distribution; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Red Hat Author(s): Steve Ebersole
+ */
+package org.hibernate.jdbc.proxy;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.sql.CallableStatement;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+import java.sql.Statement;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.hibernate.HibernateException;
+import org.hibernate.jdbc.JDBCContainer;
+import org.hibernate.jdbc.JDBCServices;
+import org.hibernate.jdbc.impl.ConnectionObserver;
+import org.hibernate.jdbc.impl.LogicalConnectionImplementor;
+
+/**
+ * The InvocationHandler for intercepting messages to {@link Connection} proxies.
+ *
+ * @author Steve Ebersole
+ */
+public class ConnectionProxyHandler implements InvocationHandler, ConnectionObserver {
+ private static final Logger log = LoggerFactory.getLogger( ConnectionProxyHandler.class );
+
+ private LogicalConnectionImplementor logicalConnection;
+ private boolean valid = true;
+ private final int hashCode;
+
+ public ConnectionProxyHandler(LogicalConnectionImplementor logicalConnection) {
+ this.logicalConnection = logicalConnection;
+ this.logicalConnection.addObserver( this );
+ this.hashCode = this.logicalConnection.hashCode();
+ }
+
+ /**
+ * Access to our logical connection.
+ *
+ * @return the logical connection
+ */
+ protected LogicalConnectionImplementor getLogicalConnection() {
+ errorIfInvalid();
+ return logicalConnection;
+ }
+
+ private void errorIfInvalid() {
+ if ( !valid ) {
+ throw new HibernateException( "connection handle is invalid" );
+ }
+ }
+
+ /**
+ * Get reference to physical connection.
+ * <p/>
+ * NOTE : be sure this handler is still valid before calling!
+ *
+ * @return The physical connection
+ */
+ private Connection extractPhysicalConnection() {
+ return logicalConnection.getConnection();
+ }
+
+ /**
+ * Provide access to JDBCServices.
+ * <p/>
+ * NOTE : package-protected
+ *
+ * @return JDBCServices
+ */
+ JDBCServices getJdbcServices() {
+ return logicalConnection.getJdbcServices();
+ }
+
+ /**
+ * Provide access to JDBCContainer.
+ * <p/>
+ * NOTE : package-protected
+ *
+ * @return JDBCContainer
+ */
+ JDBCContainer getJdbcContainer() {
+ return logicalConnection.getJdbcContainer();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+ String methodName = method.getName();
+ log.trace( "Handling invocation of connection method [{}]", methodName );
+
+ // basic Object methods ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ if ( "toString".equals( methodName ) ) {
+ return this.toString();
+ }
+ if ( "equals".equals( methodName ) ) {
+ return this.equals( args[0] );
+ }
+ if ( "hashCode".equals( methodName ) ) {
+ return this.hashCode();
+ }
+
+ // other methods allowed while invalid ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ if ( "close".equals( methodName ) ) {
+ explicitClose();
+ return null;
+ }
+
+ errorIfInvalid();
+
+ if ( "getWrappedConnection".equals( methodName ) ) {
+ return extractPhysicalConnection();
+ }
+
+ try {
+ Object result = method.invoke( extractPhysicalConnection(), args );
+
+ if ( "createStatement".equals( methodName ) ) {
+ result = ProxyBuilder.buildStatement(
+ ( Statement ) result,
+ this,
+ ( Connection ) proxy
+ );
+ getJdbcContainer().register( ( Statement ) result );
+ }
+ else if ( "prepareStatement".equals( methodName ) ) {
+ result = ProxyBuilder.buildPreparedStatement(
+ ( String ) args[0],
+ ( PreparedStatement ) result,
+ this,
+ ( Connection ) proxy
+ );
+ getJdbcContainer().register( ( Statement ) result );
+ }
+ else if ( "prepareCall".equals( methodName ) ) {
+ result = ProxyBuilder.buildCallableStatement(
+ ( String ) args[0],
+ ( CallableStatement ) result,
+ this,
+ ( Connection ) proxy
+ );
+ getJdbcContainer().register( ( Statement ) result );
+ }
+
+ return result;
+ }
+ catch( InvocationTargetException e ) {
+ Throwable realException = e.getTargetException();
+ if ( SQLException.class.isInstance( realException ) ) {
+ throw logicalConnection.getJdbcServices().getExceptionHelper()
+ .convert( ( SQLException ) realException, realException.getMessage() );
+ }
+ else {
+ throw realException;
+ }
+ }
+ }
+
+ private void explicitClose() {
+ if ( valid ) {
+ invalidateHandle();
+ }
+ }
+
+ private void invalidateHandle() {
+ log.trace( "Invalidating connection handle" );
+ logicalConnection = null;
+ valid = false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void physicalConnectionObtained() {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void physicalConnectionReleased() {
+ log.info( "logical connection releasing its physical connection");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void logicalConnectionClosed() {
+ log.info( "*** logical connection closed ***" );
+ invalidateHandle();
+ }
+
+ public String toString() {
+ return super.toString() + "[valid=" + valid + "]";
+ }
+
+ public int hashCode() {
+ return hashCode;
+ }
+}
Deleted: sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/PreparedStatementProxy.java
===================================================================
--- sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/PreparedStatementProxy.java 2007-08-16 04:34:59 UTC (rev 13924)
+++ sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/PreparedStatementProxy.java 2007-08-16 06:38:43 UTC (rev 13925)
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2007, Red Hat Middleware, LLC. All rights reserved.
- *
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, v. 2.1. This program is distributed in the
- * hope that it will be useful, but WITHOUT A WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details. You should have received a
- * copy of the GNU Lesser General Public License, v.2.1 along with this
- * distribution; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Red Hat Author(s): Steve Ebersole
- */
-package org.hibernate.jdbc.proxy;
-
-import java.sql.Statement;
-import java.lang.reflect.Method;
-
-/**
- * PreparedStatementProxy implementation
- *
- * @author Steve Ebersole
- */
-public class PreparedStatementProxy extends AbstractStatementProxy {
- private final String sql;
-
- protected PreparedStatementProxy(String sql, Statement statement, ConnectionProxy connectionProxy) {
- super( statement, connectionProxy );
- connectionProxy.getJdbcServices().getSqlStatementLogger().logStatement( sql );
- this.sql = sql;
- }
-
- protected void beginningInvocationHandling(Method method, Object[] args) {
- if ( isExecution( method ) ) {
- logExecution();
- }
- else {
- journalPossibleParameterBind( method, args );
- }
- }
-
- private void journalPossibleParameterBind(Method method, Object[] args) {
- String methodName = method.getName();
- // todo : is this enough???
- if ( methodName.startsWith( "set" ) && args != null && args.length >= 2 ) {
- journalParameterBind( method, args );
- }
- }
-
- private void journalParameterBind(Method method, Object[] args) {
- }
-
- private boolean isExecution(Method method) {
- return false;
- }
-
- private void logExecution() {
- }
-}
Copied: sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/PreparedStatementProxyHandler.java (from rev 12934, sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/PreparedStatementProxy.java)
===================================================================
--- sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/PreparedStatementProxyHandler.java (rev 0)
+++ sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/PreparedStatementProxyHandler.java 2007-08-16 06:38:43 UTC (rev 13925)
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2007, Red Hat Middleware, LLC. All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, v. 2.1. This program is distributed in the
+ * hope that it will be useful, but WITHOUT A WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details. You should have received a
+ * copy of the GNU Lesser General Public License, v.2.1 along with this
+ * distribution; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Red Hat Author(s): Steve Ebersole
+ */
+package org.hibernate.jdbc.proxy;
+
+import java.sql.Statement;
+import java.sql.Connection;
+import java.lang.reflect.Method;
+
+/**
+ * PreparedStatementProxyHandler implementation
+ *
+ * @author Steve Ebersole
+ */
+public class PreparedStatementProxyHandler extends AbstractStatementProxyHandler {
+ private final String sql;
+
+ protected PreparedStatementProxyHandler(
+ String sql,
+ Statement statement,
+ ConnectionProxyHandler connectionProxyHandler,
+ Connection connectionProxy) {
+ super( statement, connectionProxyHandler, connectionProxy );
+ connectionProxyHandler.getJdbcServices().getSqlStatementLogger().logStatement( sql );
+ this.sql = sql;
+ }
+
+ protected void beginningInvocationHandling(Method method, Object[] args) {
+ if ( isExecution( method ) ) {
+ logExecution();
+ }
+ else {
+ journalPossibleParameterBind( method, args );
+ }
+ }
+
+ private void journalPossibleParameterBind(Method method, Object[] args) {
+ String methodName = method.getName();
+ // todo : is this enough???
+ if ( methodName.startsWith( "set" ) && args != null && args.length >= 2 ) {
+ journalParameterBind( method, args );
+ }
+ }
+
+ private void journalParameterBind(Method method, Object[] args) {
+ }
+
+ private boolean isExecution(Method method) {
+ return false;
+ }
+
+ private void logExecution() {
+ }
+}
Modified: sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/ProxyBuilder.java
===================================================================
--- sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/ProxyBuilder.java 2007-08-16 04:34:59 UTC (rev 13924)
+++ sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/ProxyBuilder.java 2007-08-16 06:38:43 UTC (rev 13925)
@@ -32,18 +32,32 @@
*/
public class ProxyBuilder {
- // static for now simply to alleviate question about where to keep it...
+ public static final Class[] CONNECTION_PROXY_INTERFACES = new Class[] {
+ Connection.class,
+ ConnectionWrapper.class
+ };
- public static final Class[] CONNECTION_PROXY_INTERFACES = new Class[] { Connection.class, ConnectionWrapper.class };
+ public static final Class[] STMNT_PROXY_INTERFACES = new Class[] {
+ Statement.class,
+ StatementWrapperImplementor.class
+ };
+ public static final Class[] PREPARED_STMNT_PROXY_INTERFACES = new Class[] {
+ PreparedStatement.class,
+ StatementWrapperImplementor.class
+ };
+ public static final Class[] CALLABLE_STMNT_PROXY_INTERFACES = new Class[] {
+ CallableStatement.class,
+ StatementWrapperImplementor.class
+ };
- public static final Class[] STMNT_PROXY_INTERFACES = new Class[] { Statement.class, StatementWrapperImplementor.class };
- public static final Class[] PREPARED_STMNT_PROXY_INTERFACES = new Class[] { PreparedStatement.class, StatementWrapperImplementor.class };
- public static final Class[] CALLABLE_STMNT_PROXY_INTERFACES = new Class[] { CallableStatement.class, StatementWrapperImplementor.class };
+ public static final Class[] RESULTSET_PROXY_INTERFACES = new Class[] {
+ ResultSet.class,
+ ResultSetWrapperImplementor.class
+ };
- public static final Class[] RESULTSET_PROXY_INTERFACES = new Class[] { ResultSet.class, ResultSetWrapperImplementor.class };
public static Connection buildConnection(LogicalConnectionImplementor logicalConnection) {
- ConnectionProxy proxyHandler = new ConnectionProxy( logicalConnection );
+ ConnectionProxyHandler proxyHandler = new ConnectionProxyHandler( logicalConnection );
return ( Connection ) Proxy.newProxyInstance(
ConnectionWrapper.class.getClassLoader(),
CONNECTION_PROXY_INTERFACES,
@@ -51,8 +65,15 @@
);
}
- public static Statement buildStatement(Statement statement, ConnectionProxy connectionProxy) {
- StatementProxy proxyHandler = new StatementProxy( statement, connectionProxy );
+ public static Statement buildStatement(
+ Statement statement,
+ ConnectionProxyHandler connectionProxyHandler,
+ Connection connectionProxy) {
+ BasicStatementProxyHandler proxyHandler = new BasicStatementProxyHandler(
+ statement,
+ connectionProxyHandler,
+ connectionProxy
+ );
return ( Statement ) Proxy.newProxyInstance(
StatementWrapperImplementor.class.getClassLoader(),
STMNT_PROXY_INTERFACES,
@@ -60,8 +81,17 @@
);
}
- public static PreparedStatement buildPreparedStatement(String sql, PreparedStatement statement, ConnectionProxy connectionProxy) {
- PreparedStatementProxy proxyHandler = new PreparedStatementProxy( sql, statement, connectionProxy );
+ public static PreparedStatement buildPreparedStatement(
+ String sql,
+ Statement statement,
+ ConnectionProxyHandler connectionProxyHandler,
+ Connection connectionProxy) {
+ PreparedStatementProxyHandler proxyHandler = new PreparedStatementProxyHandler(
+ sql,
+ statement,
+ connectionProxyHandler,
+ connectionProxy
+ );
return ( PreparedStatement ) Proxy.newProxyInstance(
StatementWrapperImplementor.class.getClassLoader(),
PREPARED_STMNT_PROXY_INTERFACES,
@@ -69,8 +99,17 @@
);
}
- public static CallableStatement buildCallableStatement(String sql, CallableStatement statement, ConnectionProxy connectionProxy) {
- PreparedStatementProxy proxyHandler = new PreparedStatementProxy( sql, statement, connectionProxy );
+ public static CallableStatement buildCallableStatement(
+ String sql,
+ CallableStatement statement,
+ ConnectionProxyHandler connectionProxyHandler,
+ Connection connectionProxy) {
+ PreparedStatementProxyHandler proxyHandler = new PreparedStatementProxyHandler(
+ sql,
+ statement,
+ connectionProxyHandler,
+ connectionProxy
+ );
return ( CallableStatement ) Proxy.newProxyInstance(
StatementWrapperImplementor.class.getClassLoader(),
CALLABLE_STMNT_PROXY_INTERFACES,
@@ -78,8 +117,11 @@
);
}
- public static ResultSet buildResultSet(ResultSet resultSet, AbstractStatementProxy statementProxy) {
- ResultSetProxy proxyHandler = new ResultSetProxy( resultSet, statementProxy );
+ public static ResultSet buildResultSet(
+ ResultSet resultSet,
+ AbstractStatementProxyHandler statementProxyHandler,
+ Statement statementProxy) {
+ ResultSetProxyHandler proxyHandler = new ResultSetProxyHandler( resultSet, statementProxyHandler, statementProxy );
return ( ResultSet ) Proxy.newProxyInstance(
ResultSetWrapperImplementor.class.getClassLoader(),
RESULTSET_PROXY_INTERFACES,
Copied: sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/ResultSetProxyHandler.java (from rev 12934, sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/ResultSetProxy.java)
===================================================================
--- sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/ResultSetProxyHandler.java (rev 0)
+++ sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/ResultSetProxyHandler.java 2007-08-16 06:38:43 UTC (rev 13925)
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2007, Red Hat Middleware, LLC. All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, v. 2.1. This program is distributed in the
+ * hope that it will be useful, but WITHOUT A WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details. You should have received a
+ * copy of the GNU Lesser General Public License, v.2.1 along with this
+ * distribution; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Red Hat Author(s): Steve Ebersole
+ */
+package org.hibernate.jdbc.proxy;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.hibernate.HibernateException;
+import org.hibernate.jdbc.JDBCContainer;
+import org.hibernate.jdbc.JDBCServices;
+
+/**
+ * The InvocationHandler for intercepting messages to {@link ResultSet} proxies.
+ *
+ * @author Steve Ebersole
+ */
+public class ResultSetProxyHandler implements InvocationHandler {
+ private static final Logger log = LoggerFactory.getLogger( ResultSetProxyHandler.class );
+
+ private AbstractStatementProxyHandler statementProxyHandler;
+ private Statement statementProxy;
+ private ResultSet resultSet;
+ private boolean valid = true;
+ private final int hashCode;
+
+ public ResultSetProxyHandler(
+ ResultSet resultSet,
+ AbstractStatementProxyHandler statementProxyHandler,
+ Statement statementProxy) {
+ this.resultSet = resultSet;
+ this.statementProxyHandler = statementProxyHandler;
+ this.statementProxy = statementProxy;
+ this.hashCode = resultSet.hashCode();
+ }
+
+ protected ResultSet getResultSet() {
+ errorIfInvalid();
+ return resultSet;
+ }
+
+ protected ResultSet getResultSetWithoutChecks() {
+ return resultSet;
+ }
+
+ protected void errorIfInvalid() {
+ if ( !valid ) {
+ throw new HibernateException( "resultset handle is no longer valid" );
+ }
+ }
+
+ protected AbstractStatementProxyHandler getStatementProxy() {
+ return statementProxyHandler;
+ }
+
+ protected JDBCServices getJdbcServices() {
+ return getStatementProxy().getJdbcServices();
+ }
+
+ protected JDBCContainer getJdbcContainer() {
+ return getStatementProxy().getJdbcContainer();
+ }
+
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+ String methodName = method.getName();
+ log.trace( "Handling invocation of resultset method [{}]", methodName );
+
+ // basic Object methods ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ if ( "toString".equals( methodName ) ) {
+ return this.toString();
+ }
+ if ( "equals".equals( methodName ) ) {
+ return this.equals( args[0] );
+ }
+ if ( "hashCode".equals( methodName ) ) {
+ return this.hashCode();
+ }
+
+ // other methods allowed while invalid ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ if ( "close".equals( methodName ) ) {
+ explicitClose( ( ResultSet ) proxy );
+ return null;
+ }
+ if ( "invalidate".equals( methodName ) ) {
+ invalidateHandle();
+ return null;
+ }
+
+ errorIfInvalid();
+
+ if ( "getWrappedResultSet".equals( methodName ) ) {
+ return getResultSetWithoutChecks();
+ }
+
+ if ( "getStatement".equals( methodName ) ) {
+ return statementProxy;
+ }
+
+ try {
+ return method.invoke( resultSet, args );
+ }
+ catch ( InvocationTargetException e ) {
+ Throwable realException = e.getTargetException();
+ if ( SQLException.class.isInstance( realException ) ) {
+ throw getJdbcServices().getExceptionHelper()
+ .convert( ( SQLException ) realException, realException.getMessage() );
+ }
+ else {
+ throw realException;
+ }
+ }
+ }
+
+ private void explicitClose(ResultSet proxy) {
+ if ( valid ) {
+ statementProxyHandler.getJdbcContainer().release( proxy );
+ }
+ }
+
+ private void invalidateHandle() {
+ statementProxyHandler = null;
+ resultSet = null;
+ valid = false;
+ }
+
+ public String toString() {
+ return super.toString() + "[valid=" + valid + "]";
+ }
+
+ public int hashCode() {
+ return hashCode;
+ }
+}
Deleted: sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/StatementProxy.java
===================================================================
--- sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/StatementProxy.java 2007-08-16 04:34:59 UTC (rev 13924)
+++ sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/proxy/StatementProxy.java 2007-08-16 06:38:43 UTC (rev 13925)
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2007, Red Hat Middleware, LLC. All rights reserved.
- *
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, v. 2.1. This program is distributed in the
- * hope that it will be useful, but WITHOUT A WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details. You should have received a
- * copy of the GNU Lesser General Public License, v.2.1 along with this
- * distribution; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Red Hat Author(s): Steve Ebersole
- */
-package org.hibernate.jdbc.proxy;
-
-import java.sql.Statement;
-import java.lang.reflect.Method;
-
-/**
- * StatementProxy implementation
- *
- * @author Steve Ebersole
- */
-public class StatementProxy extends AbstractStatementProxy {
- protected StatementProxy(Statement statement, ConnectionProxy connectionProxy) {
- super( statement, connectionProxy );
- }
-
- protected void beginningInvocationHandling(Method method, Object[] args) {
- if ( isExecution( method ) ) {
- getJdbcServices().getSqlStatementLogger().logStatement( ( String ) args[0] );
- }
- }
-
- private boolean isExecution(Method method) {
- String methodName = method.getName();
- return "execute".equals( methodName )
- || "executeQuery".equals( methodName )
- || "executeUpdate".equals( methodName );
- }
-}
Modified: sandbox/trunk/jdbc-proxy/src/test/java/org/hibernate/jdbc/proxy/BasicConnectionProxyTest.java
===================================================================
--- sandbox/trunk/jdbc-proxy/src/test/java/org/hibernate/jdbc/proxy/BasicConnectionProxyTest.java 2007-08-16 04:34:59 UTC (rev 13924)
+++ sandbox/trunk/jdbc-proxy/src/test/java/org/hibernate/jdbc/proxy/BasicConnectionProxyTest.java 2007-08-16 06:38:43 UTC (rev 13925)
@@ -20,7 +20,6 @@
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.PreparedStatement;
-import java.sql.ResultSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -59,12 +58,7 @@
@Test
public void testBasicJdbcUsage() throws JDBCException {
LogicalConnectionImpl logicalConnection = new LogicalConnectionImpl( null, ConnectionReleaseMode.AFTER_TRANSACTION, services );
- ConnectionProxy proxyHandler = new ConnectionProxy( logicalConnection );
- Connection proxiedConnection = ( Connection ) Proxy.newProxyInstance(
- getClass().getClassLoader(),
- new Class[] { Connection.class, ConnectionWrapper.class },
- proxyHandler
- );
+ Connection proxiedConnection = ProxyBuilder.buildConnection( logicalConnection );
try {
try {
16 years, 8 months
Hibernate SVN: r13924 - annotations/trunk/doc/reference and 19 other directories.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2007-08-16 00:34:59 -0400 (Thu, 16 Aug 2007)
New Revision: 13924
Added:
annotations/trunk/common-build.xml
commons-annotations/trunk/common-build.xml
entitymanager/trunk/common-build.xml
search/trunk/common-build.xml
validator/trunk/common-build.xml
Modified:
annotations/trunk/build.xml
annotations/trunk/doc/reference/build.xml
annotations/trunk/doc/reference/en/master.xml
annotations/trunk/doc/reference/en/styles/fopdf.xsl
annotations/trunk/doc/reference/en/styles/html.xsl
annotations/trunk/doc/reference/en/styles/html_chunk.xsl
annotations/trunk/doc/reference/fr/master.xml
annotations/trunk/doc/reference/fr/styles/fopdf.xsl
annotations/trunk/doc/reference/fr/styles/html.xsl
annotations/trunk/doc/reference/fr/styles/html_chunk.xsl
annotations/trunk/doc/reference/zh_cn/master.xml
annotations/trunk/doc/reference/zh_cn/styles/fopdf.xsl
commons-annotations/trunk/build.xml
entitymanager/trunk/build.xml
entitymanager/trunk/doc/reference/build.xml
entitymanager/trunk/doc/reference/en/master.xml
entitymanager/trunk/doc/reference/en/styles/fopdf.xsl
entitymanager/trunk/doc/reference/en/styles/html.xsl
entitymanager/trunk/doc/reference/en/styles/html_chunk.xsl
search/trunk/build.xml
search/trunk/doc/reference/build.xml
search/trunk/doc/reference/en/master.xml
search/trunk/doc/reference/en/styles/fopdf.xsl
search/trunk/doc/reference/en/styles/html.xsl
search/trunk/doc/reference/en/styles/html_chunk.xsl
validator/trunk/build.xml
validator/trunk/doc/reference/build.xml
validator/trunk/doc/reference/en/master.xml
validator/trunk/doc/reference/en/styles/fopdf.xsl
validator/trunk/doc/reference/en/styles/html.xsl
validator/trunk/doc/reference/en/styles/html_chunk.xsl
Log:
duplicate common-build.xml and make documentation work with core
Modified: annotations/trunk/build.xml
===================================================================
--- annotations/trunk/build.xml 2007-08-16 01:04:34 UTC (rev 13923)
+++ annotations/trunk/build.xml 2007-08-16 04:34:59 UTC (rev 13924)
@@ -23,7 +23,7 @@
<property name="copy.test" value="true"/>
<property name="javac.source" value="1.5"/>
<property name="javac.target" value="1.5"/>
- <property name="common.dir" value="../common"/>
+ <property name="common.dir" value="${basedir}"/>
<!-- property name="jpa-api.jar" value="${basedir}/../jpa-api/build/ejb3-persistence.jar"/>
<property name="commons-annotations.jar"
Added: annotations/trunk/common-build.xml
===================================================================
--- annotations/trunk/common-build.xml (rev 0)
+++ annotations/trunk/common-build.xml 2007-08-16 04:34:59 UTC (rev 13924)
@@ -0,0 +1,472 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="common-build" default="dist">
+ <description>Common properties and targets for the HibernateExt project</description>
+
+ <!-- my.basedir property can be used to refer to files/directories relatively to the common-build.xml file -->
+ <dirname property="common-build.basedir" file="${ant.file.common-build}"/>
+
+ <!-- Give user a chance to override without editing this file
+ (and without typing -D each time it compiles it) -->
+ <property file="${common-build.basedir}/build.properties"/>
+ <property file="${user.home}/.ant.properties"/>
+
+ <property name="src.dir" location="src/java"/>
+ <property name="test.dir" location="src/test"/>
+ <property name="lib.dir" location="lib"/>
+ <property name="build.dir" location="build"/>
+ <property name="classes.dir" location="${build.dir}/classes"/>
+ <property name="testclasses.dir" location="${build.dir}/testclasses"/>
+ <property name="dist.target.dir" location="target"/>
+ <property name="dist.dir" location="${dist.target.dir}/${name}"/>
+ <property name="instrumenttest.out.dir" value="instrumenttestout"/>
+ <property name="doc.dir" location="doc"/>
+ <property name="doc.api.dir" location="${doc.dir}/api"/>
+ <property name="doc.reference.dir" location="${doc.dir}/reference"/>
+
+ <property name="dist.doc.dir" location="${dist.dir}/doc"/>
+ <property name="dist.api.dir" location="${dist.dir}/doc/api"/>
+
+ <property name="dist.src.dir" location="${dist.dir}/src"/>
+ <property name="dist.test.dir" location="${dist.dir}/test"/>
+ <property name="dist.lib.dir" location="${dist.dir}/lib"/>
+ <property name="jar.name" value="${name}"/>
+ <property name="jar.file.name" value="${dist.dir}/${jar.name}.jar"/>
+ <property name="jartest.file.name" value="${dist.dir}/${jar.name}-tests.jar"/>
+
+ <property name="javadoc" value="http://java.sun.com/j2se/1.4/docs/api"/>
+ <property name="javac.debug" value="on"/>
+ <property name="javac.optimize" value="off"/>
+ <property name="javac.source" value="1.4"/>
+ <property name="javac.target" value="1.4"/>
+
+
+ <!-- set Hibernate core related properties -->
+ <property name="hibernate-core.home" location="${common-build.basedir}/../hibernate-3.2"/>
+ <property name="hibernate-core.jar" location="${hibernate-core.home}/hibernate3.jar"/>
+ <property name="hibernate-core.lib.dir" location="${hibernate-core.home}/lib"/>
+ <property name="hibernate-core.jdbc.dir" location="${hibernate-core.home}/lib"/> <!-- for some reason jdbc.dir is renamed to lib instead of jdbc when doing a dist of hibernate3 -->
+ <property name="hibernate-core.doc.api" location="${hibernate-core.home}/doc/api"/>
+ <property name="hibernate-cvs.doc.reference" location="${common-build.basedir}/../core/doc/reference"/>
+
+ <!--
+ Explicitly define tasks from ant..
+ Unfortunately, checkstyle-a<path id="lib.class.path">
+ <path location="${hibernate-core.jar}"></path>
+ <fileset dir="${hibernate-core.lib.dir}">
+ <include name="*.jar"/>
+ </fileset>
+ <fileset dir="${lib.dir}">
+ <include name="*.jar"/>
+ </fileset>
+ <pathelement path="${clover.jar}"/>
+ </path>ll.jar contains it's own version of ANTLR, so ANTLR cannot be in the classpath.
+ -->
+ <!-- Emmanuel: Removed antlr, shouldn't be useful in Ext package...
+ taskdef name="antlr" classname="org.apache.tools.ant.taskdefs.optional.ANTLR">
+ <classpath>
+ <pathelement location="${hibernate-core.lib.dir}/antlr-2.7.2.jar"/>
+ <pathelement location="${hibernate-core.lib.dir}/ant-antlr-1.6.1.jar"/>
+ </classpath>
+ </taskdef -->
+
+ <taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
+ <classpath>
+ <fileset dir="${hibernate-core.lib.dir}">
+ <include name="junit-*.jar"/>
+ <include name="ant-junit-*.jar"/>
+ </fileset>
+ </classpath>
+ </taskdef>
+
+ <taskdef name="junitreport" classname="org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator">
+ <classpath>
+ <fileset dir="${hibernate-core.lib.dir}">
+ <include name="junit-*.jar"/>
+ <include name="ant-junit-*.jar"/>
+ </fileset>
+ </classpath>
+ </taskdef>
+
+ <path id="lib.class.path">
+ <path location="${hibernate-core.jar}"></path>
+ <fileset dir="${hibernate-core.lib.dir}">
+ <include name="*.jar"/>
+ </fileset>
+ <fileset dir="${lib.dir}">
+ <include name="*.jar"/>
+ </fileset>
+ <path refid="lib.moduleclass.path"/>
+ <pathelement path="${clover.jar}"/>
+ </path>
+
+ <!-- overridable in modules -->
+ <path id="lib.moduleclass.path"/>
+
+ <patternset id="support.files">
+ <include name="**/*.jpg"/>
+ <include name="**/*.gif"/>
+ <include name="**/*.dtd"/>
+ <include name="**/*.xsd"/>
+ <include name="**/*.xml"/>
+ <include name="**/*.xslt"/>
+
+ <!-- exclude everything we don't want in the jar -->
+ <exclude name="${build.dir}/**/*"/>
+ <exclude name="${doc.dir}/**/*"/>
+ <exclude name="classes/**/*"/>
+ <exclude name="build.xml"/>
+ <exclude name="**/*.properties"/>
+ <exclude name="**/*.ccf"/>
+ <exclude name="**/*.cfg.xml"/>
+ <exclude name="**/ehcache.xml"/>
+ </patternset>
+
+ <patternset id="source.files">
+ <include name="**/*.java"/>
+ <include name="**/*.properties"/>
+ </patternset>
+
+ <!-- junit paths/filesets -->
+ <fileset dir="${testclasses.dir}" id="junit.batchtestset">
+ <include name="**/*Test.class"/>
+ </fileset>
+
+ <path id="testsrc.path">
+ <pathelement location="${test.dir}"/>
+ </path>
+
+ <!-- Clover -->
+ <property name="clover.out.dir" value="cloverout"/>
+ <property name="clover.jar" value="${ant.home}/lib/clover.jar"/>
+ <taskdef resource="clovertasks"/>
+
+ <path id="junit.classpath">
+ <fileset dir="${lib.dir}">
+ <include name="*.jar"/>
+ </fileset>
+ <pathelement path="${classes.dir}"/>
+ <pathelement path="${testclasses.dir}"/>
+ <path refid="lib.class.path"/>
+ <path refid="junit.moduleclasspath"/>
+ <path location="${clover.jar}"/>
+ </path>
+
+ <!-- Clover tasks -->
+ <target name="with.clover">
+ <clover-setup initString="clover_coverage.db"/>
+ </target>
+
+ <target name="cloverreport.html" depends="with.clover"
+ description="Generate a clover report from the current clover database.">
+ <clover-report>
+ <current outfile="${clover.out.dir}">
+ <format type="html"/>
+ </current>
+ </clover-report>
+ </target>
+
+ <target name="cloverreport" depends="with.clover,junitreport,cloverreport.html"
+ description="Run the tests and generate a clover report">
+ </target>
+
+ <!-- Tasks -->
+
+ <target name="clean" description="Cleans up build and dist directories">
+ <delete dir="${build.dir}"/>
+ <delete dir="${dist.target.dir}"/>
+ <delete dir="${clover.out.dir}"/>
+ </target>
+
+ <target name="init" description="Initialize the build">
+ <tstamp>
+ <format property="subversion" pattern="yyyy-MM-dd hh:mm:ss"/>
+ </tstamp>
+ <echo message="Build ${Name}-${version} (${subversion})"/>
+ <mkdir dir="${classes.dir}"/>
+ <mkdir dir="${testclasses.dir}"/>
+ <copy todir="${classes.dir}">
+ <fileset dir="${src.dir}">
+ <patternset refid="support.files"/>
+ </fileset>
+ </copy>
+
+ <copy todir="${build.dir}">
+ <fileset dir=".">
+ <include name="readme.txt"/>
+ <include name="lgpl.txt"/>
+ </fileset>
+ </copy>
+
+ <available file="${hibernate-core.jar}" type="file" property="hibernate-core.jar.available"/>
+ <fail unless="hibernate-core.jar.available" message="Cannot locate hibernate-core.jar: ${hibernate-core.jar}"/>
+ </target>
+
+ <target name="compile" depends="init" description="Compile the Java source code">
+ <available
+ classname="org.eclipse.core.launcher.Main"
+ property="build.compiler"
+ value="org.eclipse.jdt.core.JDTCompilerAdapter"
+ classpath="${java.class.path}"/>
+ <javac
+ target="${javac.target}"
+ source="${javac.source}"
+ srcdir="${src.dir}"
+ destdir="${classes.dir}"
+ classpathref="lib.class.path"
+ debug="${javac.debug}"
+ optimize="${javac.optimize}"
+ nowarn="on">
+ </javac>
+ </target>
+
+ <target name="compiletest" depends="compile" description="Compile the tests">
+ <available
+ classname="org.eclipse.core.launcher.Main"
+ property="build.compiler"
+ value="org.eclipse.jdt.core.JDTCompilerAdapter"
+ classpath="${java.class.path}"/>
+ <javac
+ target="${javac.target}"
+ source="${javac.source}"
+ destdir="${testclasses.dir}"
+ classpathref="junit.classpath"
+ debug="${javac.debug}"
+ optimize="${javac.optimize}"
+ nowarn="on">
+ <src refid="testsrc.path"/>
+ </javac>
+ </target>
+
+ <target name="instrument" depends="compiletest"
+ description="Instrument the persistent classes"> <!-- depends="jar" -->
+
+ <taskdef name="instrument" classname="org.hibernate.tool.instrument.InstrumentTask">
+ <classpath path="${classes.dir}"/>
+ <classpath path="${testclasses.dir}"/>
+ <classpath refid="lib.class.path"/>
+ </taskdef>
+
+ <instrument verbose="true">
+ <fileset dir="${testclasses.dir}/org/hibernate/test">
+ <include name="**/*.class"/>
+ <exclude name="**/*Test$*.class"/>
+ <exclude name="**/*Test.class"/>
+ <exclude name="**/*Tests.class"/>
+ </fileset>
+ </instrument>
+
+ <!-- jar jarfile="${build.dir}/instrumented-classes.jar">
+ <fileset dir="${testclasses.dir}">
+ <include name="org/hibernate/test/**/*.class"/>
+ <exclude name="org/hibernate/test/**/*Test.class"/>
+ </fileset>
+ </jar -->
+
+ </target>
+
+ <target name="copytest" description="Copy tests to dist dir" if="copy.test" >
+ <mkdir dir="${dist.test.dir}"/>
+ <copy todir="${dist.test.dir}">
+ <fileset dir="${test.dir}"/>
+ </copy>
+ </target>
+
+ <target name="copysource" depends="copytest" description="Copy sources to dist dir">
+ <mkdir dir="${dist.src.dir}"/>
+ <copy todir="${dist.src.dir}">
+ <fileset dir="${src.dir}">
+ <patternset refid="source.files"/>
+ </fileset>
+ <fileset dir="${src.dir}">
+ <patternset refid="support.files"/>
+ </fileset>
+ </copy>
+ <mkdir dir="${dist.src.dir}"/>
+ <copy todir="${dist.src.dir}">
+ <fileset dir="${src.dir}">
+ <patternset refid="source.files"/>
+ </fileset>
+ <fileset dir="${src.dir}">
+ <patternset refid="support.files"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="copylib" description="Copy jars to lib dir">
+ <mkdir dir="${dist.lib.dir}"/>
+ <copy todir="${dist.lib.dir}">
+ <fileset dir="${lib.dir}">
+ <include name="*.jar"/>
+ <exclude name="log4j.jar"/>
+ <exclude name="checkstyle*.jar"/>
+ <include name="*.txt"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="copydoc" description="Copy doc to dist dir" if="copy.doc">
+ <mkdir dir="${dist.doc.dir}"/>
+ <copy todir="${dist.doc.dir}">
+ <fileset dir="${doc.dir}">
+ <include name="**/*.html"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="jar" depends="compile" description="Build the distribution .jar file">
+ <mkdir dir="${dist.dir}"/>
+ <jar filesetmanifest="merge" jarfile="${jar.file.name}" basedir="${classes.dir}"/>
+ </target>
+
+ <target name="jartest" depends="compiletest" description="Build the distribution .jar file">
+ <mkdir dir="${dist.dir}"/>
+ <jar filesetmanifest="merge" jarfile="${jartest.file.name}" basedir="${testclasses.dir}"/>
+ </target>
+
+ <!-- DOCUMENTATION -->
+
+ <target name="javadoc" description="Compile the Javadoc API documentation to dist dir">
+ <mkdir dir="${dist.api.dir}"/>
+ <javadoc
+ packagenames="${javadoc.packagenames}"
+ classpathref="lib.class.path"
+ destdir="${dist.api.dir}"
+ use="true"
+ protected="true"
+ version="true"
+ windowtitle="${Name} API Documentation"
+ Overview="${doc.api.dir}/package.html"
+ doctitle="${Name} API Documentation"
+ stylesheetfile="${hibernate-core.doc.api}/jdstyle.css"
+ link="${javadoc}">
+ <packageset dir="${src.dir}" defaultexcludes="yes" >
+ <include name="**/*" />
+ </packageset>
+ </javadoc>
+
+
+ </target>
+
+
+ <target name="extras" description="Copies miscellaneous files to root dir">
+ <copy todir="${dist.dir}/bin" failonerror="false">
+ <fileset dir="bin">
+ <include name="*.bat"/>
+ </fileset>
+ </copy>
+ <copy file="readme.txt" todir="${dist.dir}"/>
+ <copy file="lgpl.txt" todir="${dist.dir}"/>
+ <copy file="changelog.txt" todir="${dist.dir}"/>
+ <copy file="build.xml" todir="${dist.dir}"/>
+ <replace file="${dist.dir}/build.xml">
+ <replacetoken><![CDATA[../${name}-${version}]]></replacetoken>
+ <replacevalue><![CDATA[../${name}]]></replacevalue>
+ </replace>
+ </target>
+
+ <target name="dist" depends="jar,javadoc,copysource,copylib,copydoc,extras" description="Build everything">
+ <zip zipfile = "${dist.dir}-${version}.zip">
+ <zipfileset prefix="${name}-${version}" dir="${dist.dir}"/>
+ </zip>
+ <tar compression="gzip" tarfile="${dist.dir}-${version}.tar.gz">
+ <tarfileset prefix="${name}-${version}" dir="${dist.dir}"/>
+ </tar>
+ </target>
+
+ <target name="info" description="Echoes useful system properties">
+ <echo message="java.vm.info=${java.vm.info}"/>
+ <echo message="java.vm.name=${java.vm.name}"/>
+ <echo message="java.vm.vendor=${java.vm.vendor}"/>
+ <echo message="java.vm.version=${java.vm.version}"/>
+ <echo message="os.arch=${os.arch}"/>
+ <echo message="os.name=${os.name}"/>
+ <echo message="os.version=${os.version}"/>
+ <echo message="java.home = ${java.home}"/>
+ <echo message="java.class.path = ${java.class.path}"/>
+ <echo message="build.compiler = ${build.compiler}"/>
+ <echo message="file.encoding=${file.encoding}"/>
+ <echo message="user.home = ${user.home}"/>
+ <echo message="user.language=${user.language}"/>
+ </target>
+
+ <target name="junit" depends="compiletest">
+ <mkdir dir="test_output"/>
+ <junit printsummary="yes" haltonfailure="yes" forkmode="once">
+ <classpath refid="junit.classpath"/>
+ <formatter type="plain"/>
+ <formatter type="xml"/>
+ <batchtest fork="yes" todir="test_output" haltonfailure="no">
+ <fileset refid="junit.batchtestset"/>
+ </batchtest>
+ </junit>
+ </target>
+
+ <!-- Run a single unit test. -->
+ <target name="junitsingle" depends="compiletest" description="Run a single test suite (requires testname and jdbc.driver properties)">
+ <mkdir dir="test_output"/>
+ <junit printsummary="yes" fork="yes" haltonfailure="yes">
+ <classpath refid="junit.classpath"/>
+ <formatter type="plain"/>
+ <formatter type="xml"/>
+ <test fork="yes" todir="test_output" haltonfailure="no" name="${testname}"/>
+ </junit>
+ </target>
+
+ <target name="junitinstrument" depends="compiletest,instrument"
+ description="Run the instrument test suite (requires driver.jar property)">
+ <mkdir dir="${instrumenttest.out.dir}"/>
+ <junit printsummary="yes" haltonfailure="yes" dir="${basedir}"
+ maxmemory="256M" fork="yes" forkmode="perBatch">
+ <classpath refid="junit.classpath"/>
+ <formatter type="plain"/>
+ <formatter type="xml"/>
+ <batchtest todir="${instrumenttest.out.dir}" haltonfailure="no">
+ <fileset dir="${classes.dir}">
+ <include name="org/hibernate/test/**/*Test.class"/>
+ </fileset>
+ </batchtest>
+ </junit>
+ </target>
+
+ <target name="junitreport" depends="">
+ <junitreport todir="./test_output">
+ <fileset dir="test_output">
+ <include name="TEST-*.xml"/>
+ </fileset>
+ <report format="frames" todir="./test_output"/>
+ </junitreport>
+ </target>
+
+ <target name="run" depends="compile" description="Run Hibernate Console">
+ <java classname="org.hibernate.console.Start" classpathref="lib.class.path" fork="true">
+ <classpath>
+ <path location="${build.dir}"/>
+ </classpath>
+ </java>
+ </target>
+
+
+ <target name="checkstyle" description="Check coding style">
+ <taskdef resource="checkstyletask.properties">
+ <classpath>
+ <path refid="lib.class.path"/>
+ <fileset dir="${common-build.basedir}/lib">
+ <include name="checkstyle*.jar"/>
+ </fileset>
+ </classpath>
+ </taskdef>
+
+ <checkstyle config="${common-build.basedir}/checkstyle_checks.xml">
+ <fileset dir="${src.dir}">
+ <include name="**/*.java"/>
+ </fileset>
+ <formatter type="plain"/>
+ </checkstyle>
+ </target>
+
+ <target name="patch" depends="checkstyle"
+ description="Create a patch">
+ <cvs command="-q diff -u -N" output="patch.txt"/>
+ </target>
+
+</project>
\ No newline at end of file
Modified: annotations/trunk/doc/reference/build.xml
===================================================================
--- annotations/trunk/doc/reference/build.xml 2007-08-16 01:04:34 UTC (rev 13923)
+++ annotations/trunk/doc/reference/build.xml 2007-08-16 04:34:59 UTC (rev 13924)
@@ -1,7 +1,7 @@
<project name="Documentation" default="all.doc" basedir=".">
<!-- Use the core Hibernate3 doc build system -->
- <import file="../../../common/common-build.xml"/>
+ <import file="../../common-build.xml"/>
<import file="${hibernate-cvs.doc.reference}/build.xml"/>
Modified: annotations/trunk/doc/reference/en/master.xml
===================================================================
--- annotations/trunk/doc/reference/en/master.xml 2007-08-16 01:04:34 UTC (rev 13923)
+++ annotations/trunk/doc/reference/en/master.xml 2007-08-16 04:34:59 UTC (rev 13924)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3CR3//EN"
-"../../../../../Hibernate3/doc/reference/support/docbook-dtd/docbookx.dtd" [
+"../../../../core/doc/reference/support/docbook-dtd/docbookx.dtd" [
<!ENTITY setup SYSTEM "modules/setup.xml">
<!ENTITY entity SYSTEM "modules/entity.xml">
<!ENTITY xml-overriding SYSTEM "modules/xml-overriding.xml">
Modified: annotations/trunk/doc/reference/en/styles/fopdf.xsl
===================================================================
--- annotations/trunk/doc/reference/en/styles/fopdf.xsl 2007-08-16 01:04:34 UTC (rev 13923)
+++ annotations/trunk/doc/reference/en/styles/fopdf.xsl 2007-08-16 04:34:59 UTC (rev 13924)
@@ -17,7 +17,7 @@
-->
<!DOCTYPE xsl:stylesheet [
- <!ENTITY db_xsl_path "../../../../../../Hibernate3/doc/reference/support/docbook-xsl/">
+ <!ENTITY db_xsl_path "../../../../../core/doc/reference/support/docbook-xsl/">
]>
<xsl:stylesheet
Modified: annotations/trunk/doc/reference/en/styles/html.xsl
===================================================================
--- annotations/trunk/doc/reference/en/styles/html.xsl 2007-08-16 01:04:34 UTC (rev 13923)
+++ annotations/trunk/doc/reference/en/styles/html.xsl 2007-08-16 04:34:59 UTC (rev 13924)
@@ -15,7 +15,7 @@
-->
<!DOCTYPE xsl:stylesheet [
- <!ENTITY db_xsl_path "../../../../../../Hibernate3/doc/reference/support/docbook-xsl/">
+ <!ENTITY db_xsl_path "../../../../../core/doc/reference/support/docbook-xsl/">
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
Modified: annotations/trunk/doc/reference/en/styles/html_chunk.xsl
===================================================================
--- annotations/trunk/doc/reference/en/styles/html_chunk.xsl 2007-08-16 01:04:34 UTC (rev 13923)
+++ annotations/trunk/doc/reference/en/styles/html_chunk.xsl 2007-08-16 04:34:59 UTC (rev 13924)
@@ -15,7 +15,7 @@
-->
<!DOCTYPE xsl:stylesheet [
- <!ENTITY db_xsl_path "../../../../../../Hibernate3/doc/reference/support/docbook-xsl/">
+ <!ENTITY db_xsl_path "../../../../../core/doc/reference/support/docbook-xsl/">
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
Modified: annotations/trunk/doc/reference/fr/master.xml
===================================================================
--- annotations/trunk/doc/reference/fr/master.xml 2007-08-16 01:04:34 UTC (rev 13923)
+++ annotations/trunk/doc/reference/fr/master.xml 2007-08-16 04:34:59 UTC (rev 13924)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3CR3//EN"
-"../../../../../Hibernate3/doc/reference/support/docbook-dtd/docbookx.dtd" [
+"../../../../core/doc/reference/support/docbook-dtd/docbookx.dtd" [
<!ENTITY setup SYSTEM "modules/setup.xml">
<!ENTITY entity SYSTEM "modules/entity.xml">
<!ENTITY xml-overriding SYSTEM "modules/xml-overriding.xml">
Modified: annotations/trunk/doc/reference/fr/styles/fopdf.xsl
===================================================================
--- annotations/trunk/doc/reference/fr/styles/fopdf.xsl 2007-08-16 01:04:34 UTC (rev 13923)
+++ annotations/trunk/doc/reference/fr/styles/fopdf.xsl 2007-08-16 04:34:59 UTC (rev 13924)
@@ -17,7 +17,7 @@
-->
<!DOCTYPE xsl:stylesheet [
- <!ENTITY db_xsl_path "../../../../../../Hibernate3/doc/reference/support/docbook-xsl/">
+ <!ENTITY db_xsl_path "../../../../../core/doc/reference/support/docbook-xsl/">
]>
<xsl:stylesheet
Modified: annotations/trunk/doc/reference/fr/styles/html.xsl
===================================================================
--- annotations/trunk/doc/reference/fr/styles/html.xsl 2007-08-16 01:04:34 UTC (rev 13923)
+++ annotations/trunk/doc/reference/fr/styles/html.xsl 2007-08-16 04:34:59 UTC (rev 13924)
@@ -15,7 +15,7 @@
-->
<!DOCTYPE xsl:stylesheet [
- <!ENTITY db_xsl_path "../../../../../../Hibernate3/doc/reference/support/docbook-xsl/">
+ <!ENTITY db_xsl_path "../../../../../core/doc/reference/support/docbook-xsl/">
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
Modified: annotations/trunk/doc/reference/fr/styles/html_chunk.xsl
===================================================================
--- annotations/trunk/doc/reference/fr/styles/html_chunk.xsl 2007-08-16 01:04:34 UTC (rev 13923)
+++ annotations/trunk/doc/reference/fr/styles/html_chunk.xsl 2007-08-16 04:34:59 UTC (rev 13924)
@@ -15,7 +15,7 @@
-->
<!DOCTYPE xsl:stylesheet [
- <!ENTITY db_xsl_path "../../../../../../Hibernate3/doc/reference/support/docbook-xsl/">
+ <!ENTITY db_xsl_path "../../../../../core/doc/reference/support/docbook-xsl/">
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
Modified: annotations/trunk/doc/reference/zh_cn/master.xml
===================================================================
--- annotations/trunk/doc/reference/zh_cn/master.xml 2007-08-16 01:04:34 UTC (rev 13923)
+++ annotations/trunk/doc/reference/zh_cn/master.xml 2007-08-16 04:34:59 UTC (rev 13924)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3CR3//EN"
-"../../../../../Hibernate3/doc/reference/support/docbook-dtd/docbookx.dtd" [
+"../../../../core/doc/reference/support/docbook-dtd/docbookx.dtd" [
<!ENTITY setup SYSTEM "modules/setup.xml">
<!ENTITY entity SYSTEM "modules/entity.xml">
<!ENTITY xml-overriding SYSTEM "modules/xml-overriding.xml">
Modified: annotations/trunk/doc/reference/zh_cn/styles/fopdf.xsl
===================================================================
--- annotations/trunk/doc/reference/zh_cn/styles/fopdf.xsl 2007-08-16 01:04:34 UTC (rev 13923)
+++ annotations/trunk/doc/reference/zh_cn/styles/fopdf.xsl 2007-08-16 04:34:59 UTC (rev 13924)
@@ -17,7 +17,7 @@
-->
<!DOCTYPE xsl:stylesheet [
- <!ENTITY db_xsl_path "../../../../../../Hibernate3/doc/reference/support/docbook-xsl/">
+ <!ENTITY db_xsl_path "../../../../../core/doc/reference/support/docbook-xsl/">
]>
<xsl:stylesheet
Modified: commons-annotations/trunk/build.xml
===================================================================
--- commons-annotations/trunk/build.xml 2007-08-16 01:04:34 UTC (rev 13923)
+++ commons-annotations/trunk/build.xml 2007-08-16 04:34:59 UTC (rev 13924)
@@ -14,7 +14,7 @@
<property name="copy.test" value="true"/>
<property name="javac.source" value="1.5"/>
<property name="javac.target" value="1.5"/>
- <property name="common.dir" value="${basedir}/../common"/>
+ <property name="common.dir" value="${basedir}"/>
<property name="hibernate-core.jar.available" value="true"/>
<!-- property name="jpa-api.jar" value="${basedir}/../jpa-api/build/ejb3-persistence.jar"/ -->
<property name="ivy.dep.dir" value="${basedir}/build/lib" />
Added: commons-annotations/trunk/common-build.xml
===================================================================
--- commons-annotations/trunk/common-build.xml (rev 0)
+++ commons-annotations/trunk/common-build.xml 2007-08-16 04:34:59 UTC (rev 13924)
@@ -0,0 +1,472 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="common-build" default="dist">
+ <description>Common properties and targets for the HibernateExt project</description>
+
+ <!-- my.basedir property can be used to refer to files/directories relatively to the common-build.xml file -->
+ <dirname property="common-build.basedir" file="${ant.file.common-build}"/>
+
+ <!-- Give user a chance to override without editing this file
+ (and without typing -D each time it compiles it) -->
+ <property file="${common-build.basedir}/build.properties"/>
+ <property file="${user.home}/.ant.properties"/>
+
+ <property name="src.dir" location="src/java"/>
+ <property name="test.dir" location="src/test"/>
+ <property name="lib.dir" location="lib"/>
+ <property name="build.dir" location="build"/>
+ <property name="classes.dir" location="${build.dir}/classes"/>
+ <property name="testclasses.dir" location="${build.dir}/testclasses"/>
+ <property name="dist.target.dir" location="target"/>
+ <property name="dist.dir" location="${dist.target.dir}/${name}"/>
+ <property name="instrumenttest.out.dir" value="instrumenttestout"/>
+ <property name="doc.dir" location="doc"/>
+ <property name="doc.api.dir" location="${doc.dir}/api"/>
+ <property name="doc.reference.dir" location="${doc.dir}/reference"/>
+
+ <property name="dist.doc.dir" location="${dist.dir}/doc"/>
+ <property name="dist.api.dir" location="${dist.dir}/doc/api"/>
+
+ <property name="dist.src.dir" location="${dist.dir}/src"/>
+ <property name="dist.test.dir" location="${dist.dir}/test"/>
+ <property name="dist.lib.dir" location="${dist.dir}/lib"/>
+ <property name="jar.name" value="${name}"/>
+ <property name="jar.file.name" value="${dist.dir}/${jar.name}.jar"/>
+ <property name="jartest.file.name" value="${dist.dir}/${jar.name}-tests.jar"/>
+
+ <property name="javadoc" value="http://java.sun.com/j2se/1.4/docs/api"/>
+ <property name="javac.debug" value="on"/>
+ <property name="javac.optimize" value="off"/>
+ <property name="javac.source" value="1.4"/>
+ <property name="javac.target" value="1.4"/>
+
+
+ <!-- set Hibernate core related properties -->
+ <property name="hibernate-core.home" location="${common-build.basedir}/../hibernate-3.2"/>
+ <property name="hibernate-core.jar" location="${hibernate-core.home}/hibernate3.jar"/>
+ <property name="hibernate-core.lib.dir" location="${hibernate-core.home}/lib"/>
+ <property name="hibernate-core.jdbc.dir" location="${hibernate-core.home}/lib"/> <!-- for some reason jdbc.dir is renamed to lib instead of jdbc when doing a dist of hibernate3 -->
+ <property name="hibernate-core.doc.api" location="${hibernate-core.home}/doc/api"/>
+ <property name="hibernate-cvs.doc.reference" location="${common-build.basedir}/../core/doc/reference"/>
+
+ <!--
+ Explicitly define tasks from ant..
+ Unfortunately, checkstyle-a<path id="lib.class.path">
+ <path location="${hibernate-core.jar}"></path>
+ <fileset dir="${hibernate-core.lib.dir}">
+ <include name="*.jar"/>
+ </fileset>
+ <fileset dir="${lib.dir}">
+ <include name="*.jar"/>
+ </fileset>
+ <pathelement path="${clover.jar}"/>
+ </path>ll.jar contains it's own version of ANTLR, so ANTLR cannot be in the classpath.
+ -->
+ <!-- Emmanuel: Removed antlr, shouldn't be useful in Ext package...
+ taskdef name="antlr" classname="org.apache.tools.ant.taskdefs.optional.ANTLR">
+ <classpath>
+ <pathelement location="${hibernate-core.lib.dir}/antlr-2.7.2.jar"/>
+ <pathelement location="${hibernate-core.lib.dir}/ant-antlr-1.6.1.jar"/>
+ </classpath>
+ </taskdef -->
+
+ <taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
+ <classpath>
+ <fileset dir="${hibernate-core.lib.dir}">
+ <include name="junit-*.jar"/>
+ <include name="ant-junit-*.jar"/>
+ </fileset>
+ </classpath>
+ </taskdef>
+
+ <taskdef name="junitreport" classname="org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator">
+ <classpath>
+ <fileset dir="${hibernate-core.lib.dir}">
+ <include name="junit-*.jar"/>
+ <include name="ant-junit-*.jar"/>
+ </fileset>
+ </classpath>
+ </taskdef>
+
+ <path id="lib.class.path">
+ <path location="${hibernate-core.jar}"></path>
+ <fileset dir="${hibernate-core.lib.dir}">
+ <include name="*.jar"/>
+ </fileset>
+ <fileset dir="${lib.dir}">
+ <include name="*.jar"/>
+ </fileset>
+ <path refid="lib.moduleclass.path"/>
+ <pathelement path="${clover.jar}"/>
+ </path>
+
+ <!-- overridable in modules -->
+ <path id="lib.moduleclass.path"/>
+
+ <patternset id="support.files">
+ <include name="**/*.jpg"/>
+ <include name="**/*.gif"/>
+ <include name="**/*.dtd"/>
+ <include name="**/*.xsd"/>
+ <include name="**/*.xml"/>
+ <include name="**/*.xslt"/>
+
+ <!-- exclude everything we don't want in the jar -->
+ <exclude name="${build.dir}/**/*"/>
+ <exclude name="${doc.dir}/**/*"/>
+ <exclude name="classes/**/*"/>
+ <exclude name="build.xml"/>
+ <exclude name="**/*.properties"/>
+ <exclude name="**/*.ccf"/>
+ <exclude name="**/*.cfg.xml"/>
+ <exclude name="**/ehcache.xml"/>
+ </patternset>
+
+ <patternset id="source.files">
+ <include name="**/*.java"/>
+ <include name="**/*.properties"/>
+ </patternset>
+
+ <!-- junit paths/filesets -->
+ <fileset dir="${testclasses.dir}" id="junit.batchtestset">
+ <include name="**/*Test.class"/>
+ </fileset>
+
+ <path id="testsrc.path">
+ <pathelement location="${test.dir}"/>
+ </path>
+
+ <!-- Clover -->
+ <property name="clover.out.dir" value="cloverout"/>
+ <property name="clover.jar" value="${ant.home}/lib/clover.jar"/>
+ <taskdef resource="clovertasks"/>
+
+ <path id="junit.classpath">
+ <fileset dir="${lib.dir}">
+ <include name="*.jar"/>
+ </fileset>
+ <pathelement path="${classes.dir}"/>
+ <pathelement path="${testclasses.dir}"/>
+ <path refid="lib.class.path"/>
+ <path refid="junit.moduleclasspath"/>
+ <path location="${clover.jar}"/>
+ </path>
+
+ <!-- Clover tasks -->
+ <target name="with.clover">
+ <clover-setup initString="clover_coverage.db"/>
+ </target>
+
+ <target name="cloverreport.html" depends="with.clover"
+ description="Generate a clover report from the current clover database.">
+ <clover-report>
+ <current outfile="${clover.out.dir}">
+ <format type="html"/>
+ </current>
+ </clover-report>
+ </target>
+
+ <target name="cloverreport" depends="with.clover,junitreport,cloverreport.html"
+ description="Run the tests and generate a clover report">
+ </target>
+
+ <!-- Tasks -->
+
+ <target name="clean" description="Cleans up build and dist directories">
+ <delete dir="${build.dir}"/>
+ <delete dir="${dist.target.dir}"/>
+ <delete dir="${clover.out.dir}"/>
+ </target>
+
+ <target name="init" description="Initialize the build">
+ <tstamp>
+ <format property="subversion" pattern="yyyy-MM-dd hh:mm:ss"/>
+ </tstamp>
+ <echo message="Build ${Name}-${version} (${subversion})"/>
+ <mkdir dir="${classes.dir}"/>
+ <mkdir dir="${testclasses.dir}"/>
+ <copy todir="${classes.dir}">
+ <fileset dir="${src.dir}">
+ <patternset refid="support.files"/>
+ </fileset>
+ </copy>
+
+ <copy todir="${build.dir}">
+ <fileset dir=".">
+ <include name="readme.txt"/>
+ <include name="lgpl.txt"/>
+ </fileset>
+ </copy>
+
+ <available file="${hibernate-core.jar}" type="file" property="hibernate-core.jar.available"/>
+ <fail unless="hibernate-core.jar.available" message="Cannot locate hibernate-core.jar: ${hibernate-core.jar}"/>
+ </target>
+
+ <target name="compile" depends="init" description="Compile the Java source code">
+ <available
+ classname="org.eclipse.core.launcher.Main"
+ property="build.compiler"
+ value="org.eclipse.jdt.core.JDTCompilerAdapter"
+ classpath="${java.class.path}"/>
+ <javac
+ target="${javac.target}"
+ source="${javac.source}"
+ srcdir="${src.dir}"
+ destdir="${classes.dir}"
+ classpathref="lib.class.path"
+ debug="${javac.debug}"
+ optimize="${javac.optimize}"
+ nowarn="on">
+ </javac>
+ </target>
+
+ <target name="compiletest" depends="compile" description="Compile the tests">
+ <available
+ classname="org.eclipse.core.launcher.Main"
+ property="build.compiler"
+ value="org.eclipse.jdt.core.JDTCompilerAdapter"
+ classpath="${java.class.path}"/>
+ <javac
+ target="${javac.target}"
+ source="${javac.source}"
+ destdir="${testclasses.dir}"
+ classpathref="junit.classpath"
+ debug="${javac.debug}"
+ optimize="${javac.optimize}"
+ nowarn="on">
+ <src refid="testsrc.path"/>
+ </javac>
+ </target>
+
+ <target name="instrument" depends="compiletest"
+ description="Instrument the persistent classes"> <!-- depends="jar" -->
+
+ <taskdef name="instrument" classname="org.hibernate.tool.instrument.InstrumentTask">
+ <classpath path="${classes.dir}"/>
+ <classpath path="${testclasses.dir}"/>
+ <classpath refid="lib.class.path"/>
+ </taskdef>
+
+ <instrument verbose="true">
+ <fileset dir="${testclasses.dir}/org/hibernate/test">
+ <include name="**/*.class"/>
+ <exclude name="**/*Test$*.class"/>
+ <exclude name="**/*Test.class"/>
+ <exclude name="**/*Tests.class"/>
+ </fileset>
+ </instrument>
+
+ <!-- jar jarfile="${build.dir}/instrumented-classes.jar">
+ <fileset dir="${testclasses.dir}">
+ <include name="org/hibernate/test/**/*.class"/>
+ <exclude name="org/hibernate/test/**/*Test.class"/>
+ </fileset>
+ </jar -->
+
+ </target>
+
+ <target name="copytest" description="Copy tests to dist dir" if="copy.test" >
+ <mkdir dir="${dist.test.dir}"/>
+ <copy todir="${dist.test.dir}">
+ <fileset dir="${test.dir}"/>
+ </copy>
+ </target>
+
+ <target name="copysource" depends="copytest" description="Copy sources to dist dir">
+ <mkdir dir="${dist.src.dir}"/>
+ <copy todir="${dist.src.dir}">
+ <fileset dir="${src.dir}">
+ <patternset refid="source.files"/>
+ </fileset>
+ <fileset dir="${src.dir}">
+ <patternset refid="support.files"/>
+ </fileset>
+ </copy>
+ <mkdir dir="${dist.src.dir}"/>
+ <copy todir="${dist.src.dir}">
+ <fileset dir="${src.dir}">
+ <patternset refid="source.files"/>
+ </fileset>
+ <fileset dir="${src.dir}">
+ <patternset refid="support.files"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="copylib" description="Copy jars to lib dir">
+ <mkdir dir="${dist.lib.dir}"/>
+ <copy todir="${dist.lib.dir}">
+ <fileset dir="${lib.dir}">
+ <include name="*.jar"/>
+ <exclude name="log4j.jar"/>
+ <exclude name="checkstyle*.jar"/>
+ <include name="*.txt"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="copydoc" description="Copy doc to dist dir" if="copy.doc">
+ <mkdir dir="${dist.doc.dir}"/>
+ <copy todir="${dist.doc.dir}">
+ <fileset dir="${doc.dir}">
+ <include name="**/*.html"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="jar" depends="compile" description="Build the distribution .jar file">
+ <mkdir dir="${dist.dir}"/>
+ <jar filesetmanifest="merge" jarfile="${jar.file.name}" basedir="${classes.dir}"/>
+ </target>
+
+ <target name="jartest" depends="compiletest" description="Build the distribution .jar file">
+ <mkdir dir="${dist.dir}"/>
+ <jar filesetmanifest="merge" jarfile="${jartest.file.name}" basedir="${testclasses.dir}"/>
+ </target>
+
+ <!-- DOCUMENTATION -->
+
+ <target name="javadoc" description="Compile the Javadoc API documentation to dist dir">
+ <mkdir dir="${dist.api.dir}"/>
+ <javadoc
+ packagenames="${javadoc.packagenames}"
+ classpathref="lib.class.path"
+ destdir="${dist.api.dir}"
+ use="true"
+ protected="true"
+ version="true"
+ windowtitle="${Name} API Documentation"
+ Overview="${doc.api.dir}/package.html"
+ doctitle="${Name} API Documentation"
+ stylesheetfile="${hibernate-core.doc.api}/jdstyle.css"
+ link="${javadoc}">
+ <packageset dir="${src.dir}" defaultexcludes="yes" >
+ <include name="**/*" />
+ </packageset>
+ </javadoc>
+
+
+ </target>
+
+
+ <target name="extras" description="Copies miscellaneous files to root dir">
+ <copy todir="${dist.dir}/bin" failonerror="false">
+ <fileset dir="bin">
+ <include name="*.bat"/>
+ </fileset>
+ </copy>
+ <copy file="readme.txt" todir="${dist.dir}"/>
+ <copy file="lgpl.txt" todir="${dist.dir}"/>
+ <copy file="changelog.txt" todir="${dist.dir}"/>
+ <copy file="build.xml" todir="${dist.dir}"/>
+ <replace file="${dist.dir}/build.xml">
+ <replacetoken><![CDATA[../${name}-${version}]]></replacetoken>
+ <replacevalue><![CDATA[../${name}]]></replacevalue>
+ </replace>
+ </target>
+
+ <target name="dist" depends="jar,javadoc,copysource,copylib,copydoc,extras" description="Build everything">
+ <zip zipfile = "${dist.dir}-${version}.zip">
+ <zipfileset prefix="${name}-${version}" dir="${dist.dir}"/>
+ </zip>
+ <tar compression="gzip" tarfile="${dist.dir}-${version}.tar.gz">
+ <tarfileset prefix="${name}-${version}" dir="${dist.dir}"/>
+ </tar>
+ </target>
+
+ <target name="info" description="Echoes useful system properties">
+ <echo message="java.vm.info=${java.vm.info}"/>
+ <echo message="java.vm.name=${java.vm.name}"/>
+ <echo message="java.vm.vendor=${java.vm.vendor}"/>
+ <echo message="java.vm.version=${java.vm.version}"/>
+ <echo message="os.arch=${os.arch}"/>
+ <echo message="os.name=${os.name}"/>
+ <echo message="os.version=${os.version}"/>
+ <echo message="java.home = ${java.home}"/>
+ <echo message="java.class.path = ${java.class.path}"/>
+ <echo message="build.compiler = ${build.compiler}"/>
+ <echo message="file.encoding=${file.encoding}"/>
+ <echo message="user.home = ${user.home}"/>
+ <echo message="user.language=${user.language}"/>
+ </target>
+
+ <target name="junit" depends="compiletest">
+ <mkdir dir="test_output"/>
+ <junit printsummary="yes" haltonfailure="yes" forkmode="once">
+ <classpath refid="junit.classpath"/>
+ <formatter type="plain"/>
+ <formatter type="xml"/>
+ <batchtest fork="yes" todir="test_output" haltonfailure="no">
+ <fileset refid="junit.batchtestset"/>
+ </batchtest>
+ </junit>
+ </target>
+
+ <!-- Run a single unit test. -->
+ <target name="junitsingle" depends="compiletest" description="Run a single test suite (requires testname and jdbc.driver properties)">
+ <mkdir dir="test_output"/>
+ <junit printsummary="yes" fork="yes" haltonfailure="yes">
+ <classpath refid="junit.classpath"/>
+ <formatter type="plain"/>
+ <formatter type="xml"/>
+ <test fork="yes" todir="test_output" haltonfailure="no" name="${testname}"/>
+ </junit>
+ </target>
+
+ <target name="junitinstrument" depends="compiletest,instrument"
+ description="Run the instrument test suite (requires driver.jar property)">
+ <mkdir dir="${instrumenttest.out.dir}"/>
+ <junit printsummary="yes" haltonfailure="yes" dir="${basedir}"
+ maxmemory="256M" fork="yes" forkmode="perBatch">
+ <classpath refid="junit.classpath"/>
+ <formatter type="plain"/>
+ <formatter type="xml"/>
+ <batchtest todir="${instrumenttest.out.dir}" haltonfailure="no">
+ <fileset dir="${classes.dir}">
+ <include name="org/hibernate/test/**/*Test.class"/>
+ </fileset>
+ </batchtest>
+ </junit>
+ </target>
+
+ <target name="junitreport" depends="">
+ <junitreport todir="./test_output">
+ <fileset dir="test_output">
+ <include name="TEST-*.xml"/>
+ </fileset>
+ <report format="frames" todir="./test_output"/>
+ </junitreport>
+ </target>
+
+ <target name="run" depends="compile" description="Run Hibernate Console">
+ <java classname="org.hibernate.console.Start" classpathref="lib.class.path" fork="true">
+ <classpath>
+ <path location="${build.dir}"/>
+ </classpath>
+ </java>
+ </target>
+
+
+ <target name="checkstyle" description="Check coding style">
+ <taskdef resource="checkstyletask.properties">
+ <classpath>
+ <path refid="lib.class.path"/>
+ <fileset dir="${common-build.basedir}/lib">
+ <include name="checkstyle*.jar"/>
+ </fileset>
+ </classpath>
+ </taskdef>
+
+ <checkstyle config="${common-build.basedir}/checkstyle_checks.xml">
+ <fileset dir="${src.dir}">
+ <include name="**/*.java"/>
+ </fileset>
+ <formatter type="plain"/>
+ </checkstyle>
+ </target>
+
+ <target name="patch" depends="checkstyle"
+ description="Create a patch">
+ <cvs command="-q diff -u -N" output="patch.txt"/>
+ </target>
+
+</project>
\ No newline at end of file
Modified: entitymanager/trunk/build.xml
===================================================================
--- entitymanager/trunk/build.xml 2007-08-16 01:04:34 UTC (rev 13923)
+++ entitymanager/trunk/build.xml 2007-08-16 04:34:59 UTC (rev 13924)
@@ -23,7 +23,7 @@
<property name="copy.test" value="true"/>
<property name="javac.source" value="1.5"/>
<property name="javac.target" value="1.5"/>
- <property name="common.dir" value="../common"/>
+ <property name="common.dir" value="${basedir}"/>
<available property="jpa-present" file="${basedir}/../jpa-api" type="dir"/>
<!-- property name="jpa-api.jar" value="${basedir}/../jpa-api/build/ejb3-persistence.jar"/>
Added: entitymanager/trunk/common-build.xml
===================================================================
--- entitymanager/trunk/common-build.xml (rev 0)
+++ entitymanager/trunk/common-build.xml 2007-08-16 04:34:59 UTC (rev 13924)
@@ -0,0 +1,472 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="common-build" default="dist">
+ <description>Common properties and targets for the HibernateExt project</description>
+
+ <!-- my.basedir property can be used to refer to files/directories relatively to the common-build.xml file -->
+ <dirname property="common-build.basedir" file="${ant.file.common-build}"/>
+
+ <!-- Give user a chance to override without editing this file
+ (and without typing -D each time it compiles it) -->
+ <property file="${common-build.basedir}/build.properties"/>
+ <property file="${user.home}/.ant.properties"/>
+
+ <property name="src.dir" location="src/java"/>
+ <property name="test.dir" location="src/test"/>
+ <property name="lib.dir" location="lib"/>
+ <property name="build.dir" location="build"/>
+ <property name="classes.dir" location="${build.dir}/classes"/>
+ <property name="testclasses.dir" location="${build.dir}/testclasses"/>
+ <property name="dist.target.dir" location="target"/>
+ <property name="dist.dir" location="${dist.target.dir}/${name}"/>
+ <property name="instrumenttest.out.dir" value="instrumenttestout"/>
+ <property name="doc.dir" location="doc"/>
+ <property name="doc.api.dir" location="${doc.dir}/api"/>
+ <property name="doc.reference.dir" location="${doc.dir}/reference"/>
+
+ <property name="dist.doc.dir" location="${dist.dir}/doc"/>
+ <property name="dist.api.dir" location="${dist.dir}/doc/api"/>
+
+ <property name="dist.src.dir" location="${dist.dir}/src"/>
+ <property name="dist.test.dir" location="${dist.dir}/test"/>
+ <property name="dist.lib.dir" location="${dist.dir}/lib"/>
+ <property name="jar.name" value="${name}"/>
+ <property name="jar.file.name" value="${dist.dir}/${jar.name}.jar"/>
+ <property name="jartest.file.name" value="${dist.dir}/${jar.name}-tests.jar"/>
+
+ <property name="javadoc" value="http://java.sun.com/j2se/1.4/docs/api"/>
+ <property name="javac.debug" value="on"/>
+ <property name="javac.optimize" value="off"/>
+ <property name="javac.source" value="1.4"/>
+ <property name="javac.target" value="1.4"/>
+
+
+ <!-- set Hibernate core related properties -->
+ <property name="hibernate-core.home" location="${common-build.basedir}/../hibernate-3.2"/>
+ <property name="hibernate-core.jar" location="${hibernate-core.home}/hibernate3.jar"/>
+ <property name="hibernate-core.lib.dir" location="${hibernate-core.home}/lib"/>
+ <property name="hibernate-core.jdbc.dir" location="${hibernate-core.home}/lib"/> <!-- for some reason jdbc.dir is renamed to lib instead of jdbc when doing a dist of hibernate3 -->
+ <property name="hibernate-core.doc.api" location="${hibernate-core.home}/doc/api"/>
+ <property name="hibernate-cvs.doc.reference" location="${common-build.basedir}/../core/doc/reference"/>
+
+ <!--
+ Explicitly define tasks from ant..
+ Unfortunately, checkstyle-a<path id="lib.class.path">
+ <path location="${hibernate-core.jar}"></path>
+ <fileset dir="${hibernate-core.lib.dir}">
+ <include name="*.jar"/>
+ </fileset>
+ <fileset dir="${lib.dir}">
+ <include name="*.jar"/>
+ </fileset>
+ <pathelement path="${clover.jar}"/>
+ </path>ll.jar contains it's own version of ANTLR, so ANTLR cannot be in the classpath.
+ -->
+ <!-- Emmanuel: Removed antlr, shouldn't be useful in Ext package...
+ taskdef name="antlr" classname="org.apache.tools.ant.taskdefs.optional.ANTLR">
+ <classpath>
+ <pathelement location="${hibernate-core.lib.dir}/antlr-2.7.2.jar"/>
+ <pathelement location="${hibernate-core.lib.dir}/ant-antlr-1.6.1.jar"/>
+ </classpath>
+ </taskdef -->
+
+ <taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
+ <classpath>
+ <fileset dir="${hibernate-core.lib.dir}">
+ <include name="junit-*.jar"/>
+ <include name="ant-junit-*.jar"/>
+ </fileset>
+ </classpath>
+ </taskdef>
+
+ <taskdef name="junitreport" classname="org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator">
+ <classpath>
+ <fileset dir="${hibernate-core.lib.dir}">
+ <include name="junit-*.jar"/>
+ <include name="ant-junit-*.jar"/>
+ </fileset>
+ </classpath>
+ </taskdef>
+
+ <path id="lib.class.path">
+ <path location="${hibernate-core.jar}"></path>
+ <fileset dir="${hibernate-core.lib.dir}">
+ <include name="*.jar"/>
+ </fileset>
+ <fileset dir="${lib.dir}">
+ <include name="*.jar"/>
+ </fileset>
+ <path refid="lib.moduleclass.path"/>
+ <pathelement path="${clover.jar}"/>
+ </path>
+
+ <!-- overridable in modules -->
+ <path id="lib.moduleclass.path"/>
+
+ <patternset id="support.files">
+ <include name="**/*.jpg"/>
+ <include name="**/*.gif"/>
+ <include name="**/*.dtd"/>
+ <include name="**/*.xsd"/>
+ <include name="**/*.xml"/>
+ <include name="**/*.xslt"/>
+
+ <!-- exclude everything we don't want in the jar -->
+ <exclude name="${build.dir}/**/*"/>
+ <exclude name="${doc.dir}/**/*"/>
+ <exclude name="classes/**/*"/>
+ <exclude name="build.xml"/>
+ <exclude name="**/*.properties"/>
+ <exclude name="**/*.ccf"/>
+ <exclude name="**/*.cfg.xml"/>
+ <exclude name="**/ehcache.xml"/>
+ </patternset>
+
+ <patternset id="source.files">
+ <include name="**/*.java"/>
+ <include name="**/*.properties"/>
+ </patternset>
+
+ <!-- junit paths/filesets -->
+ <fileset dir="${testclasses.dir}" id="junit.batchtestset">
+ <include name="**/*Test.class"/>
+ </fileset>
+
+ <path id="testsrc.path">
+ <pathelement location="${test.dir}"/>
+ </path>
+
+ <!-- Clover -->
+ <property name="clover.out.dir" value="cloverout"/>
+ <property name="clover.jar" value="${ant.home}/lib/clover.jar"/>
+ <taskdef resource="clovertasks"/>
+
+ <path id="junit.classpath">
+ <fileset dir="${lib.dir}">
+ <include name="*.jar"/>
+ </fileset>
+ <pathelement path="${classes.dir}"/>
+ <pathelement path="${testclasses.dir}"/>
+ <path refid="lib.class.path"/>
+ <path refid="junit.moduleclasspath"/>
+ <path location="${clover.jar}"/>
+ </path>
+
+ <!-- Clover tasks -->
+ <target name="with.clover">
+ <clover-setup initString="clover_coverage.db"/>
+ </target>
+
+ <target name="cloverreport.html" depends="with.clover"
+ description="Generate a clover report from the current clover database.">
+ <clover-report>
+ <current outfile="${clover.out.dir}">
+ <format type="html"/>
+ </current>
+ </clover-report>
+ </target>
+
+ <target name="cloverreport" depends="with.clover,junitreport,cloverreport.html"
+ description="Run the tests and generate a clover report">
+ </target>
+
+ <!-- Tasks -->
+
+ <target name="clean" description="Cleans up build and dist directories">
+ <delete dir="${build.dir}"/>
+ <delete dir="${dist.target.dir}"/>
+ <delete dir="${clover.out.dir}"/>
+ </target>
+
+ <target name="init" description="Initialize the build">
+ <tstamp>
+ <format property="subversion" pattern="yyyy-MM-dd hh:mm:ss"/>
+ </tstamp>
+ <echo message="Build ${Name}-${version} (${subversion})"/>
+ <mkdir dir="${classes.dir}"/>
+ <mkdir dir="${testclasses.dir}"/>
+ <copy todir="${classes.dir}">
+ <fileset dir="${src.dir}">
+ <patternset refid="support.files"/>
+ </fileset>
+ </copy>
+
+ <copy todir="${build.dir}">
+ <fileset dir=".">
+ <include name="readme.txt"/>
+ <include name="lgpl.txt"/>
+ </fileset>
+ </copy>
+
+ <available file="${hibernate-core.jar}" type="file" property="hibernate-core.jar.available"/>
+ <fail unless="hibernate-core.jar.available" message="Cannot locate hibernate-core.jar: ${hibernate-core.jar}"/>
+ </target>
+
+ <target name="compile" depends="init" description="Compile the Java source code">
+ <available
+ classname="org.eclipse.core.launcher.Main"
+ property="build.compiler"
+ value="org.eclipse.jdt.core.JDTCompilerAdapter"
+ classpath="${java.class.path}"/>
+ <javac
+ target="${javac.target}"
+ source="${javac.source}"
+ srcdir="${src.dir}"
+ destdir="${classes.dir}"
+ classpathref="lib.class.path"
+ debug="${javac.debug}"
+ optimize="${javac.optimize}"
+ nowarn="on">
+ </javac>
+ </target>
+
+ <target name="compiletest" depends="compile" description="Compile the tests">
+ <available
+ classname="org.eclipse.core.launcher.Main"
+ property="build.compiler"
+ value="org.eclipse.jdt.core.JDTCompilerAdapter"
+ classpath="${java.class.path}"/>
+ <javac
+ target="${javac.target}"
+ source="${javac.source}"
+ destdir="${testclasses.dir}"
+ classpathref="junit.classpath"
+ debug="${javac.debug}"
+ optimize="${javac.optimize}"
+ nowarn="on">
+ <src refid="testsrc.path"/>
+ </javac>
+ </target>
+
+ <target name="instrument" depends="compiletest"
+ description="Instrument the persistent classes"> <!-- depends="jar" -->
+
+ <taskdef name="instrument" classname="org.hibernate.tool.instrument.InstrumentTask">
+ <classpath path="${classes.dir}"/>
+ <classpath path="${testclasses.dir}"/>
+ <classpath refid="lib.class.path"/>
+ </taskdef>
+
+ <instrument verbose="true">
+ <fileset dir="${testclasses.dir}/org/hibernate/test">
+ <include name="**/*.class"/>
+ <exclude name="**/*Test$*.class"/>
+ <exclude name="**/*Test.class"/>
+ <exclude name="**/*Tests.class"/>
+ </fileset>
+ </instrument>
+
+ <!-- jar jarfile="${build.dir}/instrumented-classes.jar">
+ <fileset dir="${testclasses.dir}">
+ <include name="org/hibernate/test/**/*.class"/>
+ <exclude name="org/hibernate/test/**/*Test.class"/>
+ </fileset>
+ </jar -->
+
+ </target>
+
+ <target name="copytest" description="Copy tests to dist dir" if="copy.test" >
+ <mkdir dir="${dist.test.dir}"/>
+ <copy todir="${dist.test.dir}">
+ <fileset dir="${test.dir}"/>
+ </copy>
+ </target>
+
+ <target name="copysource" depends="copytest" description="Copy sources to dist dir">
+ <mkdir dir="${dist.src.dir}"/>
+ <copy todir="${dist.src.dir}">
+ <fileset dir="${src.dir}">
+ <patternset refid="source.files"/>
+ </fileset>
+ <fileset dir="${src.dir}">
+ <patternset refid="support.files"/>
+ </fileset>
+ </copy>
+ <mkdir dir="${dist.src.dir}"/>
+ <copy todir="${dist.src.dir}">
+ <fileset dir="${src.dir}">
+ <patternset refid="source.files"/>
+ </fileset>
+ <fileset dir="${src.dir}">
+ <patternset refid="support.files"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="copylib" description="Copy jars to lib dir">
+ <mkdir dir="${dist.lib.dir}"/>
+ <copy todir="${dist.lib.dir}">
+ <fileset dir="${lib.dir}">
+ <include name="*.jar"/>
+ <exclude name="log4j.jar"/>
+ <exclude name="checkstyle*.jar"/>
+ <include name="*.txt"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="copydoc" description="Copy doc to dist dir" if="copy.doc">
+ <mkdir dir="${dist.doc.dir}"/>
+ <copy todir="${dist.doc.dir}">
+ <fileset dir="${doc.dir}">
+ <include name="**/*.html"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="jar" depends="compile" description="Build the distribution .jar file">
+ <mkdir dir="${dist.dir}"/>
+ <jar filesetmanifest="merge" jarfile="${jar.file.name}" basedir="${classes.dir}"/>
+ </target>
+
+ <target name="jartest" depends="compiletest" description="Build the distribution .jar file">
+ <mkdir dir="${dist.dir}"/>
+ <jar filesetmanifest="merge" jarfile="${jartest.file.name}" basedir="${testclasses.dir}"/>
+ </target>
+
+ <!-- DOCUMENTATION -->
+
+ <target name="javadoc" description="Compile the Javadoc API documentation to dist dir">
+ <mkdir dir="${dist.api.dir}"/>
+ <javadoc
+ packagenames="${javadoc.packagenames}"
+ classpathref="lib.class.path"
+ destdir="${dist.api.dir}"
+ use="true"
+ protected="true"
+ version="true"
+ windowtitle="${Name} API Documentation"
+ Overview="${doc.api.dir}/package.html"
+ doctitle="${Name} API Documentation"
+ stylesheetfile="${hibernate-core.doc.api}/jdstyle.css"
+ link="${javadoc}">
+ <packageset dir="${src.dir}" defaultexcludes="yes" >
+ <include name="**/*" />
+ </packageset>
+ </javadoc>
+
+
+ </target>
+
+
+ <target name="extras" description="Copies miscellaneous files to root dir">
+ <copy todir="${dist.dir}/bin" failonerror="false">
+ <fileset dir="bin">
+ <include name="*.bat"/>
+ </fileset>
+ </copy>
+ <copy file="readme.txt" todir="${dist.dir}"/>
+ <copy file="lgpl.txt" todir="${dist.dir}"/>
+ <copy file="changelog.txt" todir="${dist.dir}"/>
+ <copy file="build.xml" todir="${dist.dir}"/>
+ <replace file="${dist.dir}/build.xml">
+ <replacetoken><![CDATA[../${name}-${version}]]></replacetoken>
+ <replacevalue><![CDATA[../${name}]]></replacevalue>
+ </replace>
+ </target>
+
+ <target name="dist" depends="jar,javadoc,copysource,copylib,copydoc,extras" description="Build everything">
+ <zip zipfile = "${dist.dir}-${version}.zip">
+ <zipfileset prefix="${name}-${version}" dir="${dist.dir}"/>
+ </zip>
+ <tar compression="gzip" tarfile="${dist.dir}-${version}.tar.gz">
+ <tarfileset prefix="${name}-${version}" dir="${dist.dir}"/>
+ </tar>
+ </target>
+
+ <target name="info" description="Echoes useful system properties">
+ <echo message="java.vm.info=${java.vm.info}"/>
+ <echo message="java.vm.name=${java.vm.name}"/>
+ <echo message="java.vm.vendor=${java.vm.vendor}"/>
+ <echo message="java.vm.version=${java.vm.version}"/>
+ <echo message="os.arch=${os.arch}"/>
+ <echo message="os.name=${os.name}"/>
+ <echo message="os.version=${os.version}"/>
+ <echo message="java.home = ${java.home}"/>
+ <echo message="java.class.path = ${java.class.path}"/>
+ <echo message="build.compiler = ${build.compiler}"/>
+ <echo message="file.encoding=${file.encoding}"/>
+ <echo message="user.home = ${user.home}"/>
+ <echo message="user.language=${user.language}"/>
+ </target>
+
+ <target name="junit" depends="compiletest">
+ <mkdir dir="test_output"/>
+ <junit printsummary="yes" haltonfailure="yes" forkmode="once">
+ <classpath refid="junit.classpath"/>
+ <formatter type="plain"/>
+ <formatter type="xml"/>
+ <batchtest fork="yes" todir="test_output" haltonfailure="no">
+ <fileset refid="junit.batchtestset"/>
+ </batchtest>
+ </junit>
+ </target>
+
+ <!-- Run a single unit test. -->
+ <target name="junitsingle" depends="compiletest" description="Run a single test suite (requires testname and jdbc.driver properties)">
+ <mkdir dir="test_output"/>
+ <junit printsummary="yes" fork="yes" haltonfailure="yes">
+ <classpath refid="junit.classpath"/>
+ <formatter type="plain"/>
+ <formatter type="xml"/>
+ <test fork="yes" todir="test_output" haltonfailure="no" name="${testname}"/>
+ </junit>
+ </target>
+
+ <target name="junitinstrument" depends="compiletest,instrument"
+ description="Run the instrument test suite (requires driver.jar property)">
+ <mkdir dir="${instrumenttest.out.dir}"/>
+ <junit printsummary="yes" haltonfailure="yes" dir="${basedir}"
+ maxmemory="256M" fork="yes" forkmode="perBatch">
+ <classpath refid="junit.classpath"/>
+ <formatter type="plain"/>
+ <formatter type="xml"/>
+ <batchtest todir="${instrumenttest.out.dir}" haltonfailure="no">
+ <fileset dir="${classes.dir}">
+ <include name="org/hibernate/test/**/*Test.class"/>
+ </fileset>
+ </batchtest>
+ </junit>
+ </target>
+
+ <target name="junitreport" depends="">
+ <junitreport todir="./test_output">
+ <fileset dir="test_output">
+ <include name="TEST-*.xml"/>
+ </fileset>
+ <report format="frames" todir="./test_output"/>
+ </junitreport>
+ </target>
+
+ <target name="run" depends="compile" description="Run Hibernate Console">
+ <java classname="org.hibernate.console.Start" classpathref="lib.class.path" fork="true">
+ <classpath>
+ <path location="${build.dir}"/>
+ </classpath>
+ </java>
+ </target>
+
+
+ <target name="checkstyle" description="Check coding style">
+ <taskdef resource="checkstyletask.properties">
+ <classpath>
+ <path refid="lib.class.path"/>
+ <fileset dir="${common-build.basedir}/lib">
+ <include name="checkstyle*.jar"/>
+ </fileset>
+ </classpath>
+ </taskdef>
+
+ <checkstyle config="${common-build.basedir}/checkstyle_checks.xml">
+ <fileset dir="${src.dir}">
+ <include name="**/*.java"/>
+ </fileset>
+ <formatter type="plain"/>
+ </checkstyle>
+ </target>
+
+ <target name="patch" depends="checkstyle"
+ description="Create a patch">
+ <cvs command="-q diff -u -N" output="patch.txt"/>
+ </target>
+
+</project>
\ No newline at end of file
Modified: entitymanager/trunk/doc/reference/build.xml
===================================================================
--- entitymanager/trunk/doc/reference/build.xml 2007-08-16 01:04:34 UTC (rev 13923)
+++ entitymanager/trunk/doc/reference/build.xml 2007-08-16 04:34:59 UTC (rev 13924)
@@ -1,7 +1,7 @@
<project name="Documentation" default="all.doc" basedir=".">
<!-- Use the core Hibernate3 doc build system -->
- <import file="../../../common/common-build.xml"/>
+ <import file="../../common-build.xml"/>
<import file="${hibernate-cvs.doc.reference}/build.xml"/>
Modified: entitymanager/trunk/doc/reference/en/master.xml
===================================================================
--- entitymanager/trunk/doc/reference/en/master.xml 2007-08-16 01:04:34 UTC (rev 13923)
+++ entitymanager/trunk/doc/reference/en/master.xml 2007-08-16 04:34:59 UTC (rev 13924)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3CR3//EN"
-"../../../../../Hibernate3/doc/reference/support/docbook-dtd/docbookx.dtd" [
+"../../../../core/doc/reference/support/docbook-dtd/docbookx.dtd" [
<!ENTITY architecture SYSTEM "modules/architecture.xml">
<!ENTITY configuration SYSTEM "modules/configuration.xml">
<!ENTITY entitymanagerapi SYSTEM "modules/entitymanagerapi.xml">
Modified: entitymanager/trunk/doc/reference/en/styles/fopdf.xsl
===================================================================
--- entitymanager/trunk/doc/reference/en/styles/fopdf.xsl 2007-08-16 01:04:34 UTC (rev 13923)
+++ entitymanager/trunk/doc/reference/en/styles/fopdf.xsl 2007-08-16 04:34:59 UTC (rev 13924)
@@ -17,7 +17,7 @@
-->
<!DOCTYPE xsl:stylesheet [
- <!ENTITY db_xsl_path "../../../../../../Hibernate3/doc/reference/support/docbook-xsl/">
+ <!ENTITY db_xsl_path "../../../../../core/doc/reference/support/docbook-xsl/">
]>
<xsl:stylesheet
Modified: entitymanager/trunk/doc/reference/en/styles/html.xsl
===================================================================
--- entitymanager/trunk/doc/reference/en/styles/html.xsl 2007-08-16 01:04:34 UTC (rev 13923)
+++ entitymanager/trunk/doc/reference/en/styles/html.xsl 2007-08-16 04:34:59 UTC (rev 13924)
@@ -15,7 +15,7 @@
-->
<!DOCTYPE xsl:stylesheet [
- <!ENTITY db_xsl_path "../../../../../../Hibernate3/doc/reference/support/docbook-xsl/">
+ <!ENTITY db_xsl_path "../../../../../core/doc/reference/support/docbook-xsl/">
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
Modified: entitymanager/trunk/doc/reference/en/styles/html_chunk.xsl
===================================================================
--- entitymanager/trunk/doc/reference/en/styles/html_chunk.xsl 2007-08-16 01:04:34 UTC (rev 13923)
+++ entitymanager/trunk/doc/reference/en/styles/html_chunk.xsl 2007-08-16 04:34:59 UTC (rev 13924)
@@ -15,7 +15,7 @@
-->
<!DOCTYPE xsl:stylesheet [
- <!ENTITY db_xsl_path "../../../../../../Hibernate3/doc/reference/support/docbook-xsl/">
+ <!ENTITY db_xsl_path "../../../../../core/doc/reference/support/docbook-xsl/">
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
Modified: search/trunk/build.xml
===================================================================
--- search/trunk/build.xml 2007-08-16 01:04:34 UTC (rev 13923)
+++ search/trunk/build.xml 2007-08-16 04:34:59 UTC (rev 13924)
@@ -23,7 +23,7 @@
<property name="javac.source" value="1.5"/>
<property name="javac.target" value="1.5"/>
<property name="jdbc.dir" value="jdbc"/>
- <property name="common.dir" value="${basedir}/../common"/>
+ <property name="common.dir" value="${basedir}"/>
<!-- property name="jpa-api.jar" value="${basedir}/../jpa-api/build/ejb3-persistence.jar"/>
<property name="annotations.jar"
Added: search/trunk/common-build.xml
===================================================================
--- search/trunk/common-build.xml (rev 0)
+++ search/trunk/common-build.xml 2007-08-16 04:34:59 UTC (rev 13924)
@@ -0,0 +1,472 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="common-build" default="dist">
+ <description>Common properties and targets for the HibernateExt project</description>
+
+ <!-- my.basedir property can be used to refer to files/directories relatively to the common-build.xml file -->
+ <dirname property="common-build.basedir" file="${ant.file.common-build}"/>
+
+ <!-- Give user a chance to override without editing this file
+ (and without typing -D each time it compiles it) -->
+ <property file="${common-build.basedir}/build.properties"/>
+ <property file="${user.home}/.ant.properties"/>
+
+ <property name="src.dir" location="src/java"/>
+ <property name="test.dir" location="src/test"/>
+ <property name="lib.dir" location="lib"/>
+ <property name="build.dir" location="build"/>
+ <property name="classes.dir" location="${build.dir}/classes"/>
+ <property name="testclasses.dir" location="${build.dir}/testclasses"/>
+ <property name="dist.target.dir" location="target"/>
+ <property name="dist.dir" location="${dist.target.dir}/${name}"/>
+ <property name="instrumenttest.out.dir" value="instrumenttestout"/>
+ <property name="doc.dir" location="doc"/>
+ <property name="doc.api.dir" location="${doc.dir}/api"/>
+ <property name="doc.reference.dir" location="${doc.dir}/reference"/>
+
+ <property name="dist.doc.dir" location="${dist.dir}/doc"/>
+ <property name="dist.api.dir" location="${dist.dir}/doc/api"/>
+
+ <property name="dist.src.dir" location="${dist.dir}/src"/>
+ <property name="dist.test.dir" location="${dist.dir}/test"/>
+ <property name="dist.lib.dir" location="${dist.dir}/lib"/>
+ <property name="jar.name" value="${name}"/>
+ <property name="jar.file.name" value="${dist.dir}/${jar.name}.jar"/>
+ <property name="jartest.file.name" value="${dist.dir}/${jar.name}-tests.jar"/>
+
+ <property name="javadoc" value="http://java.sun.com/j2se/1.4/docs/api"/>
+ <property name="javac.debug" value="on"/>
+ <property name="javac.optimize" value="off"/>
+ <property name="javac.source" value="1.4"/>
+ <property name="javac.target" value="1.4"/>
+
+
+ <!-- set Hibernate core related properties -->
+ <property name="hibernate-core.home" location="${common-build.basedir}/../hibernate-3.2"/>
+ <property name="hibernate-core.jar" location="${hibernate-core.home}/hibernate3.jar"/>
+ <property name="hibernate-core.lib.dir" location="${hibernate-core.home}/lib"/>
+ <property name="hibernate-core.jdbc.dir" location="${hibernate-core.home}/lib"/> <!-- for some reason jdbc.dir is renamed to lib instead of jdbc when doing a dist of hibernate3 -->
+ <property name="hibernate-core.doc.api" location="${hibernate-core.home}/doc/api"/>
+ <property name="hibernate-cvs.doc.reference" location="${common-build.basedir}/../core/doc/reference"/>
+
+ <!--
+ Explicitly define tasks from ant..
+ Unfortunately, checkstyle-a<path id="lib.class.path">
+ <path location="${hibernate-core.jar}"></path>
+ <fileset dir="${hibernate-core.lib.dir}">
+ <include name="*.jar"/>
+ </fileset>
+ <fileset dir="${lib.dir}">
+ <include name="*.jar"/>
+ </fileset>
+ <pathelement path="${clover.jar}"/>
+ </path>ll.jar contains it's own version of ANTLR, so ANTLR cannot be in the classpath.
+ -->
+ <!-- Emmanuel: Removed antlr, shouldn't be useful in Ext package...
+ taskdef name="antlr" classname="org.apache.tools.ant.taskdefs.optional.ANTLR">
+ <classpath>
+ <pathelement location="${hibernate-core.lib.dir}/antlr-2.7.2.jar"/>
+ <pathelement location="${hibernate-core.lib.dir}/ant-antlr-1.6.1.jar"/>
+ </classpath>
+ </taskdef -->
+
+ <taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
+ <classpath>
+ <fileset dir="${hibernate-core.lib.dir}">
+ <include name="junit-*.jar"/>
+ <include name="ant-junit-*.jar"/>
+ </fileset>
+ </classpath>
+ </taskdef>
+
+ <taskdef name="junitreport" classname="org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator">
+ <classpath>
+ <fileset dir="${hibernate-core.lib.dir}">
+ <include name="junit-*.jar"/>
+ <include name="ant-junit-*.jar"/>
+ </fileset>
+ </classpath>
+ </taskdef>
+
+ <path id="lib.class.path">
+ <path location="${hibernate-core.jar}"></path>
+ <fileset dir="${hibernate-core.lib.dir}">
+ <include name="*.jar"/>
+ </fileset>
+ <fileset dir="${lib.dir}">
+ <include name="*.jar"/>
+ </fileset>
+ <path refid="lib.moduleclass.path"/>
+ <pathelement path="${clover.jar}"/>
+ </path>
+
+ <!-- overridable in modules -->
+ <path id="lib.moduleclass.path"/>
+
+ <patternset id="support.files">
+ <include name="**/*.jpg"/>
+ <include name="**/*.gif"/>
+ <include name="**/*.dtd"/>
+ <include name="**/*.xsd"/>
+ <include name="**/*.xml"/>
+ <include name="**/*.xslt"/>
+
+ <!-- exclude everything we don't want in the jar -->
+ <exclude name="${build.dir}/**/*"/>
+ <exclude name="${doc.dir}/**/*"/>
+ <exclude name="classes/**/*"/>
+ <exclude name="build.xml"/>
+ <exclude name="**/*.properties"/>
+ <exclude name="**/*.ccf"/>
+ <exclude name="**/*.cfg.xml"/>
+ <exclude name="**/ehcache.xml"/>
+ </patternset>
+
+ <patternset id="source.files">
+ <include name="**/*.java"/>
+ <include name="**/*.properties"/>
+ </patternset>
+
+ <!-- junit paths/filesets -->
+ <fileset dir="${testclasses.dir}" id="junit.batchtestset">
+ <include name="**/*Test.class"/>
+ </fileset>
+
+ <path id="testsrc.path">
+ <pathelement location="${test.dir}"/>
+ </path>
+
+ <!-- Clover -->
+ <property name="clover.out.dir" value="cloverout"/>
+ <property name="clover.jar" value="${ant.home}/lib/clover.jar"/>
+ <taskdef resource="clovertasks"/>
+
+ <path id="junit.classpath">
+ <fileset dir="${lib.dir}">
+ <include name="*.jar"/>
+ </fileset>
+ <pathelement path="${classes.dir}"/>
+ <pathelement path="${testclasses.dir}"/>
+ <path refid="lib.class.path"/>
+ <path refid="junit.moduleclasspath"/>
+ <path location="${clover.jar}"/>
+ </path>
+
+ <!-- Clover tasks -->
+ <target name="with.clover">
+ <clover-setup initString="clover_coverage.db"/>
+ </target>
+
+ <target name="cloverreport.html" depends="with.clover"
+ description="Generate a clover report from the current clover database.">
+ <clover-report>
+ <current outfile="${clover.out.dir}">
+ <format type="html"/>
+ </current>
+ </clover-report>
+ </target>
+
+ <target name="cloverreport" depends="with.clover,junitreport,cloverreport.html"
+ description="Run the tests and generate a clover report">
+ </target>
+
+ <!-- Tasks -->
+
+ <target name="clean" description="Cleans up build and dist directories">
+ <delete dir="${build.dir}"/>
+ <delete dir="${dist.target.dir}"/>
+ <delete dir="${clover.out.dir}"/>
+ </target>
+
+ <target name="init" description="Initialize the build">
+ <tstamp>
+ <format property="subversion" pattern="yyyy-MM-dd hh:mm:ss"/>
+ </tstamp>
+ <echo message="Build ${Name}-${version} (${subversion})"/>
+ <mkdir dir="${classes.dir}"/>
+ <mkdir dir="${testclasses.dir}"/>
+ <copy todir="${classes.dir}">
+ <fileset dir="${src.dir}">
+ <patternset refid="support.files"/>
+ </fileset>
+ </copy>
+
+ <copy todir="${build.dir}">
+ <fileset dir=".">
+ <include name="readme.txt"/>
+ <include name="lgpl.txt"/>
+ </fileset>
+ </copy>
+
+ <available file="${hibernate-core.jar}" type="file" property="hibernate-core.jar.available"/>
+ <fail unless="hibernate-core.jar.available" message="Cannot locate hibernate-core.jar: ${hibernate-core.jar}"/>
+ </target>
+
+ <target name="compile" depends="init" description="Compile the Java source code">
+ <available
+ classname="org.eclipse.core.launcher.Main"
+ property="build.compiler"
+ value="org.eclipse.jdt.core.JDTCompilerAdapter"
+ classpath="${java.class.path}"/>
+ <javac
+ target="${javac.target}"
+ source="${javac.source}"
+ srcdir="${src.dir}"
+ destdir="${classes.dir}"
+ classpathref="lib.class.path"
+ debug="${javac.debug}"
+ optimize="${javac.optimize}"
+ nowarn="on">
+ </javac>
+ </target>
+
+ <target name="compiletest" depends="compile" description="Compile the tests">
+ <available
+ classname="org.eclipse.core.launcher.Main"
+ property="build.compiler"
+ value="org.eclipse.jdt.core.JDTCompilerAdapter"
+ classpath="${java.class.path}"/>
+ <javac
+ target="${javac.target}"
+ source="${javac.source}"
+ destdir="${testclasses.dir}"
+ classpathref="junit.classpath"
+ debug="${javac.debug}"
+ optimize="${javac.optimize}"
+ nowarn="on">
+ <src refid="testsrc.path"/>
+ </javac>
+ </target>
+
+ <target name="instrument" depends="compiletest"
+ description="Instrument the persistent classes"> <!-- depends="jar" -->
+
+ <taskdef name="instrument" classname="org.hibernate.tool.instrument.InstrumentTask">
+ <classpath path="${classes.dir}"/>
+ <classpath path="${testclasses.dir}"/>
+ <classpath refid="lib.class.path"/>
+ </taskdef>
+
+ <instrument verbose="true">
+ <fileset dir="${testclasses.dir}/org/hibernate/test">
+ <include name="**/*.class"/>
+ <exclude name="**/*Test$*.class"/>
+ <exclude name="**/*Test.class"/>
+ <exclude name="**/*Tests.class"/>
+ </fileset>
+ </instrument>
+
+ <!-- jar jarfile="${build.dir}/instrumented-classes.jar">
+ <fileset dir="${testclasses.dir}">
+ <include name="org/hibernate/test/**/*.class"/>
+ <exclude name="org/hibernate/test/**/*Test.class"/>
+ </fileset>
+ </jar -->
+
+ </target>
+
+ <target name="copytest" description="Copy tests to dist dir" if="copy.test" >
+ <mkdir dir="${dist.test.dir}"/>
+ <copy todir="${dist.test.dir}">
+ <fileset dir="${test.dir}"/>
+ </copy>
+ </target>
+
+ <target name="copysource" depends="copytest" description="Copy sources to dist dir">
+ <mkdir dir="${dist.src.dir}"/>
+ <copy todir="${dist.src.dir}">
+ <fileset dir="${src.dir}">
+ <patternset refid="source.files"/>
+ </fileset>
+ <fileset dir="${src.dir}">
+ <patternset refid="support.files"/>
+ </fileset>
+ </copy>
+ <mkdir dir="${dist.src.dir}"/>
+ <copy todir="${dist.src.dir}">
+ <fileset dir="${src.dir}">
+ <patternset refid="source.files"/>
+ </fileset>
+ <fileset dir="${src.dir}">
+ <patternset refid="support.files"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="copylib" description="Copy jars to lib dir">
+ <mkdir dir="${dist.lib.dir}"/>
+ <copy todir="${dist.lib.dir}">
+ <fileset dir="${lib.dir}">
+ <include name="*.jar"/>
+ <exclude name="log4j.jar"/>
+ <exclude name="checkstyle*.jar"/>
+ <include name="*.txt"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="copydoc" description="Copy doc to dist dir" if="copy.doc">
+ <mkdir dir="${dist.doc.dir}"/>
+ <copy todir="${dist.doc.dir}">
+ <fileset dir="${doc.dir}">
+ <include name="**/*.html"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="jar" depends="compile" description="Build the distribution .jar file">
+ <mkdir dir="${dist.dir}"/>
+ <jar filesetmanifest="merge" jarfile="${jar.file.name}" basedir="${classes.dir}"/>
+ </target>
+
+ <target name="jartest" depends="compiletest" description="Build the distribution .jar file">
+ <mkdir dir="${dist.dir}"/>
+ <jar filesetmanifest="merge" jarfile="${jartest.file.name}" basedir="${testclasses.dir}"/>
+ </target>
+
+ <!-- DOCUMENTATION -->
+
+ <target name="javadoc" description="Compile the Javadoc API documentation to dist dir">
+ <mkdir dir="${dist.api.dir}"/>
+ <javadoc
+ packagenames="${javadoc.packagenames}"
+ classpathref="lib.class.path"
+ destdir="${dist.api.dir}"
+ use="true"
+ protected="true"
+ version="true"
+ windowtitle="${Name} API Documentation"
+ Overview="${doc.api.dir}/package.html"
+ doctitle="${Name} API Documentation"
+ stylesheetfile="${hibernate-core.doc.api}/jdstyle.css"
+ link="${javadoc}">
+ <packageset dir="${src.dir}" defaultexcludes="yes" >
+ <include name="**/*" />
+ </packageset>
+ </javadoc>
+
+
+ </target>
+
+
+ <target name="extras" description="Copies miscellaneous files to root dir">
+ <copy todir="${dist.dir}/bin" failonerror="false">
+ <fileset dir="bin">
+ <include name="*.bat"/>
+ </fileset>
+ </copy>
+ <copy file="readme.txt" todir="${dist.dir}"/>
+ <copy file="lgpl.txt" todir="${dist.dir}"/>
+ <copy file="changelog.txt" todir="${dist.dir}"/>
+ <copy file="build.xml" todir="${dist.dir}"/>
+ <replace file="${dist.dir}/build.xml">
+ <replacetoken><![CDATA[../${name}-${version}]]></replacetoken>
+ <replacevalue><![CDATA[../${name}]]></replacevalue>
+ </replace>
+ </target>
+
+ <target name="dist" depends="jar,javadoc,copysource,copylib,copydoc,extras" description="Build everything">
+ <zip zipfile = "${dist.dir}-${version}.zip">
+ <zipfileset prefix="${name}-${version}" dir="${dist.dir}"/>
+ </zip>
+ <tar compression="gzip" tarfile="${dist.dir}-${version}.tar.gz">
+ <tarfileset prefix="${name}-${version}" dir="${dist.dir}"/>
+ </tar>
+ </target>
+
+ <target name="info" description="Echoes useful system properties">
+ <echo message="java.vm.info=${java.vm.info}"/>
+ <echo message="java.vm.name=${java.vm.name}"/>
+ <echo message="java.vm.vendor=${java.vm.vendor}"/>
+ <echo message="java.vm.version=${java.vm.version}"/>
+ <echo message="os.arch=${os.arch}"/>
+ <echo message="os.name=${os.name}"/>
+ <echo message="os.version=${os.version}"/>
+ <echo message="java.home = ${java.home}"/>
+ <echo message="java.class.path = ${java.class.path}"/>
+ <echo message="build.compiler = ${build.compiler}"/>
+ <echo message="file.encoding=${file.encoding}"/>
+ <echo message="user.home = ${user.home}"/>
+ <echo message="user.language=${user.language}"/>
+ </target>
+
+ <target name="junit" depends="compiletest">
+ <mkdir dir="test_output"/>
+ <junit printsummary="yes" haltonfailure="yes" forkmode="once">
+ <classpath refid="junit.classpath"/>
+ <formatter type="plain"/>
+ <formatter type="xml"/>
+ <batchtest fork="yes" todir="test_output" haltonfailure="no">
+ <fileset refid="junit.batchtestset"/>
+ </batchtest>
+ </junit>
+ </target>
+
+ <!-- Run a single unit test. -->
+ <target name="junitsingle" depends="compiletest" description="Run a single test suite (requires testname and jdbc.driver properties)">
+ <mkdir dir="test_output"/>
+ <junit printsummary="yes" fork="yes" haltonfailure="yes">
+ <classpath refid="junit.classpath"/>
+ <formatter type="plain"/>
+ <formatter type="xml"/>
+ <test fork="yes" todir="test_output" haltonfailure="no" name="${testname}"/>
+ </junit>
+ </target>
+
+ <target name="junitinstrument" depends="compiletest,instrument"
+ description="Run the instrument test suite (requires driver.jar property)">
+ <mkdir dir="${instrumenttest.out.dir}"/>
+ <junit printsummary="yes" haltonfailure="yes" dir="${basedir}"
+ maxmemory="256M" fork="yes" forkmode="perBatch">
+ <classpath refid="junit.classpath"/>
+ <formatter type="plain"/>
+ <formatter type="xml"/>
+ <batchtest todir="${instrumenttest.out.dir}" haltonfailure="no">
+ <fileset dir="${classes.dir}">
+ <include name="org/hibernate/test/**/*Test.class"/>
+ </fileset>
+ </batchtest>
+ </junit>
+ </target>
+
+ <target name="junitreport" depends="">
+ <junitreport todir="./test_output">
+ <fileset dir="test_output">
+ <include name="TEST-*.xml"/>
+ </fileset>
+ <report format="frames" todir="./test_output"/>
+ </junitreport>
+ </target>
+
+ <target name="run" depends="compile" description="Run Hibernate Console">
+ <java classname="org.hibernate.console.Start" classpathref="lib.class.path" fork="true">
+ <classpath>
+ <path location="${build.dir}"/>
+ </classpath>
+ </java>
+ </target>
+
+
+ <target name="checkstyle" description="Check coding style">
+ <taskdef resource="checkstyletask.properties">
+ <classpath>
+ <path refid="lib.class.path"/>
+ <fileset dir="${common-build.basedir}/lib">
+ <include name="checkstyle*.jar"/>
+ </fileset>
+ </classpath>
+ </taskdef>
+
+ <checkstyle config="${common-build.basedir}/checkstyle_checks.xml">
+ <fileset dir="${src.dir}">
+ <include name="**/*.java"/>
+ </fileset>
+ <formatter type="plain"/>
+ </checkstyle>
+ </target>
+
+ <target name="patch" depends="checkstyle"
+ description="Create a patch">
+ <cvs command="-q diff -u -N" output="patch.txt"/>
+ </target>
+
+</project>
\ No newline at end of file
Modified: search/trunk/doc/reference/build.xml
===================================================================
--- search/trunk/doc/reference/build.xml 2007-08-16 01:04:34 UTC (rev 13923)
+++ search/trunk/doc/reference/build.xml 2007-08-16 04:34:59 UTC (rev 13924)
@@ -1,7 +1,7 @@
<project name="Documentation" default="all.doc" basedir=".">
<!-- Use the core Hibernate3 doc build system -->
- <import file="../../../common/common-build.xml"/>
+ <import file="../../common-build.xml"/>
<import file="${hibernate-cvs.doc.reference}/build.xml"/>
Modified: search/trunk/doc/reference/en/master.xml
===================================================================
--- search/trunk/doc/reference/en/master.xml 2007-08-16 01:04:34 UTC (rev 13923)
+++ search/trunk/doc/reference/en/master.xml 2007-08-16 04:34:59 UTC (rev 13924)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id$ -->
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3CR3//EN"
-"../../../../../Hibernate3/doc/reference/support/docbook-dtd/docbookx.dtd" [
+"../../../../core/doc/reference/support/docbook-dtd/docbookx.dtd" [
<!ENTITY getting-started SYSTEM "modules/getting-started.xml">
<!ENTITY architecture SYSTEM "modules/architecture.xml">
<!ENTITY configuration SYSTEM "modules/configuration.xml">
Modified: search/trunk/doc/reference/en/styles/fopdf.xsl
===================================================================
--- search/trunk/doc/reference/en/styles/fopdf.xsl 2007-08-16 01:04:34 UTC (rev 13923)
+++ search/trunk/doc/reference/en/styles/fopdf.xsl 2007-08-16 04:34:59 UTC (rev 13924)
@@ -17,7 +17,7 @@
-->
<!DOCTYPE xsl:stylesheet [
- <!ENTITY db_xsl_path "../../../../../../Hibernate3/doc/reference/support/docbook-xsl/">
+ <!ENTITY db_xsl_path "../../../../../core/doc/reference/support/docbook-xsl/">
]>
<xsl:stylesheet
Modified: search/trunk/doc/reference/en/styles/html.xsl
===================================================================
--- search/trunk/doc/reference/en/styles/html.xsl 2007-08-16 01:04:34 UTC (rev 13923)
+++ search/trunk/doc/reference/en/styles/html.xsl 2007-08-16 04:34:59 UTC (rev 13924)
@@ -15,7 +15,7 @@
-->
<!DOCTYPE xsl:stylesheet [
- <!ENTITY db_xsl_path "../../../../../../Hibernate3/doc/reference/support/docbook-xsl/">
+ <!ENTITY db_xsl_path "../../../../../core/doc/reference/support/docbook-xsl/">
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
Modified: search/trunk/doc/reference/en/styles/html_chunk.xsl
===================================================================
--- search/trunk/doc/reference/en/styles/html_chunk.xsl 2007-08-16 01:04:34 UTC (rev 13923)
+++ search/trunk/doc/reference/en/styles/html_chunk.xsl 2007-08-16 04:34:59 UTC (rev 13924)
@@ -15,7 +15,7 @@
-->
<!DOCTYPE xsl:stylesheet [
- <!ENTITY db_xsl_path "../../../../../../Hibernate3/doc/reference/support/docbook-xsl/">
+ <!ENTITY db_xsl_path "../../../../../core/doc/reference/support/docbook-xsl/">
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
Modified: validator/trunk/build.xml
===================================================================
--- validator/trunk/build.xml 2007-08-16 01:04:34 UTC (rev 13923)
+++ validator/trunk/build.xml 2007-08-16 04:34:59 UTC (rev 13924)
@@ -31,7 +31,7 @@
<property name="javac.source" value="1.5"/>
<property name="javac.target" value="1.5"/>
<property name="jdbc.dir" value="jdbc"/>
- <property name="common.dir" value="${basedir}/../common"/>
+ <property name="common.dir" value="${basedir}"/>
<property name="ivy.dep.dir" value="${basedir}/build/lib" />
Added: validator/trunk/common-build.xml
===================================================================
--- validator/trunk/common-build.xml (rev 0)
+++ validator/trunk/common-build.xml 2007-08-16 04:34:59 UTC (rev 13924)
@@ -0,0 +1,472 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="common-build" default="dist">
+ <description>Common properties and targets for the HibernateExt project</description>
+
+ <!-- my.basedir property can be used to refer to files/directories relatively to the common-build.xml file -->
+ <dirname property="common-build.basedir" file="${ant.file.common-build}"/>
+
+ <!-- Give user a chance to override without editing this file
+ (and without typing -D each time it compiles it) -->
+ <property file="${common-build.basedir}/build.properties"/>
+ <property file="${user.home}/.ant.properties"/>
+
+ <property name="src.dir" location="src/java"/>
+ <property name="test.dir" location="src/test"/>
+ <property name="lib.dir" location="lib"/>
+ <property name="build.dir" location="build"/>
+ <property name="classes.dir" location="${build.dir}/classes"/>
+ <property name="testclasses.dir" location="${build.dir}/testclasses"/>
+ <property name="dist.target.dir" location="target"/>
+ <property name="dist.dir" location="${dist.target.dir}/${name}"/>
+ <property name="instrumenttest.out.dir" value="instrumenttestout"/>
+ <property name="doc.dir" location="doc"/>
+ <property name="doc.api.dir" location="${doc.dir}/api"/>
+ <property name="doc.reference.dir" location="${doc.dir}/reference"/>
+
+ <property name="dist.doc.dir" location="${dist.dir}/doc"/>
+ <property name="dist.api.dir" location="${dist.dir}/doc/api"/>
+
+ <property name="dist.src.dir" location="${dist.dir}/src"/>
+ <property name="dist.test.dir" location="${dist.dir}/test"/>
+ <property name="dist.lib.dir" location="${dist.dir}/lib"/>
+ <property name="jar.name" value="${name}"/>
+ <property name="jar.file.name" value="${dist.dir}/${jar.name}.jar"/>
+ <property name="jartest.file.name" value="${dist.dir}/${jar.name}-tests.jar"/>
+
+ <property name="javadoc" value="http://java.sun.com/j2se/1.4/docs/api"/>
+ <property name="javac.debug" value="on"/>
+ <property name="javac.optimize" value="off"/>
+ <property name="javac.source" value="1.4"/>
+ <property name="javac.target" value="1.4"/>
+
+
+ <!-- set Hibernate core related properties -->
+ <property name="hibernate-core.home" location="${common-build.basedir}/../hibernate-3.2"/>
+ <property name="hibernate-core.jar" location="${hibernate-core.home}/hibernate3.jar"/>
+ <property name="hibernate-core.lib.dir" location="${hibernate-core.home}/lib"/>
+ <property name="hibernate-core.jdbc.dir" location="${hibernate-core.home}/lib"/> <!-- for some reason jdbc.dir is renamed to lib instead of jdbc when doing a dist of hibernate3 -->
+ <property name="hibernate-core.doc.api" location="${hibernate-core.home}/doc/api"/>
+ <property name="hibernate-cvs.doc.reference" location="${common-build.basedir}/../core/doc/reference"/>
+
+ <!--
+ Explicitly define tasks from ant..
+ Unfortunately, checkstyle-a<path id="lib.class.path">
+ <path location="${hibernate-core.jar}"></path>
+ <fileset dir="${hibernate-core.lib.dir}">
+ <include name="*.jar"/>
+ </fileset>
+ <fileset dir="${lib.dir}">
+ <include name="*.jar"/>
+ </fileset>
+ <pathelement path="${clover.jar}"/>
+ </path>ll.jar contains it's own version of ANTLR, so ANTLR cannot be in the classpath.
+ -->
+ <!-- Emmanuel: Removed antlr, shouldn't be useful in Ext package...
+ taskdef name="antlr" classname="org.apache.tools.ant.taskdefs.optional.ANTLR">
+ <classpath>
+ <pathelement location="${hibernate-core.lib.dir}/antlr-2.7.2.jar"/>
+ <pathelement location="${hibernate-core.lib.dir}/ant-antlr-1.6.1.jar"/>
+ </classpath>
+ </taskdef -->
+
+ <taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
+ <classpath>
+ <fileset dir="${hibernate-core.lib.dir}">
+ <include name="junit-*.jar"/>
+ <include name="ant-junit-*.jar"/>
+ </fileset>
+ </classpath>
+ </taskdef>
+
+ <taskdef name="junitreport" classname="org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator">
+ <classpath>
+ <fileset dir="${hibernate-core.lib.dir}">
+ <include name="junit-*.jar"/>
+ <include name="ant-junit-*.jar"/>
+ </fileset>
+ </classpath>
+ </taskdef>
+
+ <path id="lib.class.path">
+ <path location="${hibernate-core.jar}"></path>
+ <fileset dir="${hibernate-core.lib.dir}">
+ <include name="*.jar"/>
+ </fileset>
+ <fileset dir="${lib.dir}">
+ <include name="*.jar"/>
+ </fileset>
+ <path refid="lib.moduleclass.path"/>
+ <pathelement path="${clover.jar}"/>
+ </path>
+
+ <!-- overridable in modules -->
+ <path id="lib.moduleclass.path"/>
+
+ <patternset id="support.files">
+ <include name="**/*.jpg"/>
+ <include name="**/*.gif"/>
+ <include name="**/*.dtd"/>
+ <include name="**/*.xsd"/>
+ <include name="**/*.xml"/>
+ <include name="**/*.xslt"/>
+
+ <!-- exclude everything we don't want in the jar -->
+ <exclude name="${build.dir}/**/*"/>
+ <exclude name="${doc.dir}/**/*"/>
+ <exclude name="classes/**/*"/>
+ <exclude name="build.xml"/>
+ <exclude name="**/*.properties"/>
+ <exclude name="**/*.ccf"/>
+ <exclude name="**/*.cfg.xml"/>
+ <exclude name="**/ehcache.xml"/>
+ </patternset>
+
+ <patternset id="source.files">
+ <include name="**/*.java"/>
+ <include name="**/*.properties"/>
+ </patternset>
+
+ <!-- junit paths/filesets -->
+ <fileset dir="${testclasses.dir}" id="junit.batchtestset">
+ <include name="**/*Test.class"/>
+ </fileset>
+
+ <path id="testsrc.path">
+ <pathelement location="${test.dir}"/>
+ </path>
+
+ <!-- Clover -->
+ <property name="clover.out.dir" value="cloverout"/>
+ <property name="clover.jar" value="${ant.home}/lib/clover.jar"/>
+ <taskdef resource="clovertasks"/>
+
+ <path id="junit.classpath">
+ <fileset dir="${lib.dir}">
+ <include name="*.jar"/>
+ </fileset>
+ <pathelement path="${classes.dir}"/>
+ <pathelement path="${testclasses.dir}"/>
+ <path refid="lib.class.path"/>
+ <path refid="junit.moduleclasspath"/>
+ <path location="${clover.jar}"/>
+ </path>
+
+ <!-- Clover tasks -->
+ <target name="with.clover">
+ <clover-setup initString="clover_coverage.db"/>
+ </target>
+
+ <target name="cloverreport.html" depends="with.clover"
+ description="Generate a clover report from the current clover database.">
+ <clover-report>
+ <current outfile="${clover.out.dir}">
+ <format type="html"/>
+ </current>
+ </clover-report>
+ </target>
+
+ <target name="cloverreport" depends="with.clover,junitreport,cloverreport.html"
+ description="Run the tests and generate a clover report">
+ </target>
+
+ <!-- Tasks -->
+
+ <target name="clean" description="Cleans up build and dist directories">
+ <delete dir="${build.dir}"/>
+ <delete dir="${dist.target.dir}"/>
+ <delete dir="${clover.out.dir}"/>
+ </target>
+
+ <target name="init" description="Initialize the build">
+ <tstamp>
+ <format property="subversion" pattern="yyyy-MM-dd hh:mm:ss"/>
+ </tstamp>
+ <echo message="Build ${Name}-${version} (${subversion})"/>
+ <mkdir dir="${classes.dir}"/>
+ <mkdir dir="${testclasses.dir}"/>
+ <copy todir="${classes.dir}">
+ <fileset dir="${src.dir}">
+ <patternset refid="support.files"/>
+ </fileset>
+ </copy>
+
+ <copy todir="${build.dir}">
+ <fileset dir=".">
+ <include name="readme.txt"/>
+ <include name="lgpl.txt"/>
+ </fileset>
+ </copy>
+
+ <available file="${hibernate-core.jar}" type="file" property="hibernate-core.jar.available"/>
+ <fail unless="hibernate-core.jar.available" message="Cannot locate hibernate-core.jar: ${hibernate-core.jar}"/>
+ </target>
+
+ <target name="compile" depends="init" description="Compile the Java source code">
+ <available
+ classname="org.eclipse.core.launcher.Main"
+ property="build.compiler"
+ value="org.eclipse.jdt.core.JDTCompilerAdapter"
+ classpath="${java.class.path}"/>
+ <javac
+ target="${javac.target}"
+ source="${javac.source}"
+ srcdir="${src.dir}"
+ destdir="${classes.dir}"
+ classpathref="lib.class.path"
+ debug="${javac.debug}"
+ optimize="${javac.optimize}"
+ nowarn="on">
+ </javac>
+ </target>
+
+ <target name="compiletest" depends="compile" description="Compile the tests">
+ <available
+ classname="org.eclipse.core.launcher.Main"
+ property="build.compiler"
+ value="org.eclipse.jdt.core.JDTCompilerAdapter"
+ classpath="${java.class.path}"/>
+ <javac
+ target="${javac.target}"
+ source="${javac.source}"
+ destdir="${testclasses.dir}"
+ classpathref="junit.classpath"
+ debug="${javac.debug}"
+ optimize="${javac.optimize}"
+ nowarn="on">
+ <src refid="testsrc.path"/>
+ </javac>
+ </target>
+
+ <target name="instrument" depends="compiletest"
+ description="Instrument the persistent classes"> <!-- depends="jar" -->
+
+ <taskdef name="instrument" classname="org.hibernate.tool.instrument.InstrumentTask">
+ <classpath path="${classes.dir}"/>
+ <classpath path="${testclasses.dir}"/>
+ <classpath refid="lib.class.path"/>
+ </taskdef>
+
+ <instrument verbose="true">
+ <fileset dir="${testclasses.dir}/org/hibernate/test">
+ <include name="**/*.class"/>
+ <exclude name="**/*Test$*.class"/>
+ <exclude name="**/*Test.class"/>
+ <exclude name="**/*Tests.class"/>
+ </fileset>
+ </instrument>
+
+ <!-- jar jarfile="${build.dir}/instrumented-classes.jar">
+ <fileset dir="${testclasses.dir}">
+ <include name="org/hibernate/test/**/*.class"/>
+ <exclude name="org/hibernate/test/**/*Test.class"/>
+ </fileset>
+ </jar -->
+
+ </target>
+
+ <target name="copytest" description="Copy tests to dist dir" if="copy.test" >
+ <mkdir dir="${dist.test.dir}"/>
+ <copy todir="${dist.test.dir}">
+ <fileset dir="${test.dir}"/>
+ </copy>
+ </target>
+
+ <target name="copysource" depends="copytest" description="Copy sources to dist dir">
+ <mkdir dir="${dist.src.dir}"/>
+ <copy todir="${dist.src.dir}">
+ <fileset dir="${src.dir}">
+ <patternset refid="source.files"/>
+ </fileset>
+ <fileset dir="${src.dir}">
+ <patternset refid="support.files"/>
+ </fileset>
+ </copy>
+ <mkdir dir="${dist.src.dir}"/>
+ <copy todir="${dist.src.dir}">
+ <fileset dir="${src.dir}">
+ <patternset refid="source.files"/>
+ </fileset>
+ <fileset dir="${src.dir}">
+ <patternset refid="support.files"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="copylib" description="Copy jars to lib dir">
+ <mkdir dir="${dist.lib.dir}"/>
+ <copy todir="${dist.lib.dir}">
+ <fileset dir="${lib.dir}">
+ <include name="*.jar"/>
+ <exclude name="log4j.jar"/>
+ <exclude name="checkstyle*.jar"/>
+ <include name="*.txt"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="copydoc" description="Copy doc to dist dir" if="copy.doc">
+ <mkdir dir="${dist.doc.dir}"/>
+ <copy todir="${dist.doc.dir}">
+ <fileset dir="${doc.dir}">
+ <include name="**/*.html"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="jar" depends="compile" description="Build the distribution .jar file">
+ <mkdir dir="${dist.dir}"/>
+ <jar filesetmanifest="merge" jarfile="${jar.file.name}" basedir="${classes.dir}"/>
+ </target>
+
+ <target name="jartest" depends="compiletest" description="Build the distribution .jar file">
+ <mkdir dir="${dist.dir}"/>
+ <jar filesetmanifest="merge" jarfile="${jartest.file.name}" basedir="${testclasses.dir}"/>
+ </target>
+
+ <!-- DOCUMENTATION -->
+
+ <target name="javadoc" description="Compile the Javadoc API documentation to dist dir">
+ <mkdir dir="${dist.api.dir}"/>
+ <javadoc
+ packagenames="${javadoc.packagenames}"
+ classpathref="lib.class.path"
+ destdir="${dist.api.dir}"
+ use="true"
+ protected="true"
+ version="true"
+ windowtitle="${Name} API Documentation"
+ Overview="${doc.api.dir}/package.html"
+ doctitle="${Name} API Documentation"
+ stylesheetfile="${hibernate-core.doc.api}/jdstyle.css"
+ link="${javadoc}">
+ <packageset dir="${src.dir}" defaultexcludes="yes" >
+ <include name="**/*" />
+ </packageset>
+ </javadoc>
+
+
+ </target>
+
+
+ <target name="extras" description="Copies miscellaneous files to root dir">
+ <copy todir="${dist.dir}/bin" failonerror="false">
+ <fileset dir="bin">
+ <include name="*.bat"/>
+ </fileset>
+ </copy>
+ <copy file="readme.txt" todir="${dist.dir}"/>
+ <copy file="lgpl.txt" todir="${dist.dir}"/>
+ <copy file="changelog.txt" todir="${dist.dir}"/>
+ <copy file="build.xml" todir="${dist.dir}"/>
+ <replace file="${dist.dir}/build.xml">
+ <replacetoken><![CDATA[../${name}-${version}]]></replacetoken>
+ <replacevalue><![CDATA[../${name}]]></replacevalue>
+ </replace>
+ </target>
+
+ <target name="dist" depends="jar,javadoc,copysource,copylib,copydoc,extras" description="Build everything">
+ <zip zipfile = "${dist.dir}-${version}.zip">
+ <zipfileset prefix="${name}-${version}" dir="${dist.dir}"/>
+ </zip>
+ <tar compression="gzip" tarfile="${dist.dir}-${version}.tar.gz">
+ <tarfileset prefix="${name}-${version}" dir="${dist.dir}"/>
+ </tar>
+ </target>
+
+ <target name="info" description="Echoes useful system properties">
+ <echo message="java.vm.info=${java.vm.info}"/>
+ <echo message="java.vm.name=${java.vm.name}"/>
+ <echo message="java.vm.vendor=${java.vm.vendor}"/>
+ <echo message="java.vm.version=${java.vm.version}"/>
+ <echo message="os.arch=${os.arch}"/>
+ <echo message="os.name=${os.name}"/>
+ <echo message="os.version=${os.version}"/>
+ <echo message="java.home = ${java.home}"/>
+ <echo message="java.class.path = ${java.class.path}"/>
+ <echo message="build.compiler = ${build.compiler}"/>
+ <echo message="file.encoding=${file.encoding}"/>
+ <echo message="user.home = ${user.home}"/>
+ <echo message="user.language=${user.language}"/>
+ </target>
+
+ <target name="junit" depends="compiletest">
+ <mkdir dir="test_output"/>
+ <junit printsummary="yes" haltonfailure="yes" forkmode="once">
+ <classpath refid="junit.classpath"/>
+ <formatter type="plain"/>
+ <formatter type="xml"/>
+ <batchtest fork="yes" todir="test_output" haltonfailure="no">
+ <fileset refid="junit.batchtestset"/>
+ </batchtest>
+ </junit>
+ </target>
+
+ <!-- Run a single unit test. -->
+ <target name="junitsingle" depends="compiletest" description="Run a single test suite (requires testname and jdbc.driver properties)">
+ <mkdir dir="test_output"/>
+ <junit printsummary="yes" fork="yes" haltonfailure="yes">
+ <classpath refid="junit.classpath"/>
+ <formatter type="plain"/>
+ <formatter type="xml"/>
+ <test fork="yes" todir="test_output" haltonfailure="no" name="${testname}"/>
+ </junit>
+ </target>
+
+ <target name="junitinstrument" depends="compiletest,instrument"
+ description="Run the instrument test suite (requires driver.jar property)">
+ <mkdir dir="${instrumenttest.out.dir}"/>
+ <junit printsummary="yes" haltonfailure="yes" dir="${basedir}"
+ maxmemory="256M" fork="yes" forkmode="perBatch">
+ <classpath refid="junit.classpath"/>
+ <formatter type="plain"/>
+ <formatter type="xml"/>
+ <batchtest todir="${instrumenttest.out.dir}" haltonfailure="no">
+ <fileset dir="${classes.dir}">
+ <include name="org/hibernate/test/**/*Test.class"/>
+ </fileset>
+ </batchtest>
+ </junit>
+ </target>
+
+ <target name="junitreport" depends="">
+ <junitreport todir="./test_output">
+ <fileset dir="test_output">
+ <include name="TEST-*.xml"/>
+ </fileset>
+ <report format="frames" todir="./test_output"/>
+ </junitreport>
+ </target>
+
+ <target name="run" depends="compile" description="Run Hibernate Console">
+ <java classname="org.hibernate.console.Start" classpathref="lib.class.path" fork="true">
+ <classpath>
+ <path location="${build.dir}"/>
+ </classpath>
+ </java>
+ </target>
+
+
+ <target name="checkstyle" description="Check coding style">
+ <taskdef resource="checkstyletask.properties">
+ <classpath>
+ <path refid="lib.class.path"/>
+ <fileset dir="${common-build.basedir}/lib">
+ <include name="checkstyle*.jar"/>
+ </fileset>
+ </classpath>
+ </taskdef>
+
+ <checkstyle config="${common-build.basedir}/checkstyle_checks.xml">
+ <fileset dir="${src.dir}">
+ <include name="**/*.java"/>
+ </fileset>
+ <formatter type="plain"/>
+ </checkstyle>
+ </target>
+
+ <target name="patch" depends="checkstyle"
+ description="Create a patch">
+ <cvs command="-q diff -u -N" output="patch.txt"/>
+ </target>
+
+</project>
\ No newline at end of file
Modified: validator/trunk/doc/reference/build.xml
===================================================================
--- validator/trunk/doc/reference/build.xml 2007-08-16 01:04:34 UTC (rev 13923)
+++ validator/trunk/doc/reference/build.xml 2007-08-16 04:34:59 UTC (rev 13924)
@@ -1,7 +1,7 @@
<project name="Documentation" default="all.doc" basedir=".">
<!-- Use the core Hibernate3 doc build system -->
- <import file="../../../common/common-build.xml"/>
+ <import file="../../common-build.xml"/>
<import file="${hibernate-cvs.doc.reference}/build.xml"/>
Modified: validator/trunk/doc/reference/en/master.xml
===================================================================
--- validator/trunk/doc/reference/en/master.xml 2007-08-16 01:04:34 UTC (rev 13923)
+++ validator/trunk/doc/reference/en/master.xml 2007-08-16 04:34:59 UTC (rev 13924)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3CR3//EN"
-"../../../../../Hibernate3/doc/reference/support/docbook-dtd/docbookx.dtd" [
+"../../../../core/doc/reference/support/docbook-dtd/docbookx.dtd" [
<!ENTITY defineconstraints SYSTEM "modules/defineconstraints.xml">
<!ENTITY checkconstraints SYSTEM "modules/checkconstraints.xml">
]>
Modified: validator/trunk/doc/reference/en/styles/fopdf.xsl
===================================================================
--- validator/trunk/doc/reference/en/styles/fopdf.xsl 2007-08-16 01:04:34 UTC (rev 13923)
+++ validator/trunk/doc/reference/en/styles/fopdf.xsl 2007-08-16 04:34:59 UTC (rev 13924)
@@ -17,7 +17,7 @@
-->
<!DOCTYPE xsl:stylesheet [
- <!ENTITY db_xsl_path "../../../../../../Hibernate3/doc/reference/support/docbook-xsl/">
+ <!ENTITY db_xsl_path "../../../../../core/doc/reference/support/docbook-xsl/">
]>
<xsl:stylesheet
Modified: validator/trunk/doc/reference/en/styles/html.xsl
===================================================================
--- validator/trunk/doc/reference/en/styles/html.xsl 2007-08-16 01:04:34 UTC (rev 13923)
+++ validator/trunk/doc/reference/en/styles/html.xsl 2007-08-16 04:34:59 UTC (rev 13924)
@@ -15,7 +15,7 @@
-->
<!DOCTYPE xsl:stylesheet [
- <!ENTITY db_xsl_path "../../../../../../Hibernate3/doc/reference/support/docbook-xsl/">
+ <!ENTITY db_xsl_path "../../../../../core/doc/reference/support/docbook-xsl/">
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
Modified: validator/trunk/doc/reference/en/styles/html_chunk.xsl
===================================================================
--- validator/trunk/doc/reference/en/styles/html_chunk.xsl 2007-08-16 01:04:34 UTC (rev 13923)
+++ validator/trunk/doc/reference/en/styles/html_chunk.xsl 2007-08-16 04:34:59 UTC (rev 13924)
@@ -15,7 +15,7 @@
-->
<!DOCTYPE xsl:stylesheet [
- <!ENTITY db_xsl_path "../../../../../../Hibernate3/doc/reference/support/docbook-xsl/">
+ <!ENTITY db_xsl_path "../../../../../core/doc/reference/support/docbook-xsl/">
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
16 years, 8 months
Hibernate SVN: r13923 - common/branches/Branch_3_2.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2007-08-15 21:04:34 -0400 (Wed, 15 Aug 2007)
New Revision: 13923
Added:
common/branches/Branch_3_2/HibernateExt/
Log:
Move Branch Branch_3_2 to common
Copied: common/branches/Branch_3_2/HibernateExt (from rev 13922, branches/Branch_3_2/HibernateExt)
16 years, 8 months
Hibernate SVN: r13922 - common/branches.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2007-08-15 21:04:32 -0400 (Wed, 15 Aug 2007)
New Revision: 13922
Added:
common/branches/Branch_3_2/
Log:
create branch Branch_3_2 in common
16 years, 8 months
Hibernate SVN: r13921 - jpa-api/branches/Branch_3_2.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2007-08-15 21:04:31 -0400 (Wed, 15 Aug 2007)
New Revision: 13921
Added:
jpa-api/branches/Branch_3_2/HibernateExt/
Log:
Move Branch Branch_3_2 to jpa-api
Copied: jpa-api/branches/Branch_3_2/HibernateExt (from rev 13920, branches/Branch_3_2/HibernateExt)
16 years, 8 months
Hibernate SVN: r13920 - jpa-api/branches.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2007-08-15 21:04:29 -0400 (Wed, 15 Aug 2007)
New Revision: 13920
Added:
jpa-api/branches/Branch_3_2/
Log:
create branch Branch_3_2 in jpa-api
16 years, 8 months
Hibernate SVN: r13919 - entitymanager/branches/Branch_3_2.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2007-08-15 21:04:29 -0400 (Wed, 15 Aug 2007)
New Revision: 13919
Added:
entitymanager/branches/Branch_3_2/HibernateExt/
Log:
Move Branch Branch_3_2 to entitymanager
Copied: entitymanager/branches/Branch_3_2/HibernateExt (from rev 13918, branches/Branch_3_2/HibernateExt)
16 years, 8 months
Hibernate SVN: r13918 - entitymanager/branches.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2007-08-15 21:04:26 -0400 (Wed, 15 Aug 2007)
New Revision: 13918
Added:
entitymanager/branches/Branch_3_2/
Log:
create branch Branch_3_2 in entitymanager
16 years, 8 months