Hibernate SVN: r19945 - in search/trunk/hibernate-search/src/main/java/org/hibernate/search: impl and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2010-07-14 10:21:00 -0400 (Wed, 14 Jul 2010)
New Revision: 19945
Modified:
search/trunk/hibernate-search/src/main/java/org/hibernate/search/event/FullTextIndexEventListener.java
search/trunk/hibernate-search/src/main/java/org/hibernate/search/impl/SearchFactoryBuilder.java
Log:
HSEARCH-560 Make sure Version.touch() is used by all entry points
With the SearchFactory refactoring, this was no longer the case.
Modified: search/trunk/hibernate-search/src/main/java/org/hibernate/search/event/FullTextIndexEventListener.java
===================================================================
--- search/trunk/hibernate-search/src/main/java/org/hibernate/search/event/FullTextIndexEventListener.java 2010-07-13 16:53:46 UTC (rev 19944)
+++ search/trunk/hibernate-search/src/main/java/org/hibernate/search/event/FullTextIndexEventListener.java 2010-07-14 14:21:00 UTC (rev 19945)
@@ -57,6 +57,7 @@
import org.hibernate.event.PostInsertEventListener;
import org.hibernate.event.PostUpdateEvent;
import org.hibernate.event.PostUpdateEventListener;
+import org.hibernate.search.Version;
import org.hibernate.search.backend.Work;
import org.hibernate.search.backend.WorkType;
import org.hibernate.search.backend.impl.EventSourceTransactionContext;
@@ -87,6 +88,10 @@
PostCollectionRecreateEventListener, PostCollectionRemoveEventListener,
PostCollectionUpdateEventListener, FlushEventListener, Initializable, Destructible {
+ static {
+ Version.touch();
+ }
+
private static final Logger log = LoggerFactory.make();
protected boolean used;
Modified: search/trunk/hibernate-search/src/main/java/org/hibernate/search/impl/SearchFactoryBuilder.java
===================================================================
--- search/trunk/hibernate-search/src/main/java/org/hibernate/search/impl/SearchFactoryBuilder.java 2010-07-13 16:53:46 UTC (rev 19944)
+++ search/trunk/hibernate-search/src/main/java/org/hibernate/search/impl/SearchFactoryBuilder.java 2010-07-14 14:21:00 UTC (rev 19945)
@@ -51,6 +51,7 @@
import org.hibernate.annotations.common.reflection.java.JavaReflectionManager;
import org.hibernate.search.Environment;
import org.hibernate.search.SearchException;
+import org.hibernate.search.Version;
import org.hibernate.search.annotations.AnalyzerDef;
import org.hibernate.search.annotations.AnalyzerDefs;
import org.hibernate.search.annotations.Factory;
@@ -102,6 +103,11 @@
* @author Hardy Ferentschik
*/
public class SearchFactoryBuilder {
+
+ static {
+ Version.touch();
+ }
+
private static final Logger log = LoggerFactory.make();
private SearchConfiguration cfg;
private MutableSearchFactory rootFactory;
14 years, 4 months
Postal Tracking #FDD4Q22514LDU4N
by United Parcel Service of America
Hello!
We were not able to deliver postal package you sent on the 14th of March in time
because the recipient�s address is not correct.
Please print out the invoice copy attached and collect the package at our office.
Your United Parcel Service of America
14 years, 4 months
Hibernate SVN: r19944 - in core/trunk/core/src/main/java/org/hibernate: engine/profile and 1 other directories.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-07-13 12:53:46 -0400 (Tue, 13 Jul 2010)
New Revision: 19944
Added:
core/trunk/core/src/main/java/org/hibernate/mapping/MetadataSource.java
Modified:
core/trunk/core/src/main/java/org/hibernate/cfg/AnnotationConfiguration.java
core/trunk/core/src/main/java/org/hibernate/cfg/Configuration.java
core/trunk/core/src/main/java/org/hibernate/cfg/ExtendedMappings.java
core/trunk/core/src/main/java/org/hibernate/cfg/HbmBinder.java
core/trunk/core/src/main/java/org/hibernate/cfg/Mappings.java
core/trunk/core/src/main/java/org/hibernate/cfg/VerifyFetchProfileReferenceSecondPass.java
core/trunk/core/src/main/java/org/hibernate/engine/profile/Association.java
core/trunk/core/src/main/java/org/hibernate/engine/profile/Fetch.java
core/trunk/core/src/main/java/org/hibernate/engine/profile/FetchProfile.java
core/trunk/core/src/main/java/org/hibernate/mapping/FetchProfile.java
Log:
HHH-5375 - Move AnnotationConfiguration-added methods to Configuration and deprecate AnnotationConfiguration
Modified: core/trunk/core/src/main/java/org/hibernate/cfg/AnnotationConfiguration.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/cfg/AnnotationConfiguration.java 2010-07-13 15:06:59 UTC (rev 19943)
+++ core/trunk/core/src/main/java/org/hibernate/cfg/AnnotationConfiguration.java 2010-07-13 16:53:46 UTC (rev 19944)
@@ -87,7 +87,6 @@
import org.hibernate.event.PreInsertEventListener;
import org.hibernate.event.PreUpdateEventListener;
import org.hibernate.mapping.Column;
-import org.hibernate.mapping.FetchProfile;
import org.hibernate.mapping.IdGenerator;
import org.hibernate.mapping.Join;
import org.hibernate.mapping.PersistentClass;
@@ -160,7 +159,6 @@
private boolean isValidatorNotPresentLogged;
private Map<XClass, Map<String, PropertyData>> propertiesAnnotatedWithMapsId;
private Map<XClass, Map<String, PropertyData>> propertiesAnnotatedWithIdAndToOne;
- private Collection<FetchProfile> annotationConfiguredProfiles;
public AnnotationConfiguration() {
super();
@@ -267,7 +265,7 @@
}
public ExtendedMappings createExtendedMappings() {
- return new ExtendedMappingsImpl( annotationConfiguredProfiles );
+ return new ExtendedMappingsImpl();
}
@Override
@@ -310,7 +308,6 @@
reflectionManager = new JavaReflectionManager();
( ( MetadataProviderInjector ) reflectionManager ).setMetadataProvider( new JPAMetadataProvider() );
configurationArtefactPrecedence = Collections.emptyList();
- annotationConfiguredProfiles = new HashSet<FetchProfile>();
}
@Override
@@ -1257,12 +1254,7 @@
protected class ExtendedMappingsImpl extends MappingsImpl implements ExtendedMappings {
private Boolean useNewGeneratorMappings;
- private Collection<FetchProfile> annotationConfiguredProfile;
- public ExtendedMappingsImpl(Collection<FetchProfile> fetchProfiles) {
- annotationConfiguredProfile = fetchProfiles;
- }
-
public void addDefaultGenerator(IdGenerator generator) {
this.addGenerator( generator );
defaultNamedGenerators.add( generator.getName() );
@@ -1531,24 +1523,6 @@
public AnyMetaDef getAnyMetaDef(String name) {
return anyMetaDefs.get( name );
}
-
- public FetchProfile findOrCreateFetchProfile(String name) {
- FetchProfile profile = super.findOrCreateFetchProfile( name );
- if ( profile.getFetches().isEmpty() ) {
- annotationConfiguredProfile.add( profile );
- }
- return profile;
- }
-
- public boolean isAnnotationConfiguredFetchProfile(FetchProfile fetchProfile) {
- for ( FetchProfile profile : annotationConfiguredProfile ) {
- // we need reference equality there!!
- if ( profile == fetchProfile ) {
- return true;
- }
- }
- return false;
- }
}
private static class CacheHolder {
Modified: core/trunk/core/src/main/java/org/hibernate/cfg/Configuration.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/cfg/Configuration.java 2010-07-13 15:06:59 UTC (rev 19943)
+++ core/trunk/core/src/main/java/org/hibernate/cfg/Configuration.java 2010-07-13 16:53:46 UTC (rev 19944)
@@ -118,6 +118,7 @@
import org.hibernate.mapping.IdentifierCollection;
import org.hibernate.mapping.Index;
import org.hibernate.mapping.MappedSuperclass;
+import org.hibernate.mapping.MetadataSource;
import org.hibernate.mapping.PersistentClass;
import org.hibernate.mapping.Property;
import org.hibernate.mapping.RootClass;
@@ -2598,10 +2599,10 @@
filterDefinitions.put( definition.getFilterName(), definition );
}
- public FetchProfile findOrCreateFetchProfile(String name) {
+ public FetchProfile findOrCreateFetchProfile(String name, MetadataSource source) {
FetchProfile profile = ( FetchProfile ) fetchProfiles.get( name );
if ( profile == null ) {
- profile = new FetchProfile( name );
+ profile = new FetchProfile( name, source );
fetchProfiles.put( name, profile );
}
return profile;
Modified: core/trunk/core/src/main/java/org/hibernate/cfg/ExtendedMappings.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/cfg/ExtendedMappings.java 2010-07-13 15:06:59 UTC (rev 19943)
+++ core/trunk/core/src/main/java/org/hibernate/cfg/ExtendedMappings.java 2010-07-13 16:53:46 UTC (rev 19944)
@@ -208,9 +208,4 @@
void addToOneAndIdProperty(XClass entity, PropertyData property);
- /**
- * @param fetchProfile The fetch profile to test.
- * @return {@code true} if the provided fetch profile has been configured via annotations, {@code false} otherwise.
- */
- boolean isAnnotationConfiguredFetchProfile(FetchProfile fetchProfile);
}
\ No newline at end of file
Modified: core/trunk/core/src/main/java/org/hibernate/cfg/HbmBinder.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/cfg/HbmBinder.java 2010-07-13 15:06:59 UTC (rev 19943)
+++ core/trunk/core/src/main/java/org/hibernate/cfg/HbmBinder.java 2010-07-13 16:53:46 UTC (rev 19944)
@@ -66,6 +66,7 @@
import org.hibernate.mapping.ManyToOne;
import org.hibernate.mapping.Map;
import org.hibernate.mapping.MetaAttribute;
+import org.hibernate.mapping.MetadataSource;
import org.hibernate.mapping.OneToMany;
import org.hibernate.mapping.OneToOne;
import org.hibernate.mapping.PersistentClass;
@@ -3033,7 +3034,7 @@
private static void parseFetchProfile(Element element, Mappings mappings, String containingEntityName) {
String profileName = element.attributeValue( "name" );
- FetchProfile profile = mappings.findOrCreateFetchProfile( profileName );
+ FetchProfile profile = mappings.findOrCreateFetchProfile( profileName, MetadataSource.HBM );
Iterator itr = element.elementIterator( "fetch" );
while ( itr.hasNext() ) {
final Element fetchElement = ( Element ) itr.next();
Modified: core/trunk/core/src/main/java/org/hibernate/cfg/Mappings.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/cfg/Mappings.java 2010-07-13 15:06:59 UTC (rev 19943)
+++ core/trunk/core/src/main/java/org/hibernate/cfg/Mappings.java 2010-07-13 16:53:46 UTC (rev 19944)
@@ -37,6 +37,7 @@
import org.hibernate.engine.NamedSQLQueryDefinition;
import org.hibernate.engine.ResultSetMappingDefinition;
import org.hibernate.mapping.Collection;
+import org.hibernate.mapping.MetadataSource;
import org.hibernate.mapping.PersistentClass;
import org.hibernate.mapping.Table;
import org.hibernate.mapping.TypeDef;
@@ -390,9 +391,10 @@
* or by creating one (and adding it).
*
* @param name The name of the profile.
+ * @param source The source from which this profile is named.
* @return The fetch profile metadata.
*/
- public FetchProfile findOrCreateFetchProfile(String name);
+ public FetchProfile findOrCreateFetchProfile(String name, MetadataSource source);
/**
* Retrieves an iterator over the metadata pertaining to all auxilary database objects int this repository.
Modified: core/trunk/core/src/main/java/org/hibernate/cfg/VerifyFetchProfileReferenceSecondPass.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/cfg/VerifyFetchProfileReferenceSecondPass.java 2010-07-13 15:06:59 UTC (rev 19943)
+++ core/trunk/core/src/main/java/org/hibernate/cfg/VerifyFetchProfileReferenceSecondPass.java 2010-07-13 16:53:46 UTC (rev 19944)
@@ -21,15 +21,13 @@
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
-
-// $Id$
-
package org.hibernate.cfg;
import java.util.Map;
import org.hibernate.MappingException;
import org.hibernate.annotations.FetchProfile;
+import org.hibernate.mapping.MetadataSource;
import org.hibernate.mapping.PersistentClass;
/**
@@ -48,8 +46,11 @@
}
public void doSecondPass(Map persistentClasses) throws MappingException {
- org.hibernate.mapping.FetchProfile profile = mappings.findOrCreateFetchProfile( fetchProfileName );
- if ( !mappings.isAnnotationConfiguredFetchProfile( profile ) ) {
+ org.hibernate.mapping.FetchProfile profile = mappings.findOrCreateFetchProfile(
+ fetchProfileName,
+ MetadataSource.ANNOTATIONS
+ );
+ if ( MetadataSource.ANNOTATIONS != profile.getSource() ) {
return;
}
Modified: core/trunk/core/src/main/java/org/hibernate/engine/profile/Association.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/engine/profile/Association.java 2010-07-13 15:06:59 UTC (rev 19943)
+++ core/trunk/core/src/main/java/org/hibernate/engine/profile/Association.java 2010-07-13 16:53:46 UTC (rev 19944)
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* 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
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.engine.profile;
Modified: core/trunk/core/src/main/java/org/hibernate/engine/profile/Fetch.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/engine/profile/Fetch.java 2010-07-13 15:06:59 UTC (rev 19943)
+++ core/trunk/core/src/main/java/org/hibernate/engine/profile/Fetch.java 2010-07-13 16:53:46 UTC (rev 19944)
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* 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
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.engine.profile;
Modified: core/trunk/core/src/main/java/org/hibernate/engine/profile/FetchProfile.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/engine/profile/FetchProfile.java 2010-07-13 15:06:59 UTC (rev 19943)
+++ core/trunk/core/src/main/java/org/hibernate/engine/profile/FetchProfile.java 2010-07-13 16:53:46 UTC (rev 19944)
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* 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
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.engine.profile;
@@ -33,12 +32,12 @@
import org.hibernate.engine.SessionFactoryImplementor;
import org.hibernate.type.Type;
import org.hibernate.type.BagType;
-import org.hibernate.type.AssociationType;
/**
- * A 'fetch profile' allows a user to dynamically modify the fetching
- * strategy used for particular associations at runtime, whereas that
- * information was historically only statically defined in the metadata.
+ * A 'fetch profile' allows a user to dynamically modify the fetching strategy used for particular associations at
+ * runtime, whereas that information was historically only statically defined in the metadata.
+ * <p/>
+ * This class defines the runtime representation of this data.
*
* @author Steve Ebersole
*/
@@ -46,7 +45,7 @@
private static final Logger log = LoggerFactory.getLogger( FetchProfile.class );
private final String name;
- private Map fetches = new HashMap();
+ private Map<String,Fetch> fetches = new HashMap<String,Fetch>();
private boolean containsJoinFetchedCollection = false;
private boolean containsJoinFetchedBag = false;
@@ -70,6 +69,7 @@
* @param association The association to be fetched
* @param fetchStyleName The name of the fetch style to apply
*/
+ @SuppressWarnings({ "UnusedDeclaration" })
public void addFetch(Association association, String fetchStyleName) {
addFetch( association, Fetch.Style.parse( fetchStyleName ) );
}
@@ -94,7 +94,7 @@
if ( associationType.isCollectionType() ) {
log.trace( "handling request to add collection fetch [{}]", fetch.getAssociation().getRole() );
- // couple of things for whcih to account in the case of collection
+ // couple of things for which to account in the case of collection
// join fetches
if ( Fetch.Style.JOIN == fetch.getStyle() ) {
// first, if this is a bag we need to ignore it if we previously
@@ -134,17 +134,17 @@
}
/**
- * Getter for property 'fetches'. Map of {@link Fetch} instances,
- * keyed by associaion <tt>role</tt>
+ * Getter for property 'fetches'. Map of {@link Fetch} instances, keyed by association <tt>role</tt>
*
* @return Value for property 'fetches'.
*/
- public Map getFetches() {
+ @SuppressWarnings({ "UnusedDeclaration" })
+ public Map<String,Fetch> getFetches() {
return fetches;
}
public Fetch getFetchByRole(String role) {
- return ( Fetch ) fetches.get( role );
+ return fetches.get( role );
}
/**
@@ -153,6 +153,7 @@
*
* @return Value for property 'containsJoinFetchedCollection'.
*/
+ @SuppressWarnings({ "UnusedDeclaration" })
public boolean isContainsJoinFetchedCollection() {
return containsJoinFetchedCollection;
}
@@ -163,6 +164,7 @@
*
* @return Value for property 'containsJoinFetchedBag'.
*/
+ @SuppressWarnings({ "UnusedDeclaration" })
public boolean isContainsJoinFetchedBag() {
return containsJoinFetchedBag;
}
Modified: core/trunk/core/src/main/java/org/hibernate/mapping/FetchProfile.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/mapping/FetchProfile.java 2010-07-13 15:06:59 UTC (rev 19943)
+++ core/trunk/core/src/main/java/org/hibernate/mapping/FetchProfile.java 2010-07-13 16:53:46 UTC (rev 19944)
@@ -26,32 +26,72 @@
import java.util.LinkedHashSet;
/**
- * A fetch profile allows a user to dynamically modify the fetching
- * strategy used for particular associations at runtime, whereas that
- * information was historically only statically defined in the metadata.
+ * A fetch profile allows a user to dynamically modify the fetching strategy used for particular associations at
+ * runtime, whereas that information was historically only statically defined in the metadata.
+ * <p/>
+ * This class represent the data as it is defined in their metadata.
*
* @author Steve Ebersole
+ *
+ * @see org.hibernate.engine.profile.FetchProfile
*/
public class FetchProfile {
private final String name;
- private LinkedHashSet fetches = new LinkedHashSet();
+ private final MetadataSource source;
+ private LinkedHashSet<Fetch> fetches = new LinkedHashSet<Fetch>();
- public FetchProfile(String name) {
+ /**
+ * Create a fetch profile representation.
+ *
+ * @param name The name of the fetch profile.
+ * @param source The source of the fetch profile (where was it defined).
+ */
+ public FetchProfile(String name, MetadataSource source) {
this.name = name;
+ this.source = source;
}
+ /**
+ * Retrieve the name of the fetch profile.
+ *
+ * @return The profile name
+ */
public String getName() {
return name;
}
- public LinkedHashSet getFetches() {
+ /**
+ * Retrieve the fetch profile source.
+ *
+ * @return The profile source.
+ */
+ public MetadataSource getSource() {
+ return source;
+ }
+
+ /**
+ * Retrieve the fetches associated with this profile
+ *
+ * @return The fetches associated with this profile.
+ */
+ public LinkedHashSet<Fetch> getFetches() {
return fetches;
}
+ /**
+ * Adds a fetch to this profile.
+ *
+ * @param entity The entity which contains the association to be fetched
+ * @param association The association to fetch
+ * @param style The style of fetch t apply
+ */
public void addFetch(String entity, String association, String style) {
fetches.add( new Fetch( entity, association, style ) );
}
+ /**
+ * {@inheritDoc}
+ */
public boolean equals(Object o) {
if ( this == o ) {
return true;
@@ -63,9 +103,11 @@
FetchProfile that = ( FetchProfile ) o;
return name.equals( that.name );
-
}
+ /**
+ * {@inheritDoc}
+ */
public int hashCode() {
return name.hashCode();
}
Added: core/trunk/core/src/main/java/org/hibernate/mapping/MetadataSource.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/mapping/MetadataSource.java (rev 0)
+++ core/trunk/core/src/main/java/org/hibernate/mapping/MetadataSource.java 2010-07-13 16:53:46 UTC (rev 19944)
@@ -0,0 +1,35 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
+ * indicated by the @author tags or express copyright attribution
+ * statements applied by the authors. All third-party contributions are
+ * distributed under license by Red Hat Inc.
+ *
+ * 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, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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
+ * along with this distribution; if not, write to:
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301 USA
+ */
+package org.hibernate.mapping;
+
+/**
+ * Enumeration of the known places from which a piece of metadata may come.
+ *
+ * @author Steve Ebersole
+ */
+public enum MetadataSource {
+ HBM,
+ ANNOTATIONS,
+ OTHER
+}
14 years, 4 months
Hibernate SVN: r19943 - search/trunk/hibernate-search/src/main/java/org/hibernate/search/backend/impl.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2010-07-13 11:06:59 -0400 (Tue, 13 Jul 2010)
New Revision: 19943
Modified:
search/trunk/hibernate-search/src/main/java/org/hibernate/search/backend/impl/EventSourceTransactionContext.java
search/trunk/hibernate-search/src/main/java/org/hibernate/search/backend/impl/PostTransactionWorkQueueSynchronization.java
Log:
HSEARCH-540 register both JTA Synchronization and action's registerProcess
This circumvent a bug in Core see email on the mailing list hibernate-dev
"Re: [hibernate-dev] Exceptions thrown in a tx synchronization are eaten"
The before tx completion process is called before tx synchronizations, and in JTA the auto-flush at the end of a session is done using a TX synchronization
Modified: search/trunk/hibernate-search/src/main/java/org/hibernate/search/backend/impl/EventSourceTransactionContext.java
===================================================================
--- search/trunk/hibernate-search/src/main/java/org/hibernate/search/backend/impl/EventSourceTransactionContext.java 2010-07-13 13:55:32 UTC (rev 19942)
+++ search/trunk/hibernate-search/src/main/java/org/hibernate/search/backend/impl/EventSourceTransactionContext.java 2010-07-13 15:06:59 UTC (rev 19943)
@@ -82,10 +82,25 @@
if ( isRealTransactionInProgress() ) {
//use {Before|After}TransactionCompletionProcess instead of registerTransaction because it does not
//swallow transactions.
+ /*
+ * HSEARCH-540: the pre process must be both a BeforeTransactionCompletionProcess and a TX Synchronization.
+ *
+ * In a resource-local tx env, the beforeCommit phase is called after the flush, and prepares work queue.
+ * Also, any exceptions that occur during that are propagated (if a Synchronization was used, the exceptions
+ * would be eaten).
+ *
+ * In a JTA env, the before transaction completion is called before the flush, so not all changes are yet
+ * written. However, Synchronization-s do propagate exceptions, so they can be safely used.
+ */
+
final ActionQueue actionQueue = eventSource.getActionQueue();
actionQueue.registerProcess( new DelegateToSynchronizationOnBeforeTx( synchronization ) );
+ eventSource.getTransaction().registerSynchronization(
+ new BeforeCommitSynchronizationDelegator( synchronization )
+ );
+
+ //executed in all environments
actionQueue.registerProcess( new DelegateToSynchronizationOnAfterTx( synchronization ) );
-// eventSource.getTransaction().registerSynchronization( synchronization );
}
else {
//registerSynchronization is only called if isRealTransactionInProgress or if
@@ -165,5 +180,21 @@
}
}
}
+
+ private static class BeforeCommitSynchronizationDelegator implements Synchronization {
+ private final Synchronization synchronization;
+
+ public BeforeCommitSynchronizationDelegator(Synchronization sync) {
+ this.synchronization = sync;
+ }
+
+ public void beforeCompletion() {
+ this.synchronization.beforeCompletion();
+ }
+
+ public void afterCompletion(int status) {
+ //do not delegate
+ }
+ }
}
Modified: search/trunk/hibernate-search/src/main/java/org/hibernate/search/backend/impl/PostTransactionWorkQueueSynchronization.java
===================================================================
--- search/trunk/hibernate-search/src/main/java/org/hibernate/search/backend/impl/PostTransactionWorkQueueSynchronization.java 2010-07-13 13:55:32 UTC (rev 19942)
+++ search/trunk/hibernate-search/src/main/java/org/hibernate/search/backend/impl/PostTransactionWorkQueueSynchronization.java 2010-07-13 15:06:59 UTC (rev 19943)
@@ -27,9 +27,12 @@
import javax.transaction.Status;
import javax.transaction.Synchronization;
+import org.slf4j.Logger;
+
import org.hibernate.search.backend.QueueingProcessor;
import org.hibernate.search.backend.Work;
import org.hibernate.search.backend.WorkQueue;
+import org.hibernate.search.util.LoggerFactory;
import org.hibernate.search.util.WeakIdentityHashMap;
/**
@@ -38,6 +41,8 @@
* @author Emmanuel Bernard
*/
public class PostTransactionWorkQueueSynchronization implements Synchronization {
+
+ private static final Logger log = LoggerFactory.make();
/**
* FullTextIndexEventListener is using a WeakIdentityHashMap<Session,Synchronization>
@@ -47,6 +52,7 @@
private final QueueingProcessor queueingProcessor;
private boolean consumed;
+ private boolean prepared;
private final WeakIdentityHashMap queuePerTransaction;
private WorkQueue queue = new WorkQueue();
@@ -67,7 +73,13 @@
}
public void beforeCompletion() {
- queueingProcessor.prepareWorks(queue);
+ if ( prepared ) {
+ log.trace("This transaction has already been processed, ignoring beforeCompletion()");
+ }
+ else {
+ queueingProcessor.prepareWorks(queue);
+ prepared = true;
+ }
}
public void afterCompletion(int i) {
14 years, 4 months
Hibernate SVN: r19942 - core/trunk/documentation/manual/src/main/docbook/en-US/content.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2010-07-13 09:55:32 -0400 (Tue, 13 Jul 2010)
New Revision: 19942
Modified:
core/trunk/documentation/manual/src/main/docbook/en-US/content/configuration.xml
Log:
HHH-5150 Added the properties hibernate.id.new_generator_mappings and hibernate.cache.default_cache_concurrency_strategy to the configuration poroperties section
Modified: core/trunk/documentation/manual/src/main/docbook/en-US/content/configuration.xml
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/en-US/content/configuration.xml 2010-07-13 10:40:39 UTC (rev 19941)
+++ core/trunk/documentation/manual/src/main/docbook/en-US/content/configuration.xml 2010-07-13 13:55:32 UTC (rev 19942)
@@ -475,10 +475,34 @@
<para> <emphasis role="strong">e.g.</emphasis>
<literal>true</literal> | <literal>false</literal> </para></entry>
</row>
+
+ <row>
+ <entry><property>hibernate.id.new_generator_mappings</property></entry>
+
+ <entry>Setting is relevant when using
+ <classname>@GeneratedValue</classname>. It indicates whether or
+ not the new <classname>IdentifierGenerator</classname>
+ implementations are used for
+ <classname>javax.persistence.GenerationType.AUTO</classname>,
+ <classname>javax.persistence.GenerationType.TABLE</classname> and
+ <classname>javax.persistence.GenerationType.SEQUENCE</classname>.
+ Default to <literal>false</literal> to keep backward
+ compatibility. <para> <emphasis role="strong">e.g.</emphasis>
+ <literal>true</literal> | <literal>false</literal> </para></entry>
+ </row>
</tbody>
</tgroup>
</table>
+ <note>
+ <para>We recommend all new projects which make use of to use
+ <classname>@GeneratedValue</classname> to also set
+ <code>hibernate.id.new_generator_mappings=true</code> as the new
+ generators are more efficient and closer to the JPA 2 specification
+ semantic. However they are not backward compatible with existing
+ databases (if a sequence or a table is used for id generation).</para>
+ </note>
+
<table frame="topbot" id="configuration-jdbc-properties" revision="8">
<title>Hibernate JDBC and Connection Properties</title>
@@ -518,11 +542,10 @@
<entry>Set this property to <literal>true</literal> if your JDBC
driver returns correct row counts from
- <literal>executeBatch()</literal>. It is usually safe to turn
- this option on. Hibernate will then use batched DML for
- automatically versioned data. Defaults to
- <literal>false</literal>. <para> <emphasis
- role="strong">e.g.</emphasis> <literal>true</literal> |
+ <literal>executeBatch()</literal>. It is usually safe to turn this
+ option on. Hibernate will then use batched DML for automatically
+ versioned data. Defaults to <literal>false</literal>. <para>
+ <emphasis role="strong">e.g.</emphasis> <literal>true</literal> |
<literal>false</literal> </para></entry>
</row>
@@ -723,6 +746,17 @@
role="strong">e.g.</emphasis> <literal>true|false</literal>
</para></entry>
</row>
+
+ <row>
+ <entry><literal>hibernate.cache.default_cache_concurrency_strategy</literal></entry>
+
+ <entry>Setting used to give the name of the default
+ <classname>org.hibernate.annotations.CacheConcurrencyStrategy</classname>
+ to use when either <classname>@Cacheable</classname> or
+ <classname>@Cache</classname> is used.
+ <code>@Cache(strategy="..")</code> is used to override this
+ default.</entry>
+ </row>
</tbody>
</tgroup>
</table>
14 years, 4 months
Hibernate SVN: r19941 - in core/trunk/entitymanager/src/test: java/org/hibernate/ejb/test/ops and 1 other directories.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2010-07-13 06:40:39 -0400 (Tue, 13 Jul 2010)
New Revision: 19941
Removed:
core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/EJB3TestCase.java
core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/ops/Child.java
core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/ops/FlushTest.java
core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/ops/Parent.java
core/trunk/entitymanager/src/test/resources/org/hibernate/ejb/test/ops/ParentChild.hbm.xml
Modified:
core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/ops/GetLoadTest.java
core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/ops/MergeTest.java
Log:
HHH-4945
* Removed obsolete testcase EJB3TestCase.
* Removed obsolete FlushTest (not clear what it really tested)
* Updated GetLoadTest and MergeTest to depend on ejb TestCase
Deleted: core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/EJB3TestCase.java
===================================================================
--- core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/EJB3TestCase.java 2010-07-12 12:04:08 UTC (rev 19940)
+++ core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/EJB3TestCase.java 2010-07-13 10:40:39 UTC (rev 19941)
@@ -1,225 +0,0 @@
-//$Id$
-package org.hibernate.ejb.test;
-
-import java.sql.Blob;
-import java.sql.Clob;
-import java.util.Iterator;
-import java.util.Properties;
-
-import org.hibernate.HibernateException;
-import org.hibernate.Interceptor;
-import org.hibernate.SessionFactory;
-import org.hibernate.cfg.Configuration;
-import org.hibernate.cfg.Environment;
-import org.hibernate.dialect.Dialect;
-import org.hibernate.ejb.event.EJB3AutoFlushEventListener;
-import org.hibernate.ejb.event.EJB3FlushEventListener;
-import org.hibernate.engine.SessionFactoryImplementor;
-import org.hibernate.event.AutoFlushEventListener;
-import org.hibernate.mapping.Collection;
-import org.hibernate.mapping.PersistentClass;
-import org.hibernate.mapping.Property;
-import org.hibernate.mapping.SimpleValue;
-
-/**
- * @author Gavin King
- */
-public abstract class EJB3TestCase extends junit.framework.TestCase {
- private static SessionFactory sessions;
- private static Configuration cfg;
- private static Dialect dialect;
- private static Class lastTestClass;
- private org.hibernate.classic.Session session;
-
- protected boolean recreateSchema() {
- return true;
- }
-
- public EJB3TestCase(String x) {
- super( x );
- }
-
- private void buildSessionFactory(String[] files) throws Exception {
-
- if ( getSessions() != null ) getSessions().close();
-
- try {
-
- setCfg( new Configuration() );
-
- cfg.addProperties( getExtraProperties() );
-
- if ( recreateSchema() ) {
- cfg.setProperty( Environment.HBM2DDL_AUTO, "create-drop" );
- }
-
- for ( int i = 0; i < files.length ; i++ ) {
- if ( !files[i].startsWith( "net/" ) ) files[i] = getBaseForMappings() + files[i];
- getCfg().addResource( files[i], TestCase.class.getClassLoader() );
- }
-
- setDialect( Dialect.getDialect() );
-
- configure( cfg );
-
- if ( getCacheConcurrencyStrategy() != null ) {
-
- Iterator iter = cfg.getClassMappings();
- while ( iter.hasNext() ) {
- PersistentClass clazz = (PersistentClass) iter.next();
- Iterator props = clazz.getPropertyClosureIterator();
- boolean hasLob = false;
- while ( props.hasNext() ) {
- Property prop = (Property) props.next();
- if ( prop.getValue().isSimpleValue() ) {
- String type = ( (SimpleValue) prop.getValue() ).getTypeName();
- if ( "blob".equals( type ) || "clob".equals( type ) ) hasLob = true;
- if ( Blob.class.getName().equals( type ) || Clob.class.getName().equals( type ) ) {
- hasLob = true;
- }
- }
- }
- if ( !hasLob && !clazz.isInherited() ) {
- cfg.setCacheConcurrencyStrategy(
- clazz.getEntityName(),
- getCacheConcurrencyStrategy()
- );
- }
- }
-
- iter = cfg.getCollectionMappings();
- while ( iter.hasNext() ) {
- Collection coll = (Collection) iter.next();
- cfg.setCollectionCacheConcurrencyStrategy(
- coll.getRole(),
- getCacheConcurrencyStrategy()
- );
- }
-
- }
-
- setSessions( getCfg().buildSessionFactory( /*new TestInterceptor()*/ ) );
-
- }
- catch (Exception e) {
- e.printStackTrace();
- throw e;
- }
-
- }
-
- public String getCacheConcurrencyStrategy() {
- return "nonstrict-read-write";
- }
-
- protected void setUp() throws Exception {
- if ( getSessions() == null || lastTestClass != getClass() || getSessions().isClosed() ) {
- buildSessionFactory( getMappings() );
- lastTestClass = getClass();
- }
- }
-
- protected void tearDown() throws Exception {
- if (getSessions() != null && !getSessions().isClosed()) {
- getSessions().close();
- }
- }
-
- protected void runTest() throws Throwable {
- final boolean stats = ( (SessionFactoryImplementor) sessions ).getStatistics().isStatisticsEnabled();
- try {
- if ( stats ) sessions.getStatistics().clear();
-
- super.runTest();
-
- if ( stats ) sessions.getStatistics().logSummary();
-
- if ( session != null && session.isOpen() ) {
- if ( session.isConnected() ) session.connection().rollback();
- session.close();
- session = null;
- fail( "unclosed session" );
- }
- else {
- session = null;
- }
- }
- catch (Throwable e) {
- try {
- if ( session != null && session.isOpen() ) {
- if ( session.isConnected() ) session.connection().rollback();
- session.close();
- }
- }
- catch (Exception ignore) {
- }
- try {
- if ( dropAfterFailure() && sessions != null ) {
- sessions.close();
- sessions = null;
- }
- }
- catch (Exception ignore) {
- }
- throw e;
- }
- }
-
- protected boolean dropAfterFailure() {
- return true;
- }
-
- public org.hibernate.classic.Session openSession() throws HibernateException {
- session = getSessions().openSession();
- return session;
- }
-
- public org.hibernate.classic.Session openSession(Interceptor interceptor)
- throws HibernateException {
- session = getSessions().openSession( interceptor );
- return session;
- }
-
- protected abstract String[] getMappings();
-
- private void setSessions(SessionFactory sessions) {
- EJB3TestCase.sessions = sessions;
- }
-
- protected SessionFactory getSessions() {
- return sessions;
- }
-
- private void setDialect(Dialect dialect) {
- EJB3TestCase.dialect = dialect;
- }
-
- protected Dialect getDialect() {
- return dialect;
- }
-
- protected static void setCfg(Configuration cfg) {
- EJB3TestCase.cfg = cfg;
- }
-
- protected static Configuration getCfg() {
- return cfg;
- }
-
- /**
- * @deprecated
- */
- public Properties getExtraProperties() {
- return new Properties();
- }
-
- protected String getBaseForMappings() {
- return "org/hibernate/ejb/test/";
- }
-
- protected void configure(Configuration cfg) {
- cfg.setListener( "flush", EJB3FlushEventListener.INSTANCE );
- cfg.setListeners( "auto-flush", new AutoFlushEventListener[]{EJB3AutoFlushEventListener.INSTANCE} );
- }
-
-}
Deleted: core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/ops/Child.java
===================================================================
--- core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/ops/Child.java 2010-07-12 12:04:08 UTC (rev 19940)
+++ core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/ops/Child.java 2010-07-13 10:40:39 UTC (rev 19941)
@@ -1,43 +0,0 @@
-//$Id$
-package org.hibernate.ejb.test.ops;
-
-/**
- * @author Emmanuel Bernard
- */
-public class Child {
- private String name;
- private int age;
-
- Child() {
- }
-
- public Child(String name) {
- this.name = name;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public int getAge() {
- return age;
- }
-
- public void setAge(int age) {
- this.age = age;
- }
-
- private Parent parent;
-
- public Parent getParent() {
- return parent;
- }
-
- public void setParent(Parent parent) {
- this.parent = parent;
- }
-}
Deleted: core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/ops/FlushTest.java
===================================================================
--- core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/ops/FlushTest.java 2010-07-12 12:04:08 UTC (rev 19940)
+++ core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/ops/FlushTest.java 2010-07-13 10:40:39 UTC (rev 19941)
@@ -1,49 +0,0 @@
-//$Id$
-package org.hibernate.ejb.test.ops;
-
-import org.hibernate.Session;
-import org.hibernate.Transaction;
-import org.hibernate.ejb.test.EJB3TestCase;
-
-/**
- * @author Emmanuel Bernard
- */
-public class FlushTest extends EJB3TestCase {
-
- public void testPersistCascasde() {
- Session s = openSession();
- Transaction t = s.beginTransaction();
-
- Parent p = new Parent( "Marc" );
- Parent p2 = new Parent( "Nathalie" );
-
- // FAILS
- s.persist( p );
- s.persist( p2 );
-
- Child c = new Child( "Elvira" );
- Child c2 = new Child( "Blase" );
- p.getChildren().add( c );
- c.setParent( p );
- p.getChildren().add( c2 );
- c2.setParent( p );
-
- // WORKS
- //s.persist(p);
- //s.persist(p2);
-
- t.commit();
- s.close();
-
- }
-
- public FlushTest(String x) {
- super( x );
- }
-
- protected String[] getMappings() {
- return new String[]{
- "ops/ParentChild.hbm.xml"
- };
- }
-}
Modified: core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/ops/GetLoadTest.java
===================================================================
--- core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/ops/GetLoadTest.java 2010-07-12 12:04:08 UTC (rev 19940)
+++ core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/ops/GetLoadTest.java 2010-07-13 10:40:39 UTC (rev 19941)
@@ -1,114 +1,139 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
+ * indicated by the @author tags or express copyright attribution
+ * statements applied by the authors. All third-party contributions are
+ * distributed under license by Red Hat Inc.
+ *
+ * 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, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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
+ * along with this distribution; if not, write to:
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301 USA
+ */
+
//$Id$
package org.hibernate.ejb.test.ops;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import java.util.Map;
+import javax.persistence.EntityManager;
+
import org.hibernate.Hibernate;
import org.hibernate.Session;
-import org.hibernate.Transaction;
-import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment;
-import org.hibernate.ejb.test.EJB3TestCase;
+import org.hibernate.ejb.EntityManagerFactoryImpl;
+import org.hibernate.ejb.test.TestCase;
/**
* @author Gavin King
+ * @author Hardy Ferentschik
*/
-public class GetLoadTest extends EJB3TestCase {
+public class GetLoadTest extends TestCase {
- public GetLoadTest(String str) {
- super( str );
- }
-
public void testGetLoad() {
clearCounts();
- Session s = openSession();
- Transaction tx = s.beginTransaction();
+ EntityManager em = getOrCreateEntityManager();
+ em.getTransaction().begin();
+ Session s = ( Session ) em.getDelegate();
+
Employer emp = new Employer();
s.persist( emp );
Node node = new Node( "foo" );
Node parent = new Node( "bar" );
parent.addChild( node );
s.persist( parent );
- tx.commit();
- s.close();
+ em.getTransaction().commit();
+ em.close();
- s = openSession();
- tx = s.beginTransaction();
- emp = (Employer) s.get( Employer.class, emp.getId() );
+ em = getOrCreateEntityManager();
+ em.getTransaction().begin();
+ s = ( Session ) em.getDelegate();
+ emp = ( Employer ) s.get( Employer.class, emp.getId() );
assertTrue( Hibernate.isInitialized( emp ) );
assertFalse( Hibernate.isInitialized( emp.getEmployees() ) );
- node = (Node) s.get( Node.class, node.getName() );
+ node = ( Node ) s.get( Node.class, node.getName() );
assertTrue( Hibernate.isInitialized( node ) );
assertFalse( Hibernate.isInitialized( node.getChildren() ) );
assertFalse( Hibernate.isInitialized( node.getParent() ) );
assertNull( s.get( Node.class, "xyz" ) );
- tx.commit();
- s.close();
+ em.getTransaction().commit();
+ em.close();
- s = openSession();
- tx = s.beginTransaction();
- emp = (Employer) s.load( Employer.class, emp.getId() );
+ em = getOrCreateEntityManager();
+ em.getTransaction().begin();
+ s = ( Session ) em.getDelegate();
+ emp = ( Employer ) s.load( Employer.class, emp.getId() );
emp.getId();
assertFalse( Hibernate.isInitialized( emp ) );
- node = (Node) s.load( Node.class, node.getName() );
+ node = ( Node ) s.load( Node.class, node.getName() );
assertEquals( node.getName(), "foo" );
assertFalse( Hibernate.isInitialized( node ) );
- tx.commit();
- s.close();
+ em.getTransaction().commit();
+ em.close();
- s = openSession();
- tx = s.beginTransaction();
- emp = (Employer) s.get( "org.hibernate.ejb.test.ops.Employer", emp.getId() );
+ em = getOrCreateEntityManager();
+ em.getTransaction().begin();
+ s = ( Session ) em.getDelegate();
+ emp = ( Employer ) s.get( "org.hibernate.ejb.test.ops.Employer", emp.getId() );
assertTrue( Hibernate.isInitialized( emp ) );
- node = (Node) s.get( "org.hibernate.ejb.test.ops.Node", node.getName() );
+ node = ( Node ) s.get( "org.hibernate.ejb.test.ops.Node", node.getName() );
assertTrue( Hibernate.isInitialized( node ) );
- tx.commit();
- s.close();
+ em.getTransaction().commit();
+ em.close();
- s = openSession();
- tx = s.beginTransaction();
- emp = (Employer) s.load( "org.hibernate.ejb.test.ops.Employer", emp.getId() );
+ em = getOrCreateEntityManager();
+ em.getTransaction().begin();
+ s = ( Session ) em.getDelegate();
+ emp = ( Employer ) s.load( "org.hibernate.ejb.test.ops.Employer", emp.getId() );
emp.getId();
assertFalse( Hibernate.isInitialized( emp ) );
- node = (Node) s.load( "org.hibernate.ejb.test.ops.Node", node.getName() );
+ node = ( Node ) s.load( "org.hibernate.ejb.test.ops.Node", node.getName() );
assertEquals( node.getName(), "foo" );
assertFalse( Hibernate.isInitialized( node ) );
- tx.commit();
- s.close();
+ em.getTransaction().commit();
+ em.close();
assertFetchCount( 0 );
}
private void clearCounts() {
- getSessions().getStatistics().clear();
+ ( ( EntityManagerFactoryImpl ) factory ).getSessionFactory().getStatistics().clear();
}
private void assertFetchCount(int count) {
- int fetches = (int) getSessions().getStatistics().getEntityFetchCount();
+ int fetches = ( int ) ( ( EntityManagerFactoryImpl ) factory ).getSessionFactory()
+ .getStatistics()
+ .getEntityFetchCount();
assertEquals( count, fetches );
}
- protected void configure(Configuration cfg) {
- super.configure( cfg );
- cfg.setProperty( Environment.GENERATE_STATISTICS, "true" );
- cfg.setProperty( Environment.STATEMENT_BATCH_SIZE, "0" );
+ @Override
+ protected void addConfigOptions(Map options) {
+ options.put( Environment.GENERATE_STATISTICS, "true" );
+ options.put( Environment.STATEMENT_BATCH_SIZE, "0" );
}
+ @Override
+ protected Class<?>[] getAnnotatedClasses() {
+ return new Class<?>[0];
+ }
+
protected String[] getMappings() {
- return new String[]{
- "ops/Node.hbm.xml",
- "ops/Employer.hbm.xml"
+ return new String[] {
+ "org/hibernate/ejb/test/ops/Node.hbm.xml",
+ "org/hibernate/ejb/test/ops/Employer.hbm.xml"
};
}
-
- public static Test suite() {
- return new TestSuite( GetLoadTest.class );
- }
-
- public String getCacheConcurrencyStrategy() {
- return null;
- }
-
}
Modified: core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/ops/MergeTest.java
===================================================================
--- core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/ops/MergeTest.java 2010-07-12 12:04:08 UTC (rev 19940)
+++ core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/ops/MergeTest.java 2010-07-13 10:40:39 UTC (rev 19941)
@@ -1,35 +1,53 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
+ * indicated by the @author tags or express copyright attribution
+ * statements applied by the authors. All third-party contributions are
+ * distributed under license by Red Hat Inc.
+ *
+ * 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, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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
+ * along with this distribution; if not, write to:
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301 USA
+ */
//$Id$
package org.hibernate.ejb.test.ops;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.hibernate.Session;
-import org.hibernate.Transaction;
-import org.hibernate.cfg.Configuration;
+import java.util.Map;
+import javax.persistence.EntityManager;
+
import org.hibernate.cfg.Environment;
-import org.hibernate.ejb.test.EJB3TestCase;
+import org.hibernate.ejb.EntityManagerFactoryImpl;
+import org.hibernate.ejb.test.TestCase;
/**
* @author Gavin King
+ * @author Hardy Ferentschik
*/
-public class MergeTest extends EJB3TestCase {
+public class MergeTest extends TestCase {
- public MergeTest(String str) {
- super( str );
- }
-
public void testMergeTree() {
-
clearCounts();
- Session s = openSession();
- Transaction tx = s.beginTransaction();
+ EntityManager em = getOrCreateEntityManager();
+ em.getTransaction().begin();
Node root = new Node( "root" );
Node child = new Node( "child" );
root.addChild( child );
- s.persist( root );
- tx.commit();
- s.close();
+ em.persist( root );
+ em.getTransaction().commit();
+ em.close();
assertInsertCount( 2 );
clearCounts();
@@ -41,29 +59,27 @@
root.addChild( secondChild );
- s = openSession();
- tx = s.beginTransaction();
- s.merge( root );
- tx.commit();
- s.close();
+ em = getOrCreateEntityManager();
+ em.getTransaction().begin();
+ em.merge( root );
+ em.getTransaction().commit();
+ em.close();
assertInsertCount( 1 );
assertUpdateCount( 2 );
-
}
public void testMergeTreeWithGeneratedId() {
-
clearCounts();
- Session s = openSession();
- Transaction tx = s.beginTransaction();
+ EntityManager em = getOrCreateEntityManager();
+ em.getTransaction().begin();
NumberedNode root = new NumberedNode( "root" );
NumberedNode child = new NumberedNode( "child" );
root.addChild( child );
- s.persist( root );
- tx.commit();
- s.close();
+ em.persist( root );
+ em.getTransaction().commit();
+ em.close();
assertInsertCount( 2 );
clearCounts();
@@ -75,44 +91,48 @@
root.addChild( secondChild );
- s = openSession();
- tx = s.beginTransaction();
- s.merge( root );
- tx.commit();
- s.close();
+ em = getOrCreateEntityManager();
+ em.getTransaction().begin();
+ em.merge( root );
+ em.getTransaction().commit();
+ em.close();
assertInsertCount( 1 );
assertUpdateCount( 2 );
-
}
private void clearCounts() {
- getSessions().getStatistics().clear();
+ ( ( EntityManagerFactoryImpl ) factory ).getSessionFactory().getStatistics().clear();
}
private void assertInsertCount(int count) {
- int inserts = (int) getSessions().getStatistics().getEntityInsertCount();
+ int inserts = ( int ) ( ( EntityManagerFactoryImpl ) factory ).getSessionFactory()
+ .getStatistics()
+ .getEntityInsertCount();
assertEquals( count, inserts );
}
private void assertUpdateCount(int count) {
- int updates = (int) getSessions().getStatistics().getEntityUpdateCount();
+ int updates = ( int ) ( ( EntityManagerFactoryImpl ) factory ).getSessionFactory()
+ .getStatistics()
+ .getEntityUpdateCount();
assertEquals( count, updates );
}
- protected void configure(Configuration cfg) {
- super.configure( cfg );
- cfg.setProperty( Environment.GENERATE_STATISTICS, "true" );
- cfg.setProperty( Environment.STATEMENT_BATCH_SIZE, "0" );
+ @Override
+ protected void addConfigOptions(Map options) {
+ options.put( Environment.GENERATE_STATISTICS, "true" );
+ options.put( Environment.STATEMENT_BATCH_SIZE, "0" );
}
- protected String[] getMappings() {
- return new String[]{"ops/Node.hbm.xml"};
+ @Override
+ protected Class<?>[] getAnnotatedClasses() {
+ return new Class<?>[0];
}
- public static Test suite() {
- return new TestSuite( MergeTest.class );
+ @Override
+ protected String[] getMappings() {
+ return new String[] { "org/hibernate/ejb/test/ops/Node.hbm.xml" };
}
-
}
Deleted: core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/ops/Parent.java
===================================================================
--- core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/ops/Parent.java 2010-07-12 12:04:08 UTC (rev 19940)
+++ core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/ops/Parent.java 2010-07-13 10:40:39 UTC (rev 19941)
@@ -1,36 +0,0 @@
-//$Id$
-package org.hibernate.ejb.test.ops;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author Emmanuel Bernard
- */
-public class Parent {
- private String name;
- private List children = new ArrayList();
-
- Parent() {
- }
-
- public Parent(String name) {
- this.name = name;
- }
-
- public List getChildren() {
- return children;
- }
-
- public void setChildren(List children) {
- this.children = children;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-}
Deleted: core/trunk/entitymanager/src/test/resources/org/hibernate/ejb/test/ops/ParentChild.hbm.xml
===================================================================
--- core/trunk/entitymanager/src/test/resources/org/hibernate/ejb/test/ops/ParentChild.hbm.xml 2010-07-12 12:04:08 UTC (rev 19940)
+++ core/trunk/entitymanager/src/test/resources/org/hibernate/ejb/test/ops/ParentChild.hbm.xml 2010-07-13 10:40:39 UTC (rev 19941)
@@ -1,25 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE hibernate-mapping PUBLIC
- "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
- "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-
-<hibernate-mapping
- package="org.hibernate.ejb.test.ops">
-
- <class name="Parent">
- <id name="name"/>
- <list name="children" cascade="persist,merge">
- <key column="parentName" not-null="true"/>
- <list-index column="sibling"/>
- <one-to-many class="Child"/>
- </list>
- </class>
-
- <class name="Child">
- <id name="name"/>
- <property name="age" not-null="true"/>
- <many-to-one name="parent" column="parentName"
- not-null="true" insert="false" update="false"/>
- </class>
-
-</hibernate-mapping>
\ No newline at end of file
14 years, 4 months
Hibernate SVN: r19940 - in tools/trunk/src: javadoc and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2010-07-12 08:04:08 -0400 (Mon, 12 Jul 2010)
New Revision: 19940
Added:
tools/trunk/src/javadoc/
tools/trunk/src/javadoc/jdstyle.css
tools/trunk/src/javadoc/package.html
Log:
HBX-1163 missed javadoc folder
Added: tools/trunk/src/javadoc/jdstyle.css
===================================================================
--- tools/trunk/src/javadoc/jdstyle.css (rev 0)
+++ tools/trunk/src/javadoc/jdstyle.css 2010-07-12 12:04:08 UTC (rev 19940)
@@ -0,0 +1,117 @@
+/* Javadoc style sheet */
+
+/* Define colors, fonts and other style attributes here to override the defaults */
+
+/* Page background color */
+body { font-family: Arial;
+ background-color: white;
+ font-size: 10pt;
+ }
+td { font-family: Arial;
+ font-size: 10pt;
+ }
+/* Table colors */
+.TableHeadingColor { background: #F4F4F4 }
+.TableSubHeadingColor { background: #F4F4F4 }
+.TableRowColor { background: #FFFFFF }
+
+/* Font used in left-hand frame lists */
+.FrameTitleFont { font-size: normal; font-family: Arial }
+.FrameHeadingFont { font-size: normal; font-family: Arial }
+.FrameItemFont { font-size: normal; font-family: Arial }
+
+/* Example of smaller, sans-serif font in frames */
+/* .FrameItemFont { font-size: 10pt; font-family: Helvetica, Arial, sans-serif } */
+
+/* Navigation bar fonts and colors */
+.NavBarCell1 { background-color:#F4F4F4;}
+.NavBarCell1Rev { background-color:silver;}
+
+.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;}
+.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;}
+
+.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;}
+.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;}
+
+A {
+ color: #003399;
+}
+
+A:active {
+ color: #003399;
+}
+
+A:visited {
+ color: #888888;
+}
+
+P, OL, UL, LI, DL, DT, DD, BLOCKQUOTE {
+ color: #000000;
+}
+
+TD, TH, SPAN {
+ color: #000000;
+}
+
+BLOCKQUOTE {
+ margin-right: 0px;
+}
+
+
+/*H1, H2, H3, H4, H5, H6 {
+ color: #000000;
+ font-weight:500;
+ margin-top:10px;
+ padding-top:15px;
+}
+
+H1 { font-size: 150%; }
+H2 { font-size: 140%; }
+H3 { font-size: 110%; font-weight: bold; }
+H4 { font-size: 110%; font-weight: bold;}
+H5 { font-size: 100%; font-style: italic; }
+H6 { font-size: 100%; font-style: italic; }*/
+
+TT {
+font-size: 90%;
+ font-family: "Courier New", Courier, monospace;
+ color: #000000;
+}
+
+PRE {
+font-size: 90%;
+ padding: 5px;
+ border-style: solid;
+ border-width: 1px;
+ border-color: #CCCCCC;
+ background-color: #F4F4F4;
+}
+
+UL, OL, LI {
+ list-style: disc;
+}
+
+HR {
+ width: 100%;
+ height: 1px;
+ background-color: #CCCCCC;
+ border-width: 0px;
+ padding: 0px;
+ color: #CCCCCC;
+}
+
+.variablelist {
+ padding-top: 10;
+ padding-bottom:10;
+ margin:0;
+}
+
+.itemizedlist, UL {
+ padding-top: 0;
+ padding-bottom:0;
+ margin:0;
+}
+
+.term {
+ font-weight:bold;
+}
Added: tools/trunk/src/javadoc/package.html
===================================================================
--- tools/trunk/src/javadoc/package.html (rev 0)
+++ tools/trunk/src/javadoc/package.html 2010-07-12 12:04:08 UTC (rev 19940)
@@ -0,0 +1 @@
+<body></body>
14 years, 4 months
Hibernate SVN: r19939 - in tools/trunk/src: assembly and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2010-07-12 08:02:26 -0400 (Mon, 12 Jul 2010)
New Revision: 19939
Added:
tools/trunk/src/assembly/
tools/trunk/src/assembly/dist.xml
Log:
HBX-1163 missed assembly folder
Added: tools/trunk/src/assembly/dist.xml
===================================================================
--- tools/trunk/src/assembly/dist.xml (rev 0)
+++ tools/trunk/src/assembly/dist.xml 2010-07-12 12:02:26 UTC (rev 19939)
@@ -0,0 +1,49 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<assembly>
+ <id>dist</id>
+ <formats>
+ <format>tar.gz</format>
+ <format>zip</format>
+ </formats>
+
+ <dependencySets>
+ <dependencySet>
+ <useProjectArtifact>false</useProjectArtifact>
+ <outputDirectory>/lib</outputDirectory>
+ <scope>runtime</scope>
+ </dependencySet>
+ </dependencySets>
+
+ <fileSets>
+ <fileSet>
+ <directory>target</directory>
+ <outputDirectory></outputDirectory>
+ <excludes>
+ <exclude>*-javadoc.jar</exclude>
+ <exclude>*-sources.jar</exclude>
+ </excludes>
+ <includes>
+ <include>hibernate-*.jar</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>.</directory>
+ <outputDirectory></outputDirectory>
+ <useDefaultExcludes>true</useDefaultExcludes>
+ <includes>
+ <include>lgpl.txt</include>
+ <include>readme.txt</include>
+ <include>changelog.txt</include>
+ <include>pom.xml</include>
+ <include>src/templates/**/*</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>src/java/org</directory>
+ <outputDirectory>/src/org</outputDirectory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+</assembly>
14 years, 4 months
Hibernate SVN: r19938 - core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/proxy.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2010-07-12 06:00:13 -0400 (Mon, 12 Jul 2010)
New Revision: 19938
Modified:
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/proxy/LazyInitializer.java
Log:
typo in javadoc
Modified: core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/proxy/LazyInitializer.java
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/proxy/LazyInitializer.java 2010-07-12 08:25:31 UTC (rev 19937)
+++ core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/proxy/LazyInitializer.java 2010-07-12 10:00:13 UTC (rev 19938)
@@ -44,14 +44,14 @@
public void initialize() throws HibernateException;
/**
- * Retrieve the identifier value for the enity our owning proxy represents.
+ * Retrieve the identifier value for the entity our owning proxy represents.
*
* @return The identifier value.
*/
public Serializable getIdentifier();
/**
- * Set the identifier value for the enity our owning proxy represents.
+ * Set the identifier value for the entity our owning proxy represents.
*
* @param id The identifier value.
*/
@@ -72,7 +72,7 @@
public Class getPersistentClass();
/**
- * Is the proxy uninitialzed?
+ * Is the proxy uninitialized?
*
* @return True if uninitialized; false otherwise.
*/
@@ -115,9 +115,9 @@
* Associate the proxy with the given session.
* <p/>
* Care should be given to make certain that the proxy is added to the session's persistence context as well
- * to maintain the symetry of the association. That must be done seperately as this method simply sets an
+ * to maintain the symmetry of the association. That must be done separately as this method simply sets an
* internal reference. We do also check that if there is already an associated session that the proxy
- * reference was removed from that previous session's persistence contet.
+ * reference was removed from that previous session's persistence context.
*
* @param session The session
* @throws HibernateException Indicates that the proxy was still contained in the persistence context of the
14 years, 4 months
Hibernate SVN: r19937 - in tools/trunk: src/test/org/hibernate/tool/test/jdbc2cfg and 2 other directories.
by hibernate-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2010-07-12 04:25:31 -0400 (Mon, 12 Jul 2010)
New Revision: 19937
Added:
tools/trunk/pom.xml
tools/trunk/src/test/org/hibernate/tool/test/jdbc2cfg/Item.java
tools/trunk/src/test/org/hibernate/tool/test/jdbc2cfg/Orders.java
Modified:
tools/trunk/src/test/org/hibernate/tool/test/jdbc2cfg/ManyToManyTest.java
tools/trunk/src/test/org/hibernate/tool/test/jdbc2cfg/PersistentClassesTest.java
tools/trunk/src/test/org/hibernate/tool/test/jdbc2cfg/TernarySchemaTest.java
tools/trunk/src/test/org/hibernate/tool/test/jdbc2cfg/identity/MySQLIdentityTest.java
tools/trunk/src/testsupport/anttest-build.xml
tools/trunk/src/testsupport/coretest-build.xml
tools/trunk/src/testsupport/javaformattest-build.xml
tools/trunk/src/testsupport/seamtest-build.xml
Log:
HBX-1163 first cut on mavenized build
Added: tools/trunk/pom.xml
===================================================================
--- tools/trunk/pom.xml (rev 0)
+++ tools/trunk/pom.xml 2010-07-12 08:25:31 UTC (rev 19937)
@@ -0,0 +1,935 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-tools</artifactId>
+ <version>3.4.0.M1</version>
+ <packaging>jar</packaging>
+
+ <issueManagement>
+ <system>JIRA</system>
+ <url>http://opensource.atlassian.com/projects/hibernate/browse/HBX
+ </url>
+ </issueManagement>
+
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/hibernate/branches/Branch_3_2/Hibe...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/hibernate/branches/Branch_3_2/Hiberna...</developerConnection>
+ <url>http://fisheye.jboss.com/browse/Hibernate/branches/Branch_3_2/HibernateEx...</url>
+ </scm>
+
+ <organization>
+ <name>Hibernate</name>
+ <url>http://www.hibernate.org</url>
+ </organization>
+
+ <licenses>
+ <license>
+ <name>GNU Lesser General Public License</name>
+ <url>http://www.gnu.org/licenses/lgpl-2.1.html</url>
+ </license>
+ </licenses>
+
+ <developers>
+ <developer>
+ <id>max</id>
+ <name>Max Andersen</name>
+ <email>max(a)hibernate.org</email>
+ <url>http://in.relation.to/Bloggers/Max</url>
+ </developer>
+ </developers>
+
+ <name>Hibernate Tools Core</name>
+ <description>The core functionality of Hibernate Tools</description>
+
+ <properties>
+ <hibernateVersion>3.3.2.GA</hibernateVersion>
+ <hibernateAnnotationsVersion>3.3.0.ga</hibernateAnnotationsVersion>
+ <hibernateEntitymanagerVersion>3.3.1.ga</hibernateEntitymanagerVersion>
+ <hibernateCommonsAnnotationVersion>3.3.0.ga</hibernateCommonsAnnotationVersion>
+ <hsqldbVersion>1.8.0.2</hsqldbVersion>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <!--
+ Graphviz should be installed for junit tests and it's bin dir should
+ be in classpath
+ -->
+ <!-- TODO: is it possible to automate this with maven? -->
+
+ <dependencies>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-core</artifactId>
+ <version>${hibernateVersion}</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-commons-annotations</artifactId>
+ <version>${hibernateCommonsAnnotationVersion}</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ <version>1.1</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-annotations</artifactId>
+ <version>${hibernateAnnotationsVersion}</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-entitymanager</artifactId>
+ <version>${hibernateEntitymanagerVersion}</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>ant</groupId>
+ <artifactId>ant</artifactId>
+ <version>1.6.5</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>ant</groupId>
+ <artifactId>ant-launcher</artifactId>
+ <version>1.6.5</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.5.8</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>freemarker</groupId>
+ <artifactId>freemarker</artifactId>
+ <version>2.3.8</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>jtidy</artifactId>
+ <version>r8-20060801</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jdt</groupId>
+ <artifactId>org.eclipse.jdt.core</artifactId>
+ <version>3.2.0-v_671</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse</groupId>
+ <artifactId>text</artifactId>
+ <version>3.2.0-v20060605-1400</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.core</groupId>
+ <artifactId>runtime</artifactId>
+ <version>3.2.0-v20060603</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.equinox</groupId>
+ <artifactId>common</artifactId>
+ <version>3.2.0-v20060603</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>jaxen</groupId>
+ <artifactId>jaxen</artifactId>
+ <version>1.1</version>
+ <scope>test</scope>
+ </dependency>
+ <!-- <dependency>
+ <groupId>com.sun</groupId>
+ <artifactId>tools</artifactId>
+ <version>1.5.0_12</version>
+ <scope>system</scope>
+ <systemPath>${java.home}/../lib/tools.jar</systemPath>
+ </dependency> -->
+ </dependencies>
+
+ <build>
+ <defaultGoal>install</defaultGoal>
+ <sourceDirectory>./src/java</sourceDirectory>
+ <testSourceDirectory>./src/test</testSourceDirectory>
+ <resources>
+ <resource>
+ <directory>src/templates</directory>
+ </resource>
+ <resource>
+ <directory>src/java</directory>
+ <includes>
+ <include>org/hibernate/*.dtd</include>
+ <include>org/hibernate/**/*.properties</include>
+ </includes>
+ </resource>
+ </resources>
+ <!--testResources>
+ <testResource>
+ <filtering>true</filtering>
+ <directory>etc</directory>
+ <includes>
+ <include>**/*.properties</include>
+ </includes>
+ </testResource>
+ </testResources-->
+ <plugins>
+ <plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <version>2.4.1</version>
+ <executions>
+ <execution>
+ <id>auto-clean</id>
+ <phase>initialize</phase>
+ <goals>
+ <goal>clean</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>testdb</directory>
+ </fileset>
+ <fileset>
+ <directory>test_output</directory>
+ </fileset>
+ <fileset>
+ <directory>toolstestoutput</directory>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>properties-maven-plugin</artifactId>
+ <version>1.0-alpha-2</version>
+ <executions>
+ <execution>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>write-active-profile-properties</goal>
+ </goals>
+ <configuration>
+ <outputFile>
+ ${project.build.directory}/test-classes/hibernate.properties
+ </outputFile>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.4</version>
+ <executions>
+ <execution>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <echo></echo>
+ <copy file="${project.build.directory}/test-classes/hibernate.properties" tofile="${project.build.directory}/test-classes/log4j.properties" />
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>add-test-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-test-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>./src/testsupport</source>
+ </sources>
+ </configuration>
+ </execution>
+ <execution>
+ <id>add-test-resource</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>add-test-resource</goal>
+ </goals>
+ <configuration>
+ <resources>
+ <resource>
+ <directory>./src/test</directory>
+ <includes>
+ <include>**/*.xml</include>
+ </includes>
+ </resource>
+ <resource>
+ <directory>./src/testoutputdependent</directory>
+ </resource>
+ <resource>
+ <directory>./src/testsupport</directory>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.1</version>
+ <configuration>
+ <includes>
+ <include>**/*.java</include>
+ </includes>
+ <source>1.4</source>
+ <target>1.4</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <Implementation-Title>${project.name}</Implementation-Title>
+ <Implementation-Version>${project.version}</Implementation-Version>
+ <Implementation-Vendor>hibernate.org</Implementation-Vendor>
+ <Implementation-Vendor-Id>hibernate.org
+ </Implementation-Vendor-Id>
+ <Implementation-URL>http://www.hibernate.org/subprojects/tools.html
+ </Implementation-URL>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.5</version>
+ <configuration>
+ <stylesheetfile>${basedir}/src/javadoc/jdstyle.css</stylesheetfile>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptors>
+ <descriptor>./src/assembly/dist.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <repositories>
+ <!--
+ To build Hibernate Tools Core you have to add the JBoss Maven
+ repository to your settings.xml See also
+ http://community.jboss.org/wiki/ContributingtoHibernateSearch
+ -->
+ </repositories>
+
+
+ <profiles>
+ <profile>
+ <id>log4j.properties</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <properties>
+ <!--### direct log messages to stdout ###-->
+ <log4j.appender.stdout>org.apache.log4j.ConsoleAppender</log4j.appender.stdout>
+ <log4j.appender.stdout.Target>System.err</log4j.appender.stdout.Target>
+ <log4j.appender.stdout.layout>org.apache.log4j.PatternLayout</log4j.appender.stdout.layout>
+ <log4j.appender.stdout.layout.ConversionPattern>%d{ABSOLUTE} %5p %c - %m%n</log4j.appender.stdout.layout.ConversionPattern>
+ <!--### direct messages to file hibernate.log ###-->
+ <!--
+ <log4j.appender.file>org.apache.log4j.FileAppender</log4j.appender.file>
+ <log4j.appender.file.File>hibernate.log</log4j.appender.file.File>
+ <log4j.appender.file.layout>org.apache.log4j.PatternLayout</log4j.appender.file.layout>
+ <log4j.appender.file.layout.ConversionPattern>%d{ABSOLUTE} %5p %c{1}:%L - %m%n</log4j.appender.file.layout.ConversionPattern>
+ -->
+ <!--### set log levels - for more verbose logging change 'info' to 'debug' ###-->
+ <log4j.rootLogger>info, stdout</log4j.rootLogger>
+ <log4j.logger.org.hibernate>info</log4j.logger.org.hibernate>
+ <log4j.logger.org.hibernate.cfg.SettingsFactory>warn</log4j.logger.org.hibernate.cfg.SettingsFactory>
+ <log4j.logger.org.hibernate.cfg.reveng>debug</log4j.logger.org.hibernate.cfg.reveng>
+ <log4j.logger.org.hibernate.cfg.JDBCMetaDataConfiguration>debug</log4j.logger.org.hibernate.cfg.JDBCMetaDataConfiguration>
+ <log4j.logger.org.hibernate.cfg.JDBCBinder>debug</log4j.logger.org.hibernate.cfg.JDBCBinder>
+ <!--log4j.logger.freemarker>debug</log4j.logger.freemarker-->
+ <!--### log just the SQL-->
+ <!--log4j.logger.org.hibernate.SQL>debug</log4j.logger.org.hibernate.SQL-->
+ <!--### log JDBC bind parameters ###-->
+ <!--log4j.logger.org.hibernate.type>info</log4j.logger.org.hibernate.type-->
+ <!--### log schema export/update ###-->
+ <!--log4j.logger.org.hibernate.tool.hbm2ddl>debug</log4j.logger.org.hibernate.tool.hbm2ddl-->
+ <!--### log cache activity ###-->
+ <!--log4j.logger.org.hibernate.cache>debug</log4j.logger.org.hibernate.cache-->
+ <!--### log JDBC resource acquisition-->
+ <!--log4j.logger.org.hibernate.jdbc>debug</log4j.logger.org.hibernate.jdbc-->
+ <!--### enable the following line if you want to track down connection ###-->
+ <!--### leakages when using DriverManagerConnectionProvider ###-->
+ <!--log4j.logger.org.hibernate.connection.DriverManagerConnectionProvider>trace</log4j.logger.org.hibernate.connection.DriverManagerConnectionProvider-->
+ <!--log4j.logger.org.hibernate.tool>debug</log4j.logger.org.hibernate.tool-->
+ <!--log4j.logger.org.hibernate.tool.hbm2x.TemplateHelper>info</log4j.logger.org.hibernate.tool.hbm2x.TemplateHelper-->
+ <!--log4j.logger.org.apache.velocity>off</log4j.logger.org.apache.velocity-->
+ </properties>
+ </profile>
+
+ <profile>
+ <id>hibernate.properties</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <properties>
+ <!--### Query Language ###-->
+ <!--## define query language constants / function names-->
+ <hibernate.query.substitutions>true 1, false 0, yes 'Y', no 'N'</hibernate.query.substitutions>
+ <!--### Hibernate Connection Pool ###-->
+ <hibernate.connection.pool_size>1</hibernate.connection.pool_size>
+ <!--### C3P0 Connection Pool###-->
+ <!--hibernate.c3p0.max_size>2</hibernate.c3p0.max_size-->
+ <!--hibernate.c3p0.min__size>2</hibernate.c3p0.min__size-->
+ <!--hibernate.c3p0.timeout>5000</hibernate.c3p0.timeout-->
+ <!--hibernate.c3p0.max_statements>100</hibernate.c3p0.max_statements-->
+ <!--hibernate.c3p0.idle_test_period>3000</hibernate.c3p0.idle_test_period-->
+ <!--hibernate.c3p0.acquire_increment>2</hibernate.c3p0.acquire_increment-->
+ <!--hibernate.c3p0.validate>false</hibernate.c3p0.validate-->
+ <!--### Proxool Connection Pool###-->
+ <!--## Properties for external configuration of Proxool-->
+ <hibernate.proxool.pool_alias>pool1</hibernate.proxool.pool_alias>
+ <!--## Only need one of the following-->
+ <hibernate.proxool.existing_pool>true</hibernate.proxool.existing_pool>
+ <hibernate.proxool.xml>proxool.xml</hibernate.proxool.xml>
+ <hibernate.proxool.properties>proxool.properties</hibernate.proxool.properties>
+ <!--### Plugin ConnectionProvider ###-->
+ <!--## use a custom ConnectionProvider (if not set, Hibernate will choose a built-in ConnectionProvider using hueristics)-->
+ <!--hibernate.connection.provider_class>org.hibernate.connection.DriverManagerConnectionProvider</hibernate.connection.provider_class-->
+ <!--hibernate.connection.provider_class>org.hibernate.connection.DatasourceConnectionProvider</hibernate.connection.provider_class-->
+ <!--hibernate.connection.provider_class>org.hibernate.connection.C3P0ConnectionProvider</hibernate.connection.provider_class-->
+ <!--hibernate.connection.provider_class>org.hibernate.connection.DBCPConnectionProvider</hibernate.connection.provider_class-->
+ <!--hibernate.connection.provider_class>org.hibernate.connection.ProxoolConnectionProvider</hibernate.connection.provider_class-->
+ <!--### Transaction API ###-->
+ <!--## Enable automatic flush during the JTA beforeCompletion() callback-->
+ <!--## (This setting is relevant with or without the Transaction API)-->
+ <!--hibernate.transaction.flush_before_completion></hibernate.transaction.flush_before_completion-->
+ <!--## Enable automatic session close at the end of transaction-->
+ <!--## (This setting is relevant with or without the Transaction API)-->
+ <!--hibernate.transaction.auto_close_session></hibernate.transaction.auto_close_session-->
+ <!--## the Transaction API abstracts application code from the underlying JTA or JDBC transactions-->
+ <!--hibernate.transaction.factory_class>org.hibernate.transaction.JTATransactionFactory</hibernate.transaction.factory_class-->
+ <!--hibernate.transaction.factory_class>org.hibernate.transaction.JDBCTransactionFactory</hibernate.transaction.factory_class-->
+ <!--## to use JTATransactionFactory, Hibernate must be able to locate the UserTransaction in JNDI-->
+ <!--## default is java:comp/UserTransaction-->
+ <!--## you do NOT need this setting if you specify hibernate.transaction.manager_lookup_class-->
+ <!--jta.UserTransaction>jta/usertransaction</jta.UserTransaction-->
+ <!--jta.UserTransaction>javax.transaction.UserTransaction</jta.UserTransaction-->
+ <!--jta.UserTransaction>UserTransaction</jta.UserTransaction-->
+ <!--## to use the second-level cache with JTA, Hibernate must be able to obtain the JTA TransactionManager-->
+ <!--hibernate.transaction.manager_lookup_class>org.hibernate.transaction.JBossTransactionManagerLookup</hibernate.transaction.manager_lookup_class-->
+ <!--hibernate.transaction.manager_lookup_class>org.hibernate.transaction.WeblogicTransactionManagerLookup</hibernate.transaction.manager_lookup_class-->
+ <!--hibernate.transaction.manager_lookup_class>org.hibernate.transaction.WebSphereTransactionManagerLookup</hibernate.transaction.manager_lookup_class-->
+ <!--hibernate.transaction.manager_lookup_class>org.hibernate.transaction.OrionTransactionManagerLookup</hibernate.transaction.manager_lookup_class-->
+ <!--hibernate.transaction.manager_lookup_class>org.hibernate.transaction.ResinTransactionManagerLookup</hibernate.transaction.manager_lookup_class-->
+ <!--### Miscellaneous Settings ###-->
+ <!--## print all generated SQL to the console-->
+ <!--hibernate.show_sql>true</hibernate.show_sql-->
+ <!--## add comments to the generated SQL-->
+ <!--hibernate.use_sql_comments>true</hibernate.use_sql_comments-->
+ <!--## generate statistics-->
+ <!--hibernate.generate_statistics>true</hibernate.generate_statistics-->
+ <!--## auto schema export-->
+ <!--hibernate.hbm2ddl.auto>create-drop</hibernate.hbm2ddl.auto-->
+ <!--hibernate.hbm2ddl.auto>create</hibernate.hbm2ddl.auto-->
+ <!--hibernate.hbm2ddl.auto>update</hibernate.hbm2ddl.auto-->
+ <!--## rollback generated identifier values of deleted entities to default values-->
+ <!--hibernate.use_identifer_rollback>true</hibernate.use_identifer_rollback-->
+ <!--## specify a default schema and catalog for unqualified tablenames-->
+ <!--hibernate.default_schema>HR</hibernate.default_schema-->
+ <hibernate.default_schema>PUBLIC</hibernate.default_schema>
+ <!--## set the maximum depth of the outer join fetch tree-->
+ <hibernate.max_fetch_depth>1</hibernate.max_fetch_depth>
+ <!--## enable CGLIB reflection optimizer (enabled by default)-->
+ <!--hibernate.cglib.use_reflection_optimizer>false</hibernate.cglib.use_reflection_optimizer-->
+ <!--## use a custom stylesheet for XML generation (if not specified, hibernate-default.xslt will be used)-->
+ <!--hibernate.xml.output_stylesheet>C:/Hibernate/net/sf/hibernate/hibernate-default.xslt</hibernate.xml.output_stylesheet-->
+ <!--### JDBC Settings ###-->
+ <!--## specify a JDBC isolation level-->
+ <!--hibernate.connection.isolation>4</hibernate.connection.isolation-->
+ <!--## enable JDBC autocommit (not recommended!)-->
+ <!--hibernate.connection.autocommit>true</hibernate.connection.autocommit-->
+ <!--## set the JDBC fetch size-->
+ <!--hibernate.jdbc.fetch_size>25</hibernate.jdbc.fetch_size-->
+ <!--## set the maximum JDBC 2 batch size (a nonzero value enables batching)-->
+ <!--hibernate.jdbc.batch_size>5</hibernate.jdbc.batch_size-->
+ <!--## enable use of JDBC 2 scrollable ResultSets (specifying a Dialect will cause Hibernate to use a sensible default)-->
+ <!--hibernate.jdbc.use_scrollable_resultset>true</hibernate.jdbc.use_scrollable_resultset-->
+ <!--## enable batch updates even for versioned data-->
+ <hibernate.jdbc.batch_versioned_data>true</hibernate.jdbc.batch_versioned_data>
+ <!--## use streams when writing binary types to / from JDBC-->
+ <hibernate.jdbc.use_streams_for_binary>true</hibernate.jdbc.use_streams_for_binary>
+ <!--## use JDBC 3 PreparedStatement.getGeneratedKeys() to get the identifier of an inserted row-->
+ <!--hibernate.jdbc.use_get_generated_keys>false</hibernate.jdbc.use_get_generated_keys-->
+ <!--### Second-level Cache ###-->
+ <!--## optimize chache for minimal "puts" instead of minimal "gets" (good for clustered cache)-->
+ <!--hibernate.cache.use_minimal_puts>true</hibernate.cache.use_minimal_puts-->
+ <!--## set a prefix for cache region names-->
+ <!--hibernate.cache.region_prefix>hibernate.test</hibernate.cache.region_prefix-->
+ <!--## disable the second-level cache-->
+ <!--hibernate.cache.use_second_level_cache>false</hibernate.cache.use_second_level_cache-->
+ <!--## enable the query cache-->
+ <!--hibernate.cache.use_query_cache>true</hibernate.cache.use_query_cache-->
+ <!--## choose a cache implementation-->
+ <!--hibernate.cache.provider_class>org.hibernate.cache.EhCacheProvider</hibernate.cache.provider_class-->
+ <!--hibernate.cache.provider_class>org.hibernate.cache.EmptyCacheProvider</hibernate.cache.provider_class-->
+ <!--hibernate.cache.provider_class>org.hibernate.cache.HashtableCacheProvider</hibernate.cache.provider_class-->
+ <!--hibernate.cache.provider_class>org.hibernate.cache.TreeCacheProvider</hibernate.cache.provider_class-->
+ <!--hibernate.cache.provider_class>org.hibernate.cache.OSCacheProvider</hibernate.cache.provider_class-->
+ <!--hibernate.cache.provider_class>org.hibernate.cache.SwarmCacheProvider</hibernate.cache.provider_class-->
+ <!--### JNDI ###-->
+ <!--## specify a JNDI name for the SessionFactory-->
+ <!--hibernate.session_factory_name>hibernate/session_factory</hibernate.session_factory_name-->
+ <!--## Hibernate uses JNDI to bind a name to a SessionFactory and to look up the JTA UserTransaction;-->
+ <!--## if hibernate.jndi.* are not specified, Hibernate will use the default InitialContext() which-->
+ <!--## is the best approach in an application server-->
+ <!--#file system-->
+ <!--hibernate.jndi.class>com.sun.jndi.fscontext.RefFSContextFactory</hibernate.jndi.class-->
+ <!--hibernate.jndi.url>file:/</hibernate.jndi.url-->
+ <!--#WebSphere-->
+ <!--hibernate.jndi.class>com.ibm.websphere.naming.WsnInitialContextFactory</hibernate.jndi.class-->
+ <!--hibernate.jndi.url>iiop://localhost:900/</hibernate.jndi.url-->
+ <!--hibernatetool.metadatadialect>org.hibernate.cfg.reveng.dialect.H2MetaDataDialect</hibernatetool.metadatadialect-->
+ </properties>
+ </profile>
+
+ <!-- =============================== -->
+ <!-- Database profiles -->
+ <!-- =============================== -->
+ <!-- HSQLDB is the default -->
+ <profile>
+ <id>hsqldb</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <version>${hsqldbVersion}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <properties>
+ <!--### Platforms ###-->
+ <!--## JNDI Datasource-->
+ <hibernate.dialect>org.hibernate.dialect.HSQLDialect</hibernate.dialect>
+ <hibernate.connection.driver_class>org.hsqldb.jdbcDriver</hibernate.connection.driver_class>
+ <hibernate.connection.url>jdbc:hsqldb:testdb/hsqldb;shutdown=true</hibernate.connection.url>
+ <hibernate.connection.username>sa</hibernate.connection.username>
+ <hibernate.connection.password/>
+ <db.dialect>org.hibernate.dialect.HSQLDialect</db.dialect>
+ <jdbc.driver>org.hsqldb.jdbcDriver</jdbc.driver>
+ <jdbc.url>jdbc:hsqldb:.</jdbc.url>
+ <jdbc.user>sa</jdbc.user>
+ <jdbc.pass/>
+ <jdbc.isolation/>
+ </properties>
+ </profile>
+
+ <profile>
+ <id>h2</id>
+ <dependencies>
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <properties>
+ <db.dialect>org.hibernate.dialect.H2Dialect</db.dialect>
+ <jdbc.driver>org.h2.Driver</jdbc.driver>
+ <jdbc.url>jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE</jdbc.url>
+ <jdbc.user>sa</jdbc.user>
+ <jdbc.pass />
+ <jdbc.isolation />
+ </properties>
+ </profile>
+
+ <!--
+ ###################################################################
+ Profiles naming db instances in the Red Hat QA/QE lab First, those
+ with OSS drivers
+ ###################################################################
+ -->
+
+ <!-- The MySQL 5 test envionment -->
+ <profile>
+ <id>mysql50</id>
+ <dependencies>
+ <dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-java</artifactId>
+ <version>5.0.5</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <properties>
+ <db.dialect>org.hibernate.dialect.MySQL5InnoDBDialect</db.dialect>
+ <jdbc.driver>com.mysql.jdbc.Driver</jdbc.driver>
+ <jdbc.url>jdbc:mysql://vmg08.mw.lab.eng.bos.redhat.com/hibbrtru</jdbc.url>
+ <jdbc.user>hibbrtru</jdbc.user>
+ <jdbc.pass>hibbrtru</jdbc.pass>
+ <jdbc.isolation />
+ </properties>
+ </profile>
+
+ <!-- The MySQL 5.1 test envionment -->
+ <profile>
+ <id>mysql51</id>
+ <dependencies>
+ <dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-java</artifactId>
+ <version>5.0.5</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <properties>
+ <db.dialect>org.hibernate.dialect.MySQL5InnoDBDialect</db.dialect>
+ <jdbc.driver>com.mysql.jdbc.Driver</jdbc.driver>
+ <jdbc.url>jdbc:mysql://vmg02.mw.lab.eng.bos.redhat.com/hibbrtru</jdbc.url>
+ <jdbc.user>hibbrtru</jdbc.user>
+ <jdbc.pass>hibbrtru</jdbc.pass>
+ <jdbc.isolation />
+ </properties>
+ </profile>
+
+ <!-- The MySQL 5.1 Cluster test envionment -->
+ <profile>
+ <id>mysql51-cluster</id>
+ <dependencies>
+ <dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-java</artifactId>
+ <version>5.1.8</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <properties>
+ <db.dialect>org.hibernate.dialect.MySQL5Dialect</db.dialect>
+ <jdbc.driver>com.mysql.jdbc.Driver</jdbc.driver>
+ <jdbc.url>jdbc:mysql:loadbalance://dev61.qa.atl2.redhat.com:3306,dev62.qa.atl2.redhat.com:3306/hibbrtru
+ </jdbc.url>
+ <jdbc.user>hibbrtru</jdbc.user>
+ <jdbc.pass>hibbrtru</jdbc.pass>
+ <jdbc.isolation />
+ </properties>
+ </profile>
+
+ <!-- The PostgreSQL 8.2.4 test envionment -->
+ <profile>
+ <id>postgresql82</id>
+ <dependencies>
+ <dependency>
+ <groupId>postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ <version>8.2-504.jdbc3</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <properties>
+ <db.dialect>org.hibernate.dialect.PostgreSQLDialect</db.dialect>
+ <jdbc.driver>org.postgresql.Driver</jdbc.driver>
+ <jdbc.url>jdbc:postgresql://vmg01.mw.lab.eng.bos.redhat.com:5432:hibbrtru</jdbc.url>
+ <jdbc.user>hibbrtru</jdbc.user>
+ <jdbc.pass>hibbrtru</jdbc.pass>
+ <jdbc.isolation />
+ </properties>
+ </profile>
+
+ <!-- The PostgreSQL 8.3.7 test envionment -->
+ <profile>
+ <id>postgresql83</id>
+ <dependencies>
+ <dependency>
+ <groupId>postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ <version>8.2-504.jdbc3</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <properties>
+ <db.dialect>org.hibernate.dialect.PostgreSQLDialect</db.dialect>
+ <jdbc.driver>org.postgresql.Driver</jdbc.driver>
+ <jdbc.url>jdbc:postgresql://vmg03.mw.lab.eng.bos.redhat.com:5432:hibbrtru</jdbc.url>
+ <jdbc.user>hibbrtru</jdbc.user>
+ <jdbc.pass>hibbrtru</jdbc.pass>
+ <jdbc.isolation />
+ </properties>
+ </profile>
+
+ <!--
+ ###################################################################
+ Then, those with commercial drivers
+ ###################################################################
+ -->
+
+ <!-- The DB2 8.x test envionment (using 9x drivers)-->
+ <profile>
+ <id>db2v82</id>
+ <dependencies>
+ <dependency>
+ <groupId>com.ibm</groupId>
+ <artifactId>db2jcc</artifactId>
+ <version>3.1.57</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.ibm</groupId>
+ <artifactId>db2jcc_license_cu</artifactId>
+ <version>3.1.57</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <properties>
+ <db.dialect>org.hibernate.dialect.DB2Dialect</db.dialect>
+ <jdbc.driver>com.ibm.db2.jcc.DB2Driver</jdbc.driver>
+ <jdbc.url>jdbc:db2://dev32.qa.atl.jboss.com:50000/jbossqa</jdbc.url>
+ <jdbc.user>hibbrtru</jdbc.user>
+ <jdbc.pass>hibbrtru</jdbc.pass>
+ <jdbc.isolation />
+ </properties>
+ </profile>
+
+ <!-- The DB2 9.1 test envionment (using 9x drivers)-->
+ <profile>
+ <id>db2-91</id>
+ <dependencies>
+ <dependency>
+ <groupId>com.ibm</groupId>
+ <artifactId>db2jcc</artifactId>
+ <version>3.8.47</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.ibm</groupId>
+ <artifactId>db2jcc_license_cu</artifactId>
+ <version>3.8.47</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <properties>
+ <db.dialect>org.hibernate.dialect.DB2Dialect</db.dialect>
+ <jdbc.driver>com.ibm.db2.jcc.DB2Driver</jdbc.driver>
+ <jdbc.url>jdbc:db2://dev67.qa.atl.jboss.com:50000/jbossqa</jdbc.url>
+ <jdbc.user>hibbrtru</jdbc.user>
+ <jdbc.pass>hibbrtru</jdbc.pass>
+ <jdbc.isolation />
+ </properties>
+ </profile>
+
+ <!-- The DB2 9.7 test envionment (using 9x drivers)-->
+ <profile>
+ <id>db2-97</id>
+ <dependencies>
+ <dependency>
+ <groupId>com.ibm</groupId>
+ <artifactId>db2jcc</artifactId>
+ <version>3.57.86</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.ibm</groupId>
+ <artifactId>db2jcc_license_cu</artifactId>
+ <version>3.57.86</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <properties>
+ <db.dialect>org.hibernate.dialect.DB2Dialect</db.dialect>
+ <jdbc.driver>com.ibm.db2.jcc.DB2Driver</jdbc.driver>
+ <jdbc.url>jdbc:db2://vmg06.mw.lab.eng.bos.redhat.com:50000/jbossqa</jdbc.url>
+ <jdbc.user>hibbrtru</jdbc.user>
+ <jdbc.pass>hibbrtru</jdbc.pass>
+ <jdbc.isolation />
+ </properties>
+ </profile>
+
+ <!-- The Oracle9i test envionment -->
+ <profile>
+ <id>oracle9i</id>
+ <dependencies>
+ <dependency>
+ <groupId>com.oracle</groupId>
+ <artifactId>ojdbc14</artifactId>
+ <!-- use the 10g drivers which are surprisingly largely bug free -->
+ <version>10.0.2.0</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <properties>
+ <db.dialect>org.hibernate.dialect.Oracle9iDialect</db.dialect>
+ <jdbc.driver>oracle.jdbc.driver.OracleDriver</jdbc.driver>
+ <jdbc.url>jdbc:oracle:thin:@dev20.qa.atl.jboss.com:1521:qa</jdbc.url>
+ <jdbc.user>hibbrtru</jdbc.user>
+ <jdbc.pass>hibbrtru</jdbc.pass>
+ <jdbc.isolation />
+ </properties>
+ </profile>
+
+ <!-- The Oracle10g test envionment -->
+ <profile>
+ <id>oracle10g</id>
+ <dependencies>
+ <dependency>
+ <groupId>com.oracle</groupId>
+ <artifactId>ojdbc14</artifactId>
+ <!-- use the 10g drivers which are surprisingly largely bug free -->
+ <version>10.0.2.0</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <properties>
+ <db.dialect>org.hibernate.dialect.Oracle10gDialect</db.dialect>
+ <jdbc.driver>oracle.jdbc.driver.OracleDriver</jdbc.driver>
+ <jdbc.url>jdbc:oracle:thin:@vmg05.mw.lab.eng.bos.redhat.com:1521:qaora10</jdbc.url>
+ <jdbc.user>hibbrtru</jdbc.user>
+ <jdbc.pass>hibbrtru</jdbc.pass>
+ <jdbc.isolation />
+ </properties>
+ </profile>
+
+ <!-- The Oracle11g test envionment -->
+ <profile>
+ <id>oracle11g</id>
+ <dependencies>
+ <dependency>
+ <groupId>com.oracle</groupId>
+ <artifactId>ojdbc5</artifactId>
+ <version>11.1.0.7.0</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <properties>
+ <db.dialect>org.hibernate.dialect.Oracle10gDialect</db.dialect>
+ <jdbc.driver>oracle.jdbc.driver.OracleDriver</jdbc.driver>
+ <jdbc.url>jdbc:oracle:thin:@dev04.qa.atl2.redhat.com:1521:qaora11</jdbc.url>
+ <jdbc.user>hibbrtru</jdbc.user>
+ <jdbc.pass>hibbrtru</jdbc.pass>
+ <jdbc.isolation />
+ </properties>
+ </profile>
+
+ <!-- The Oracle11gRAC test envionment -->
+ <profile>
+ <id>oracle11gRAC</id>
+ <dependencies>
+ <dependency>
+ <groupId>com.oracle</groupId>
+ <artifactId>ojdbc5</artifactId>
+ <version>11.1.0.7.0</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <properties>
+ <db.dialect>org.hibernate.dialect.Oracle10gDialect</db.dialect>
+ <jdbc.driver>oracle.jdbc.driver.OracleDriver</jdbc.driver>
+ <jdbc.url>
+ jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=ON)(ADDRESS=(PROTOCOL=TCP)(HOST=vmg24-vip.mw.lab.eng.bos.redhat.com)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=vmg25-vip.mw.lab.eng.bos.redhat.com)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=qarac.jboss)))
+ </jdbc.url>
+ <jdbc.user>hibbrtru</jdbc.user>
+ <jdbc.pass>hibbrtru</jdbc.pass>
+ <jdbc.isolation />
+ </properties>
+ </profile>
+
+ <!-- The Sybase 15 test envionment -->
+ <profile>
+ <id>sybase15</id>
+ <dependencies>
+ <dependency>
+ <groupId>com.sybase</groupId>
+ <artifactId>jconnect</artifactId>
+ <version>6.0.5</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <properties>
+ <db.dialect>org.hibernate.dialect.SybaseASE15Dialect</db.dialect>
+ <jdbc.driver>com.sybase.jdbc3.jdbc.SybDriver</jdbc.driver>
+ <jdbc.url>jdbc:sybase:Tds:vmg07.mw.lab.eng.bos.redhat.com:5000/hibbrtru</jdbc.url>
+ <jdbc.user>hibbrtru</jdbc.user>
+ <jdbc.pass>hibbrtru</jdbc.pass>
+ <jdbc.isolation />
+ </properties>
+ </profile>
+
+ <!-- The SQLServer2005 (MS JDBC) test envionment -->
+ <profile>
+ <id>mssql2005</id>
+ <dependencies>
+ <dependency>
+ <groupId>com.microsoft.sqlserver</groupId>
+ <artifactId>msjdbc</artifactId>
+ <version>2.0.1008.2</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <properties>
+ <db.dialect>org.hibernate.dialect.SQLServerDialect</db.dialect>
+ <jdbc.driver>com.microsoft.sqlserver.jdbc.SQLServerDriver</jdbc.driver>
+ <jdbc.url>jdbc:sqlserver://dev30.qa.atl.jboss.com:3918</jdbc.url>
+ <jdbc.user>hibbrtru</jdbc.user>
+ <jdbc.pass>hibbrtru</jdbc.pass>
+ <jdbc.isolation>4096</jdbc.isolation>
+ </properties>
+ </profile>
+
+ <!-- The SQLServer2005 (MS JDBC) test envionment -->
+ <profile>
+ <id>mssql2008</id>
+ <dependencies>
+ <dependency>
+ <groupId>com.microsoft.sqlserver</groupId>
+ <artifactId>msjdbc</artifactId>
+ <version>2.0.1008.2</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <properties>
+ <db.dialect>org.hibernate.dialect.SQLServerDialect</db.dialect>
+ <jdbc.driver>com.microsoft.sqlserver.jdbc.SQLServerDriver</jdbc.driver>
+ <jdbc.url>jdbc:sqlserver://vmg04.mw.lab.eng.bos.redhat.com:1433</jdbc.url>
+ <jdbc.user>hibbrtru</jdbc.user>
+ <jdbc.pass>hibbrtru</jdbc.pass>
+ <jdbc.isolation>4096</jdbc.isolation>
+ </properties>
+ </profile>
+
+ </profiles>
+
+</project>
Added: tools/trunk/src/test/org/hibernate/tool/test/jdbc2cfg/Item.java
===================================================================
--- tools/trunk/src/test/org/hibernate/tool/test/jdbc2cfg/Item.java (rev 0)
+++ tools/trunk/src/test/org/hibernate/tool/test/jdbc2cfg/Item.java 2010-07-12 08:25:31 UTC (rev 19937)
@@ -0,0 +1,71 @@
+
+package org.hibernate.tool.test.jdbc2cfg;
+public class Item {
+
+ Long childId;
+
+ Orders order;
+ Orders relatedorderId;
+ String name;
+
+ /**
+ * @return Returns the id.
+ */
+ public Long getChildId() {
+ return childId;
+ }
+ /**
+ * @param id The id to set.
+ */
+ public void setChildId(Long id) {
+ this.childId = id;
+ }
+ /**
+ * @return Returns the name.
+ */
+ public String getName() {
+ return name;
+ }
+ /**
+ * @param name The name to set.
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+ /**
+ * @return Returns the order.
+ */
+ public Orders getOrderId() {
+ return order;
+ }
+ /**
+ * @param order The order to set.
+ */
+ public void setOrderId(Orders order) {
+ this.order = order;
+ }
+ /**
+ * @return Returns the order.
+ */
+ public Orders getOrdersByOrderId() {
+ return order;
+ }
+ /**
+ * @param order The order to set.
+ */
+ public void setOrdersByOrderId(Orders order) {
+ this.order = order;
+ }
+ /**
+ * @return Returns the relatedorderId.
+ */
+ public Orders getOrdersByRelatedOrderId() {
+ return relatedorderId;
+ }
+ /**
+ * @param relatedorderId The relatedorderId to set.
+ */
+ public void setOrdersByRelatedOrderId(Orders relatedorderId) {
+ this.relatedorderId = relatedorderId;
+ }
+}
Modified: tools/trunk/src/test/org/hibernate/tool/test/jdbc2cfg/ManyToManyTest.java
===================================================================
--- tools/trunk/src/test/org/hibernate/tool/test/jdbc2cfg/ManyToManyTest.java 2010-07-12 06:59:59 UTC (rev 19936)
+++ tools/trunk/src/test/org/hibernate/tool/test/jdbc2cfg/ManyToManyTest.java 2010-07-12 08:25:31 UTC (rev 19937)
@@ -152,14 +152,14 @@
protected String[] getCreateSQL() {
return new String[] {
"create table PROJECT ( project_id integer not null, name varchar(50), primary key (project_id) )",
- "create table EMPLOYEE ( id integer not null, name varchar(50), manager_id integer, primary key (id), constraint employee_manager foreign key (manager_id) references EMPLOYEE)",
- "create table WORKS_ON ( project_id integer not null, employee_id integer not null, primary key (project_id, employee_id), constraint workson_employee foreign key (employee_id) references EMPLOYEE, foreign key (project_id) references PROJECT )",
- "create table WORKS_ON_CONTEXT ( project_id integer not null, employee_id integer not null, created_by integer, primary key (project_id, employee_id), constraint workson_ctx_employee foreign key (employee_id) references EMPLOYEE, foreign key (project_id) references PROJECT, foreign key (created_by) references EMPLOYEE )",
+ "create table EMPLOYEE ( id integer not null, name varchar(50), manager_id integer, primary key (id), constraint employee_manager foreign key (manager_id) references EMPLOYEE(id))",
+ "create table WORKS_ON ( project_id integer not null, employee_id integer not null, primary key (project_id, employee_id), constraint workson_employee foreign key (employee_id) references EMPLOYEE(id), foreign key (project_id) references PROJECT(project_id) )",
+ "create table WORKS_ON_CONTEXT ( project_id integer not null, employee_id integer not null, created_by integer, primary key (project_id, employee_id), constraint workson_ctx_employee foreign key (employee_id) references EMPLOYEE, foreign key (project_id) references PROJECT(project_id), foreign key (created_by) references EMPLOYEE(id) )",
//"alter table PROJECT add constraint project_manager foreign key (team_lead) references EMPLOYEE"
// nonmiddle left and right are used to test a false association table isn't detected.
"create table LEFT ( id integer not null, primary key (id) )",
"create table RIGHT ( id integer not null, primary key (id) )",
- "create table NON_MIDDLE ( left_id integer not null, right_id integer not null, primary key (left_id), constraint FK_MIDDLE_LEFT foreign key (left_id) references LEFT, constraint FK_MIDDLE_RIGHT foreign key (right_id) references RIGHT)",
+ "create table NON_MIDDLE ( left_id integer not null, right_id integer not null, primary key (left_id), constraint FK_MIDDLE_LEFT foreign key (left_id) references LEFT(id), constraint FK_MIDDLE_RIGHT foreign key (right_id) references RIGHT(id))",
};
}
Added: tools/trunk/src/test/org/hibernate/tool/test/jdbc2cfg/Orders.java
===================================================================
--- tools/trunk/src/test/org/hibernate/tool/test/jdbc2cfg/Orders.java (rev 0)
+++ tools/trunk/src/test/org/hibernate/tool/test/jdbc2cfg/Orders.java 2010-07-12 08:25:31 UTC (rev 19937)
@@ -0,0 +1,76 @@
+
+package org.hibernate.tool.test.jdbc2cfg;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * @author max
+ *
+ */
+public class Orders {
+
+ Long id;
+
+ String name;
+
+ Set items = new HashSet();
+ Set items_1 = new HashSet();
+
+
+ /**
+ * @return Returns the id.
+ */
+ public Long getId() {
+ return id;
+ }
+
+ /**
+ * @param id
+ * The id to set.
+ */
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ /**
+ * @return Returns the name.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param name
+ * The name to set.
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * @return Returns the setOfItem.
+ */
+ public Set getItemsForOrderId() {
+ return items;
+ }
+
+ /**
+ * @param items
+ * The setOfItem to set.
+ */
+ public void setItemsForOrderId(Set items) {
+ this.items = items;
+ }
+ /**
+ * @return Returns the setOfItem_1.
+ */
+ public Set getItemsForRelatedOrderId() {
+ return items_1;
+ }
+ /**
+ * @param items_1 The setOfItem_1 to set.
+ */
+ public void setItemsForRelatedOrderId(Set items_1) {
+ this.items_1 = items_1;
+ }
+}
Modified: tools/trunk/src/test/org/hibernate/tool/test/jdbc2cfg/PersistentClassesTest.java
===================================================================
--- tools/trunk/src/test/org/hibernate/tool/test/jdbc2cfg/PersistentClassesTest.java 2010-07-12 06:59:59 UTC (rev 19936)
+++ tools/trunk/src/test/org/hibernate/tool/test/jdbc2cfg/PersistentClassesTest.java 2010-07-12 08:25:31 UTC (rev 19937)
@@ -25,16 +25,17 @@
import org.hibernate.mapping.Set;
import org.hibernate.tool.JDBCMetaDataBinderTestCase;
-import persistentclasses.Item;
-import persistentclasses.Orders;
-
/**
* @author max
*
*/
public class PersistentClassesTest extends JDBCMetaDataBinderTestCase {
+ private static final String PACKAGE_NAME = "org.hibernate.tool.test.jdbc2cfg";
+
+
+
protected String[] getCreateSQL() {
return new String[] {
@@ -47,7 +48,7 @@
protected void configure(JDBCMetaDataConfiguration cfgToConfigure) {
DefaultReverseEngineeringStrategy c = new DefaultReverseEngineeringStrategy();
- c.setSettings(new ReverseEngineeringSettings(c).setDefaultPackageName("persistentclasses"));
+ c.setSettings(new ReverseEngineeringSettings(c).setDefaultPackageName(PACKAGE_NAME));
cfgToConfigure.setReverseEngineeringStrategy(c);
}
protected String[] getDropSQL() {
@@ -162,7 +163,7 @@
assertFalse(Hibernate.isInitialized(order) );
assertFalse(Hibernate.isInitialized(order.getItemsForOrderId() ) );
- order = (Orders) session.createQuery("from persistentclasses.Orders").uniqueResult();
+ order = (Orders) session.createQuery("from " + PACKAGE_NAME + ".Orders").uniqueResult();
assertFalse(Hibernate.isInitialized(order.getItemsForOrderId() ) );
t.commit();
Modified: tools/trunk/src/test/org/hibernate/tool/test/jdbc2cfg/TernarySchemaTest.java
===================================================================
--- tools/trunk/src/test/org/hibernate/tool/test/jdbc2cfg/TernarySchemaTest.java 2010-07-12 06:59:59 UTC (rev 19936)
+++ tools/trunk/src/test/org/hibernate/tool/test/jdbc2cfg/TernarySchemaTest.java 2010-07-12 08:25:31 UTC (rev 19937)
@@ -71,6 +71,20 @@
};
}
+ protected void setUp() throws Exception {
+ try {
+ super.setUp();
+ } catch (SQLException e) {
+ //since it currently requires HSQLDB 2.0
+ executeDDL(getDropSQL(), true);
+ throw e;
+ }
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
public void testTernaryModel() throws SQLException {
assertMultiSchema(getConfiguration());
Modified: tools/trunk/src/test/org/hibernate/tool/test/jdbc2cfg/identity/MySQLIdentityTest.java
===================================================================
--- tools/trunk/src/test/org/hibernate/tool/test/jdbc2cfg/identity/MySQLIdentityTest.java 2010-07-12 06:59:59 UTC (rev 19936)
+++ tools/trunk/src/test/org/hibernate/tool/test/jdbc2cfg/identity/MySQLIdentityTest.java 2010-07-12 08:25:31 UTC (rev 19937)
@@ -50,9 +50,9 @@
}
- public void assertNoTables() throws SQLException {
+ //public void assertNoTables() throws SQLException {
// can't do that on mysql
- }
+ //}
public static Test suite() {
return new TestSuite(MySQLIdentityTest.class);
Modified: tools/trunk/src/testsupport/anttest-build.xml
===================================================================
--- tools/trunk/src/testsupport/anttest-build.xml 2010-07-12 06:59:59 UTC (rev 19936)
+++ tools/trunk/src/testsupport/anttest-build.xml 2010-07-12 08:25:31 UTC (rev 19937)
@@ -1,18 +1,18 @@
<project name="anttest">
- <property name="build.dir" location="../../build/anttest" />
- <property file="../../etc/hibernate.properties" />
- <property name="jdbc.driver" location="../../lib/jdbc/hsqldb.jar"/>
+ <property name="build.dir" location="./target/anttest" />
+ <property file="./target/test-classes/hibernate.properties" />
+ <property name="jdbc.driver" location="./lib/jdbc/hsqldb.jar"/>
<path id="tasks.classpath">
- <pathelement path="../../build/eclipse" />
- <pathelement path="../../build/classes" />
+ <pathelement path="./target/test-classes" />
+ <pathelement path="./target/classes" />
<fileset dir="${build.dir}/../../lib/testlibs">
<include name="**/*.jar" />
</fileset>
- <pathelement path="../../lib/freemarker.jar" />
+ <pathelement path="./lib/freemarker.jar" />
<pathelement path="${jdbc.driver}" />
</path>
@@ -28,8 +28,8 @@
<hibernatetool destdir="${build.dir}/topdown">
<configuration namingstrategy="org.hibernate.cfg.ImprovedNamingStrategy" entityresolver="DummyEntityResolver">
- <fileset dir="../test" id="id">
- <include name="**/*TopDown.hbm.xml" />
+ <fileset dir="./src/test" id="id">
+ <include name="**/*" />
</fileset>
</configuration>
@@ -57,7 +57,7 @@
<hibernatetool destdir="${build.dir}/topdown">
<configuration namingstrategy="org.hibernate.cfg.ImprovedNamingStrategy" entityresolver="DummyEntityResolver">
- <fileset dir="../test" id="id">
+ <fileset dir="./src/test" id="id">
<include name="**/*TopDown.hbm.xml" />
</fileset>
</configuration>
@@ -79,7 +79,7 @@
<hibernatetool destdir="${build.dir}/topdown">
<configuration namingstrategy="org.hibernate.cfg.ImprovedNamingStrategy" entityresolver="DummyEntityResolver">
- <fileset dir="../test" id="id">
+ <fileset dir="./src/test" id="id">
<include name="**/*TopDown.hbm.xml" />
</fileset>
</configuration>
@@ -96,7 +96,7 @@
<target name="testantjdbccfg">
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath" />
- <property file="../etc/hibernate.properties" prefix="tools" />
+ <property file="./target/test-classes/hibernate.properties" prefix="tools" />
<!--
<sql onerror="continue" driver="${tools.hibernate.connection.driver_class}" password="${tools.hibernate.connection.password}" url="${tools.hibernate.connection.url}" userid="${tools.hibernate.connection.username}" classpath="C:\work\products\hsqldb-1.7.2.6\lib\hsqldb.jar">
create table BottomUp (
@@ -106,17 +106,17 @@
)
</sql> -->
<hibernatetool destdir="${build.dir}/bottomup">
- <jdbcconfiguration propertyfile="../../etc/hibernate.properties" detectManyToMany="true" detectoptimisticlock="true"/>
+ <jdbcconfiguration propertyfile="./target/test-classes/hibernate.properties" detectManyToMany="true" detectoptimisticlock="true"/>
<hbm2java />
- <hbm2java templatepath="templates" />
+ <hbm2java templatepath="./target/test-classes/templates" />
<hbm2cfgxml/>
</hibernatetool>
</target>
<target name="testantjdbccfgoverrides">
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath" />
- <property file="../etc/hibernate.properties" prefix="tools" />
+ <property file="./target/test-classes/hibernate.properties" prefix="tools" />
<!-- <sql onerror="continue" driver="${tools.hibernate.connection.driver_class}" password="${tools.hibernate.connection.password}" url="${tools.hibernate.connection.url}" userid="${tools.hibernate.connection.username}" classpath="C:\work\products\hsqldb-1.7.2.6\lib\hsqldb.jar">
create table BottomUp (
id bigint not null,
@@ -125,7 +125,7 @@
)
</sql> -->
<hibernatetool destdir="${build.dir}/bottomupoverride">
- <jdbcconfiguration propertyfile="../../etc/hibernate.properties" packagename="test" revengfile="hibernate.reveng.xml" />
+ <jdbcconfiguration propertyfile="./target/test-classes/hibernate.properties" packagename="test" revengfile="./target/test-classes/hibernate.reveng.xml" />
<hbm2java />
</hibernatetool>
@@ -134,7 +134,7 @@
<target name="testanthbm2java">
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath" />
<hibernatetool destdir="${build.dir}/bottomup">
- <configuration propertyfile="../../etc/hibernate.properties">
+ <configuration propertyfile="./target/test-classes/hibernate.properties">
<fileset dir=".">
<include name="SomeClasses.hbm.xml" />
</fileset>
@@ -153,7 +153,7 @@
<property name="org.hibernate.tool.hbm2x.weirdAl" value="weirdAl" />
<hibernatetool destdir="${build.dir}/bottomup">
- <configuration propertyfile="../../etc/hibernate.properties">
+ <configuration propertyfile="./target/test-classes/hibernate.properties">
<fileset dir=".">
<include name="SomeClasses.hbm.xml" />
</fileset>
@@ -173,9 +173,9 @@
<target name="testgeneric">
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath" />
- <hibernatetool destdir="${build.dir}/generic" templatepath="generictemplates">
- <configuration propertyfile="../../etc/hibernate.properties">
- <fileset dir="../test" id="id">
+ <hibernatetool destdir="${build.dir}/generic" templatepath="./target/test-classes/generictemplates">
+ <configuration propertyfile="./target/test-classes/hibernate.properties">
+ <fileset dir="./src/test" id="id">
<include name="**/*TopDown.hbm.xml" />
</fileset>
</configuration>
@@ -193,9 +193,9 @@
<target name="testexceptions">
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath" />
- <hibernatetool destdir="${build.dir}/generic" templatepath="generictemplates">
- <configuration propertyfile="../../etc/hibernate.properties">
- <fileset dir="../test" id="id">
+ <hibernatetool destdir="${build.dir}/generic" templatepath="./target/test-classes/generictemplates">
+ <configuration propertyfile="./target/test-classes/hibernate.properties">
+ <fileset dir="./src/test" id="id">
<include name="**/*TopDown.hbm.xml" />
</fileset>
</configuration>
@@ -206,11 +206,12 @@
<target name="testantannotationcfg">
<path id="annlib">
- <path location="${build.dir}/../../lib/testlibs/hibernate3.jar" />
- <path location="${build.dir}/../../lib/testlibs/hibernate-annotations.jar" />
- <path location="${build.dir}/../../lib/testlibs/ejb3-persistence.jar" />
- <path location="${build.dir}/../classes" />
- <path location="${build.dir}/../../etc" />
+ <path location="./lib/testlibs/hibernate3.jar" />
+ <path location="./lib/testlibs/hibernate-annotations.jar" />
+ <path location="./lib/testlibs/ejb3-persistence.jar" />
+ <path location="./target/test-classes" />
+ <path location="./target/classes" />
+ <path location="./etc" />
<path location="${jdbc.driver}" />
<!-- <fileset dir="${hibernate-core.lib.dir}">
<include name="*.jar" />
@@ -218,22 +219,22 @@
</path>
<taskdef name="hibernatetoolx" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="annlib" />
<hibernatetoolx destdir="${build.dir}/bottomup">
- <annotationconfiguration configurationfile="test-hibernate.cfg.xml" />
+ <annotationconfiguration configurationfile="./target/test-classes/test-hibernate.cfg.xml" />
<hbm2ddl console="true" export="false" />
</hibernatetoolx>
</target>
<target name="testantejb3cfg">
<path id="annlib">
- <path location="${build.dir}/../../lib/freemarker.jar" />
-
- <path location="${build.dir}/../../lib/testlibs/hibernate3.jar" />
- <path location="${build.dir}/../../lib/testlibs/hibernate-annotations.jar" />
- <path location="${build.dir}/../../lib/testlibs/ejb3-persistence.jar" />
- <path location="${build.dir}/../../lib/testlibs/hibernate-entitymanager.jar" />
- <path location="${build.dir}/../../lib/testlibs/jboss-archive-browsing.jar" />
- <path location="${build.dir}/../../lib/testlibs/javaassist.jar" />
- <path location="${build.dir}/../classes" />
+ <path location="./lib/freemarker.jar" />
+ <path location="./lib/testlibs/hibernate3.jar" />
+ <path location="./lib/testlibs/hibernate-annotations.jar" />
+ <path location="./lib/testlibs/ejb3-persistence.jar" />
+ <path location="./lib/testlibs/hibernate-entitymanager.jar" />
+ <path location="./lib/testlibs/jboss-archive-browsing.jar" />
+ <path location="./lib/testlibs/javaassist.jar" />
+ <path location="./target/test-classes" />
+ <path location="./target/classes" />
<path location="${hibernate-core.home}\jdbc\hsqldb.jar" />
<!-- <fileset dir="${hibernate-core.lib.dir}">
@@ -246,15 +247,15 @@
<antcall target="prepareCfg2hbm" />
<hibernatetool>
- <jdbcconfiguration propertyfile="../../etc/hibernate.properties" />
+ <jdbcconfiguration propertyfile="./target/test-classes/hibernate.properties" />
<hbm2java ejb3="true" jdk5="true" destdir="${build.dir}/ejb3/src" />
</hibernatetool>
<mkdir dir="${build.dir}/ejb3/classes" />
<javac classpathref="annlib" srcdir="${build.dir}/ejb3/src" destdir="${build.dir}/ejb3/classes" />
- <copy file="ejb3test-persistence.xml" tofile="${build.dir}/ejb3/classes/META-INF/persistence.xml" />
- <copy file="ejb3test-hibernate.cfg.xml" tofile="${build.dir}/ejb3/classes/ejb3test-hibernate.cfg.xml" />
+ <copy file="./target/test-classes/ejb3test-persistence.xml" tofile="${build.dir}/ejb3/classes/META-INF/persistence.xml" />
+ <copy file="./target/test-classes/ejb3test-hibernate.cfg.xml" tofile="${build.dir}/ejb3/classes/ejb3test-hibernate.cfg.xml" />
<hibernatetool destdir="${build.dir}">
<ejb3configuration/>
@@ -271,15 +272,15 @@
<property file="${hibernate-core.lib.dir}/version.properties" prefix="h3"/>
<path id="annlib">
- <path location="${build.dir}/../../lib/freemarker.jar" />
-
- <path location="${build.dir}/../../lib/testlibs/hibernate3.jar" />
- <path location="${build.dir}/../../lib/testlibs/hibernate-annotations.jar" />
- <path location="${build.dir}/../../lib/testlibs/ejb3-persistence.jar" />
- <path location="${build.dir}/../../lib/testlibs/hibernate-entitymanager.jar" />
- <path location="${build.dir}/../../lib/testlibs/jboss-archive-browsing.jar" />
- <path location="${build.dir}/../../lib/testlibs/javaassist.jar" />
- <path location="${build.dir}/../classes" />
+ <path location="./lib/freemarker.jar" />
+ <path location="./lib/testlibs/hibernate3.jar" />
+ <path location="./lib/testlibs/hibernate-annotations.jar" />
+ <path location="./lib/testlibs/ejb3-persistence.jar" />
+ <path location="./lib/testlibs/hibernate-entitymanager.jar" />
+ <path location="./lib/testlibs/jboss-archive-browsing.jar" />
+ <path location="./lib/testlibs/javaassist.jar" />
+ <path location="./target/test-classes" />
+ <path location="./target/classes" />
<path location="${hibernate-core.home}\jdbc\hsqldb.jar" />
</path>
<!-- <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="annlib" /> -->
@@ -289,15 +290,15 @@
<antcall target="prepareCfg2hbm" />
<hibernatetool>
- <jdbcconfiguration propertyfile="../../etc/hibernate.properties" />
+ <jdbcconfiguration propertyfile="./target/test-classes/hibernate.properties" />
<hbm2java ejb3="true" jdk5="true" destdir="${build.dir}/ejb3/src" />
</hibernatetool>
<mkdir dir="${build.dir}/ejb3/classes" />
<javac classpathref="annlib" srcdir="${build.dir}/ejb3/src" destdir="${build.dir}/ejb3/classes" />
- <copy file="ejb3test-persistence.xml" tofile="${build.dir}/ejb3/classes/META-INF/persistence.xml" />
- <copy file="ejb3test-hibernate.cfg.xml" tofile="${build.dir}/ejb3/classes/ejb3test-hibernate.cfg.xml" />
+ <copy file="./target/test-classes/ejb3test-persistence.xml" tofile="${build.dir}/ejb3/classes/META-INF/persistence.xml" />
+ <copy file="./target/test-classes/ejb3test-hibernate.cfg.xml" tofile="${build.dir}/ejb3/classes/ejb3test-hibernate.cfg.xml" />
<hibernatetool destdir="${build.dir}">
<jpaconfiguration persistenceunit="shouldnotbethere"/>
@@ -312,9 +313,10 @@
<target name="jpa-punit">
<property file="${hibernate-core.lib.dir}/version.properties" prefix="h3"/>
- <property name="testlibs" location="${build.dir}/../../lib/testlibs"/>
+ <property name="testlibs" location="./lib/testlibs"/>
<path id="annlib">
- <path location="${build.dir}/../classes" />
+ <path location="./target/test-classes" />
+ <path location="./target/classes" />
<path location="${testlibs}/hibernate3.jar"/>
<path location="${testlibs}/${h3.commons-logging.lib}"/>
<path location="${testlibs}/${h3.dom4j.lib}"/>
@@ -322,7 +324,7 @@
<path location="${hibernate-core.home}\jdbc\hsqldb.jar" />
<path location="${testlibs}/${h3.ehcache.lib}"/>
<path location="${testlibs}/${h3.commons-collections.lib}"/>
- <path location="${build.dir}/../../lib/freemarker.jar" />
+ <path location="${build.dir}/./lib/freemarker.jar" />
<path location="${testlibs}/ejb3-persistence.jar" />
<path location="${testlibs}/hibernate-entitymanager.jar" />
<path location="${testlibs}/jboss-archive-browsing.jar" />
@@ -332,11 +334,11 @@
- <path location="${build.dir}/../../lib/testlibs/hibernate-annotations.jar" />
- <path location="${build.dir}/../../lib/testlibs/ejb3-persistence.jar" />
- <path location="${build.dir}/../../lib/testlibs/hibernate-entitymanager.jar" />
- <path location="${build.dir}/../../lib/testlibs/jboss-archive-browsing.jar" />
- <path location="${build.dir}/../../lib/testlibs/javaassist.jar" />
+ <path location="./lib/testlibs/hibernate-annotations.jar" />
+ <path location="./lib/testlibs/ejb3-persistence.jar" />
+ <path location="./lib/testlibs/hibernate-entitymanager.jar" />
+ <path location="./lib/testlibs/jboss-archive-browsing.jar" />
+ <path location="./lib/testlibs/javaassist.jar" />
<path location="${hibernate-core.home}\jdbc\hsqldb.jar" /> -->
<!-- <fileset dir="${hibernate-core.lib.dir}">
@@ -350,15 +352,15 @@
<antcall target="prepareCfg2hbm" />
<hibernatetool>
- <jdbcconfiguration propertyfile="../../etc/hibernate.properties" />
+ <jdbcconfiguration propertyfile="./target/test-classes/hibernate.properties" />
<hbm2java ejb3="true" jdk5="true" destdir="${build.dir}/ejb3/src" />
</hibernatetool>
<mkdir dir="${build.dir}/ejb3/classes" />
<javac classpathref="annlib" srcdir="${build.dir}/ejb3/src" destdir="${build.dir}/ejb3/classes" />
- <copy file="ejb3test-persistence.xml" tofile="${build.dir}/ejb3/classes/META-INF/persistence.xml" />
- <copy file="ejb3test-hibernate.cfg.xml" tofile="${build.dir}/ejb3/classes/ejb3test-hibernate.cfg.xml" />
+ <copy file="./target/test-classes/ejb3test-persistence.xml" tofile="${build.dir}/ejb3/classes/META-INF/persistence.xml" />
+ <copy file="./target/test-classes/ejb3test-hibernate.cfg.xml" tofile="${build.dir}/ejb3/classes/ejb3test-hibernate.cfg.xml" />
<hibernatetool destdir="${build.dir}">
<jpaconfiguration persistenceunit="ejb3test"/>
@@ -373,15 +375,15 @@
<target name="jpa-overrides">
<path id="annlib">
- <path location="${build.dir}/../../lib/freemarker.jar" />
-
- <path location="${build.dir}/../../lib/testlibs/hibernate3.jar" />
- <path location="${build.dir}/../../lib/testlibs/hibernate-annotations.jar" />
- <path location="${build.dir}/../../lib/testlibs/ejb3-persistence.jar" />
- <path location="${build.dir}/../../lib/testlibs/hibernate-entitymanager.jar" />
- <path location="${build.dir}/../../lib/testlibs/jboss-archive-browsing.jar" />
- <path location="${build.dir}/../../lib/testlibs/javaassist.jar" />
- <path location="${build.dir}/../classes" />
+ <path location="./lib/freemarker.jar" />
+ <path location="./lib/testlibs/hibernate3.jar" />
+ <path location="./lib/testlibs/hibernate-annotations.jar" />
+ <path location="./lib/testlibs/ejb3-persistence.jar" />
+ <path location="./lib/testlibs/hibernate-entitymanager.jar" />
+ <path location="./lib/testlibs/jboss-archive-browsing.jar" />
+ <path location="./lib/testlibs/javaassist.jar" />
+ <path location="./target/test-classes" />
+ <path location="./target/classes" />
<path location="${hibernate-core.home}\jdbc\hsqldb.jar" />
</path>
@@ -392,18 +394,18 @@
<antcall target="prepareCfg2hbm" />
<hibernatetool>
- <jdbcconfiguration propertyfile="../../etc/hibernate.properties" />
+ <jdbcconfiguration propertyfile="./target/test-classes/hibernate.properties" />
<hbm2java ejb3="true" jdk5="true" destdir="${build.dir}/ejb3/src" />
</hibernatetool>
<mkdir dir="${build.dir}/ejb3/classes" />
<javac classpathref="annlib" srcdir="${build.dir}/ejb3/src" destdir="${build.dir}/ejb3/classes" />
- <copy file="ejb3test-persistence.xml" tofile="${build.dir}/ejb3/classes/META-INF/persistence.xml" />
- <copy file="ejb3test-hibernate.cfg.xml" tofile="${build.dir}/ejb3/classes/ejb3test-hibernate.cfg.xml" />
+ <copy file="./target/test-classes/ejb3test-persistence.xml" tofile="${build.dir}/ejb3/classes/META-INF/persistence.xml" />
+ <copy file="./target/test-classes/ejb3test-hibernate.cfg.xml" tofile="${build.dir}/ejb3/classes/ejb3test-hibernate.cfg.xml" />
<hibernatetool destdir="${build.dir}">
- <jpaconfiguration persistenceunit="ejb3test" entityresolver="DummyEntityResolver" propertyfile="jpaoverrides.properties"/>
+ <jpaconfiguration persistenceunit="ejb3test" entityresolver="DummyEntityResolver" propertyfile="./target/test-classes/jpaoverrides.properties"/>
<classpath>
<path location="${build.dir}/ejb3/classes" />
</classpath>
@@ -417,8 +419,8 @@
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath" />
<hibernatetool destdir="${build.dir}/bottomup">
- <configuration propertyfile="../../etc/hibernate.properties">
- <fileset dir="../test/org/hibernate/tool/hbm2x">
+ <configuration propertyfile="./target/test-classes/hibernate.properties">
+ <fileset dir="./src/test/org/hibernate/tool/hbm2x">
<include name="*.hbm.xml" />
</fileset>
</configuration>
@@ -452,7 +454,7 @@
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath" />
<hibernatetool>
- <jdbcconfiguration propertyfile="../../etc/hibernate.properties" />
+ <jdbcconfiguration propertyfile="./target/test-classes/hibernate.properties" />
<hbm2hbmxml destdir="${build.dir}/cfg2hbm" />
</hibernatetool>
@@ -463,7 +465,7 @@
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath" />
<hibernatetool>
- <jdbcconfiguration propertyfile="../../etc/hibernate.properties" />
+ <jdbcconfiguration propertyfile="./target/test-classes/hibernate.properties" />
<hbm2hbmxml destdir="${build.dir}/cfg2hbm" />
</hibernatetool>
@@ -475,7 +477,7 @@
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath" />
<hibernatetool>
- <jdbcconfiguration propertyfile="../../etc/hibernate.properties" reversestrategy="invalid.classname" />
+ <jdbcconfiguration propertyfile="./target/test-classes/hibernate.properties" reversestrategy="invalid.classname" />
<hbm2hbmxml destdir="${build.dir}/cfg2hbm" />
</hibernatetool>
@@ -487,7 +489,7 @@
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath" />
<hibernatetool>
- <jdbcconfiguration propertyfile="../../etc/hibernate.properties" packageName="org.h3.test" />
+ <jdbcconfiguration propertyfile="./target/test-classes/hibernate.properties" packageName="org.h3.test" />
<hbm2hbmxml destdir="${build.dir}/cfg2hbm" />
</hibernatetool>
@@ -498,7 +500,7 @@
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath" />
<hibernatetool>
- <jdbcconfiguration propertyfile="../../etc/hibernate.properties" packageName="org.h3.test" reversestrategy="org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy" />
+ <jdbcconfiguration propertyfile="./target/test-classes/hibernate.properties" packageName="org.h3.test" reversestrategy="org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy" />
<hbm2hbmxml destdir="${build.dir}/cfg2hbm" />
</hibernatetool>
@@ -511,8 +513,8 @@
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath" />
<hibernatetool destdir="${build.dir}/noconinfo">
- <configuration configurationfile="noconnectioninfo-hibernate.cfg.xml">
- <fileset dir="../test" id="id">
+ <configuration configurationfile="./target/test-classes/noconnectioninfo-hibernate.cfg.xml">
+ <fileset dir="./src/test" id="id">
<include name="**/*TopDown.hbm.xml" />
</fileset>
</configuration>
@@ -523,14 +525,14 @@
<target name="testnoexporters" description="tool without anyexporters - should fail">
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath" />
<hibernatetool>
- <jdbcconfiguration propertyfile="../../etc/hibernate.properties" packageName="org.h3.test" reversestrategy="org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy" />
+ <jdbcconfiguration propertyfile="./target/test-classes/hibernate.properties" packageName="org.h3.test" reversestrategy="org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy" />
</hibernatetool>
</target>
<target name="testquery" depends="prepareCfg2hbm" description="test the query tasks">
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath" />
<hibernatetool destdir="${build.dir}/querytest">
- <configuration propertyfile="../../etc/hibernate.properties" configurationfile="querytest-hibernate.cfg.xml" />
+ <configuration propertyfile="./target/test-classes/hibernate.properties" configurationfile="./target/test-classes/querytest-hibernate.cfg.xml" />
<classpath location="."/>
<query>
<hql>from java.lang.Object</hql>
@@ -546,8 +548,8 @@
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath" />
<hibernatetool destdir="${build.dir}/linttest">
- <configuration propertyfile="../../etc/hibernate.properties" configurationfile="querytest-hibernate.cfg.xml">
- <fileset dir="../test">
+ <configuration propertyfile="./target/test-classes/hibernate.properties" configurationfile="./target/test-classes/querytest-hibernate.cfg.xml">
+ <fileset dir="./src/test">
<include name="**/SchemaIssues.hbm.xml"/>
</fileset>
</configuration>
Modified: tools/trunk/src/testsupport/coretest-build.xml
===================================================================
--- tools/trunk/src/testsupport/coretest-build.xml 2010-07-12 06:59:59 UTC (rev 19936)
+++ tools/trunk/src/testsupport/coretest-build.xml 2010-07-12 08:25:31 UTC (rev 19937)
@@ -1,18 +1,12 @@
<project name="coreanttest">
- <property name="hibernate-core.home" location="../../../../hibernate3" />
- <property name="core.jar" location="${build.dir}/../../lib/testlibs/hibernate3.jar" />
- <property name="core.libs" location="${build.dir}/../../lib/testlibs" />
- <property name="hibernate-core.lib.dir" location="${hibernate-core.home}/lib" />
- <property name="build.dir" location="../../build/anttest" />
- <property name="jdbc.driver" location="../../lib/jdbc/hsqldb.jar"/>
+ <property name="core.jar" location="${build.dir}/./lib/testlibs/hibernate3.jar" />
+ <property name="core.libs" location="${build.dir}/./lib/testlibs" />
+ <property name="build.dir" location="./target/anttest" />
+ <property name="jdbc.driver" location="./lib/jdbc/hsqldb.jar"/>
- <property file="../../etc/hibernate.properties" />
+ <property file="./target/test-classes/hibernate.properties" />
<path id="tasks.classpath">
- <!--<fileset dir="${hibernate-core.lib.dir}">
- <include name="**/*.jar" />
- </fileset>-->
-
<pathelement location="${hibernate-core.jar}" />
<pathelement path="${jdbc.driver}" />
</path>
@@ -22,8 +16,8 @@
<target name="test-schemaexportwarning">
<taskdef name="schemaexport" classname="org.hibernate.tool.hbm2ddl.SchemaExportTask" classpathref="tasks.classpath" />
- <schemaexport drop="true" quiet="false" text="false" output="schemaexport.sql">
- <fileset dir="../test" id="id">
+ <schemaexport drop="true" quiet="false" text="false" output="${build.dir}/schemaexport.sql">
+ <fileset dir="./src/test" id="id">
<include name="**/*TopDown.hbm.xml" />
</fileset>
</schemaexport>
@@ -33,7 +27,7 @@
<taskdef name="schemaupdate" classname="org.hibernate.tool.hbm2ddl.SchemaUpdateTask" classpathref="tasks.classpath"/>
<schemaupdate quiet="false" text="false" >
- <fileset dir="../test" id="id">
+ <fileset dir="./src/test" id="id">
<include name="**/*TopDown.hbm.xml" />
</fileset>
</schemaupdate>
Modified: tools/trunk/src/testsupport/javaformattest-build.xml
===================================================================
--- tools/trunk/src/testsupport/javaformattest-build.xml 2010-07-12 06:59:59 UTC (rev 19936)
+++ tools/trunk/src/testsupport/javaformattest-build.xml 2010-07-12 08:25:31 UTC (rev 19937)
@@ -1,24 +1,24 @@
<project name="javaformattest">
- <property name="hibernate-libs" location="../../lib/testlibs" />
- <property name="build.dir" location="../../build/javaformattest" />
- <property file="../../etc/hibernate.properties" />
+ <property name="hibernate-libs" location="./lib/testlibs" />
+ <property name="build.dir" location="./target/javaformattest" />
+ <property file="./target/test-classes/hibernate.properties" />
<path id="tasks.classpath">
- <pathelement path="../../build/eclipse" />
- <pathelement path="../../build/classes" />
+ <pathelement path="./target/test-classes" />
+ <pathelement path="./target/classes" />
<fileset dir="${hibernate-libs}">
<include name="**/*.jar" />
</fileset>
- <pathelement path="../../lib/freemarker.jar" />
+ <pathelement path="./lib/freemarker.jar" />
- <fileset dir="../../lib">
+ <fileset dir="./lib">
<include name="**/*eclipse*.jar" />
</fileset>
- <pathelement path="../../../lib/hsqldb.jar" />
+ <pathelement path="./lib/jdbc/hsqldb.jar" />
</path>
<target name="cleanup">
@@ -27,7 +27,7 @@
<target name="prepare">
<copy todir="${build.dir}">
- <fileset dir="." includes="formatting/**/*"/>
+ <fileset dir="./target/test-classes" includes="formatting/**/*"/>
</copy>
</target>
@@ -44,7 +44,7 @@
<target name="configtest">
<taskdef name="javaformatter" classname="org.hibernate.tool.ant.JavaFormatterTask" classpathref="tasks.classpath"/>
- <javaformatter configurationfile="emptyconfig.properties">
+ <javaformatter configurationfile="./target/test-classes/emptyconfig.properties">
<fileset dir="${build.dir}">
<include name="formatting/**/*"/>
</fileset>
Modified: tools/trunk/src/testsupport/seamtest-build.xml
===================================================================
--- tools/trunk/src/testsupport/seamtest-build.xml 2010-07-12 06:59:59 UTC (rev 19936)
+++ tools/trunk/src/testsupport/seamtest-build.xml 2010-07-12 08:25:31 UTC (rev 19937)
@@ -1,9 +1,6 @@
<project name="anttest">
- <property name="hibernate-core.jar" location="../../../../hibernate-3.1/hibernate3.jar"/>
- <property name="hibernate-core.home" location="../../../../hibernate3"/>
- <property name="hibernate-core.lib.dir" location="${hibernate-core.home}/lib"/>
- <property name="build.dir" location="../../build/seamtest"/>
- <property file="../../etc/hibernate.properties"/>
+ <property name="build.dir" location="./target/seamtest"/>
+ <property file="./target/test-classes/hibernate.properties"/>
<!-- <delete dir="${build.dir}"/> -->
@@ -14,10 +11,10 @@
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask"/>
<hibernatetool destdir="${destdir}">
<!-- <classpath>
- <path location="../../build/testsupport"/>
+ <path location="./target/test-classes"/>
</classpath> -->
- <jdbcconfiguration configurationfile="seamtest.cfg.xml" packagename="org.jboss.seam.example.crud"/>
+ <jdbcconfiguration configurationfile="./target/test-classes/seamtest.cfg.xml" packagename="org.jboss.seam.example.crud"/>
<!-- setup global properties -->
<property key="seam_appname" value="Registration"/>
@@ -30,7 +27,7 @@
</target>
<target name="sql">
- <sql classpath="${hibernate-core.home}/jdbc/hsqldb.jar"
+ <sql classpath="./lib//jdbc/hsqldb.jar"
driver="org.hsqldb.jdbcDriver"
url="jdbc:hsqldb:seamtest"
userid="sa"
14 years, 4 months