[hibernate-commits] Hibernate SVN: r11294 - in trunk/HibernateExt:
shards and 56 other directories.
hibernate-commits at lists.jboss.org
hibernate-commits at lists.jboss.org
Sat Mar 17 12:31:43 EDT 2007
Author: max.ross
Date: 2007-03-17 12:31:42 -0400 (Sat, 17 Mar 2007)
New Revision: 11294
Added:
trunk/HibernateExt/shards/
trunk/HibernateExt/shards/build.properties.dist
trunk/HibernateExt/shards/build.xml
trunk/HibernateExt/shards/changelog.txt
trunk/HibernateExt/shards/doc/
trunk/HibernateExt/shards/doc/api/
trunk/HibernateExt/shards/doc/api/package.html
trunk/HibernateExt/shards/doc/reference/
trunk/HibernateExt/shards/doc/reference/.cvsignore
trunk/HibernateExt/shards/doc/reference/build.xml
trunk/HibernateExt/shards/doc/reference/en/
trunk/HibernateExt/shards/doc/reference/en/images/
trunk/HibernateExt/shards/doc/reference/en/images/hibernate_logo_a.png
trunk/HibernateExt/shards/doc/reference/en/master.xml
trunk/HibernateExt/shards/doc/reference/en/modules/
trunk/HibernateExt/shards/doc/reference/en/modules/architecture.xml
trunk/HibernateExt/shards/doc/reference/en/modules/configuration.xml
trunk/HibernateExt/shards/doc/reference/en/modules/limitations.xml
trunk/HibernateExt/shards/doc/reference/en/modules/querying.xml
trunk/HibernateExt/shards/doc/reference/en/modules/resharding.xml
trunk/HibernateExt/shards/doc/reference/en/modules/shardstrategy.xml
trunk/HibernateExt/shards/doc/reference/en/styles/
trunk/HibernateExt/shards/doc/reference/en/styles/fopdf.xsl
trunk/HibernateExt/shards/doc/reference/en/styles/html.css
trunk/HibernateExt/shards/doc/reference/en/styles/html.xsl
trunk/HibernateExt/shards/doc/reference/en/styles/html_chunk.xsl
trunk/HibernateExt/shards/etc/
trunk/HibernateExt/shards/etc/hibernate.properties
trunk/HibernateExt/shards/etc/log4j.properties
trunk/HibernateExt/shards/jdbc/
trunk/HibernateExt/shards/jdbc/hsqldb.jar
trunk/HibernateExt/shards/jdbc/mysql-3.0.14.jar
trunk/HibernateExt/shards/lgpl.txt
trunk/HibernateExt/shards/lib/
trunk/HibernateExt/shards/lib/README.txt
trunk/HibernateExt/shards/readme.txt
trunk/HibernateExt/shards/src/
trunk/HibernateExt/shards/src/java/
trunk/HibernateExt/shards/src/java/org/
trunk/HibernateExt/shards/src/java/org/hibernate/
trunk/HibernateExt/shards/src/java/org/hibernate/shards/
trunk/HibernateExt/shards/src/java/org/hibernate/shards/BaseHasShardIdList.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/CrossShardAssociationException.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/HasShardIdList.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/Shard.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/ShardId.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/ShardImpl.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/ShardOperation.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/ShardedConfiguration.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/ShardedTransaction.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/cfg/
trunk/HibernateExt/shards/src/java/org/hibernate/shards/cfg/ShardedEnvironment.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/criteria/
trunk/HibernateExt/shards/src/java/org/hibernate/shards/criteria/AddCriterionEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/criteria/AddOrderEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/criteria/CreateAliasEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/criteria/CreateSubcriteriaEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/criteria/CriteriaEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/criteria/CriteriaFactory.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/criteria/CriteriaFactoryImpl.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/criteria/CriteriaId.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/criteria/ExitOperationsCriteriaCollector.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/criteria/SetCacheModeEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/criteria/SetCacheRegionEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/criteria/SetCacheableEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/criteria/SetCommentEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/criteria/SetFetchModeEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/criteria/SetFetchSizeEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/criteria/SetFirstResultEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/criteria/SetFlushModeEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/criteria/SetLockModeEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/criteria/SetMaxResultsEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/criteria/SetProjectionEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/criteria/SetResultTransformerEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/criteria/SetTimeoutEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/criteria/ShardedCriteria.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/criteria/ShardedCriteriaImpl.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/criteria/ShardedSubcriteria.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/criteria/ShardedSubcriteriaImpl.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/criteria/SubcriteriaFactory.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/criteria/SubcriteriaFactoryImpl.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/engine/
trunk/HibernateExt/shards/src/java/org/hibernate/shards/engine/ShardedSessionFactoryImplementor.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/engine/ShardedSessionImplementor.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/id/
trunk/HibernateExt/shards/src/java/org/hibernate/shards/id/GeneratorRequiringControlSessionProvider.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/id/ShardEncodingIdentifierGenerator.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/id/ShardedTableHiLoGenerator.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/id/ShardedUUIDGenerator.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/loadbalance/
trunk/HibernateExt/shards/src/java/org/hibernate/shards/loadbalance/BaseShardLoadBalancer.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/loadbalance/RandomShardLoadBalancer.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/loadbalance/RoundRobinShardLoadBalancer.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/loadbalance/ShardLoadBalancer.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/package-info.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/AdHocQueryFactoryImpl.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/ExitOperationsQueryCollector.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/NamedQueryFactoryImpl.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/QueryEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/QueryFactory.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/QueryId.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/QueryResult.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/SetBigDecimalEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/SetBigIntegerEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/SetBinaryEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/SetBooleanEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/SetByteEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/SetCacheModeEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/SetCacheRegionEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/SetCacheableEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/SetCalendarDateEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/SetCalendarEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/SetCharacterEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/SetCommentEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/SetDateEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/SetDoubleEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/SetEntityEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/SetFetchSizeEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/SetFirstResultEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/SetFloatEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/SetFlushModeEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/SetIntegerEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/SetLocaleEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/SetLockModeEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/SetLongEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/SetMaxResultsEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/SetParameterEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/SetParameterListEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/SetParametersEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/SetPropertiesEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/SetReadOnlyEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/SetResultTransformerEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/SetSerializableEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/SetShortEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/SetStringEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/SetTextEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/SetTimeEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/SetTimeoutEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/SetTimestampEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/ShardedQuery.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/query/ShardedQueryImpl.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/session/
trunk/HibernateExt/shards/src/java/org/hibernate/shards/session/BaseStatefulInterceptorFactory.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/session/ControlSessionProvider.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/session/CrossShardRelationshipDetectingInterceptor.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/session/CrossShardRelationshipDetectingInterceptorDecorator.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/session/DisableFilterOpenSessionEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/session/EnableFilterOpenSessionEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/session/OpenSessionEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/session/RequiresSession.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/session/SetCacheModeOpenSessionEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/session/SetFlushModeOpenSessionEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/session/SetReadOnlyOpenSessionEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/session/SetSessionOnRequiresSessionEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/session/SetupTransactionOpenSessionEvent.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/session/ShardIdResolver.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/session/ShardedSession.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/session/ShardedSessionException.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/session/ShardedSessionFactory.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/session/ShardedSessionFactoryImpl.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/session/ShardedSessionImpl.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/session/StatefulInterceptorFactory.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/session/SubsetShardedSessionFactoryImpl.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/ShardStrategy.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/ShardStrategyFactory.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/ShardStrategyImpl.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/access/
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/access/LoadBalancedSequentialShardAccessStrategy.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/access/ParallelShardAccessStrategy.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/access/ParallelShardOperationCallable.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/access/SequentialShardAccessStrategy.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/access/ShardAccessStrategy.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/access/StartAwareFutureTask.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/exit/
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/exit/AggregateExitOperation.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/exit/ConcatenateListsExitStrategy.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/exit/CountExitOperation.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/exit/DistinctExitOperation.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/exit/ExitOperation.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/exit/ExitOperationUtils.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/exit/ExitOperationsCollector.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/exit/ExitStrategy.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/exit/FirstNonNullResultExitStrategy.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/exit/FirstResultExitOperation.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/exit/MaxResultsExitOperation.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/exit/OrderExitOperation.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/exit/ProjectionExitOperation.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/exit/ProjectionExitOperationFactory.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/exit/RowCountExitOperation.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/exit/ShardedAvgExitOperation.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/resolution/
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/resolution/AllShardsShardResolutionStrategy.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/resolution/BaseShardResolutionStrategy.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/resolution/ShardResolutionStrategy.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/selection/
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/selection/BaseShardSelectionStrategy.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/selection/LoadBalancedShardSelectionStrategy.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/selection/RoundRobinShardSelectionStrategy.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/selection/ShardResolutionStrategyData.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/selection/ShardResolutionStrategyDataImpl.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/strategy/selection/ShardSelectionStrategy.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/transaction/
trunk/HibernateExt/shards/src/java/org/hibernate/shards/transaction/ShardedTransactionImpl.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/util/
trunk/HibernateExt/shards/src/java/org/hibernate/shards/util/InterceptorDecorator.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/util/Iterables.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/util/Lists.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/util/Maps.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/util/Pair.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/util/Preconditions.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/util/Sets.java
trunk/HibernateExt/shards/src/java/org/hibernate/shards/util/StringUtil.java
trunk/HibernateExt/shards/src/test/
trunk/HibernateExt/shards/src/test/org/
trunk/HibernateExt/shards/src/test/org/hibernate/
trunk/HibernateExt/shards/src/test/org/hibernate/shards/
trunk/HibernateExt/shards/src/test/org/hibernate/shards/AllFastTests.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/AllTests.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/BaseHasShardIdListTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/InstanceShardStrategyImplTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/ShardDefaultMock.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/ShardImplTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/ShardOperationDefaultMock.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/ShardedConfigurationTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/ShardedSessionFactoryDefaultMock.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/ShardedTransactionDefaultMock.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/criteria/
trunk/HibernateExt/shards/src/test/org/hibernate/shards/criteria/AddCriterionEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/criteria/AddOrderEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/criteria/CreateAliasEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/criteria/CreateSubcriteriaEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/criteria/CriteriaEventDefaultMock.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/criteria/CriteriaFactoryDefaultMock.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/criteria/CriteriaFactoryImplTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/criteria/SetCacheModeEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/criteria/SetCacheRegionEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/criteria/SetCacheableEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/criteria/SetCommentEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/criteria/SetFetchModeEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/criteria/SetFetchSizeEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/criteria/SetFirstResultEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/criteria/SetFlushModeEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/criteria/SetLockModeEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/criteria/SetMaxResultsEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/criteria/SetProjectionEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/criteria/SetResultTransformerEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/criteria/SetTimeoutEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/criteria/ShardedCriteriaDefaultMock.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/criteria/ShardedSubcriteriaImplTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/criteria/SubcriteriaFactoryDefaultMock.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/criteria/SubcriteriaFactoryImplTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/defaultmock/
trunk/HibernateExt/shards/src/test/org/hibernate/shards/defaultmock/ClassMetadataDefaultMock.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/defaultmock/CriteriaDefaultMock.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/defaultmock/EntityPersisterDefaultMock.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/defaultmock/InterceptorDefaultMock.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/defaultmock/QueryDefaultMock.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/defaultmock/SessionDefaultMock.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/defaultmock/SessionFactoryDefaultMock.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/defaultmock/SessionImplementorDefaultMock.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/defaultmock/TypeDefaultMock.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/engine/
trunk/HibernateExt/shards/src/test/org/hibernate/shards/engine/ShardedSessionImplementorDefaultMock.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/id/
trunk/HibernateExt/shards/src/test/org/hibernate/shards/id/ShardedTableHiLoGeneratorTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/id/ShardedUUIDGeneratorTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/id/UUIDBigIntGenerator.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/BaseShardingIntegrationTestCase.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/BaseShardingIntegrationTestCasePermutedIntegrationTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/ConfigPermutedIntegrationTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/DbAccessPermutedIntegrationTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/HasPermutation.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/IdGenType.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/MemoryLeakPlugger.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/Permutation.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/PermutedIntegrationTests.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/ShardAccessStrategyType.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/id/
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/id/IdGeneratorPermutedIntegrationTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/model/
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/model/InterceptorBehaviorPermutedIntegrationTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/model/MemoryLeakTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/model/ModelCriteriaPermutedIntegrationTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/model/ModelDataFactory.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/model/ModelPermutedIntegrationTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/model/ModelQueryPermutedIntegrationTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/package-info.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/platform/
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/platform/BaseDatabasePlatform.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/platform/DatabasePlatform.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/platform/DatabasePlatformFactory.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/platform/hsql/
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/platform/hsql/HSQLDatabasePlatform.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/platform/hsql/config/
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/platform/hsql/config/mappings-shardedTableHiLo.hbm.xml
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/platform/hsql/config/mappings-shardedUUID.hbm.xml
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/platform/hsql/config/mappings.hbm.xml
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/platform/hsql/config/shard0.hibernate.cfg.xml
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/platform/hsql/config/shard1.hibernate.cfg.xml
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/platform/hsql/config/shard2.hibernate.cfg.xml
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/platform/mysql/
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/platform/mysql/MySQLDatabasePlatform.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/platform/mysql/config/
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/platform/mysql/config/mappings-shardedTableHiLo.hbm.xml
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/platform/mysql/config/mappings-shardedUUID.hbm.xml
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/platform/mysql/config/mappings.hbm.xml
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/platform/mysql/config/shard0.hibernate.cfg.xml
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/platform/mysql/config/shard1.hibernate.cfg.xml
trunk/HibernateExt/shards/src/test/org/hibernate/shards/integration/platform/mysql/config/shard2.hibernate.cfg.xml
trunk/HibernateExt/shards/src/test/org/hibernate/shards/loadbalance/
trunk/HibernateExt/shards/src/test/org/hibernate/shards/loadbalance/RoundRobinShardLoadBalancerTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/loadbalance/ShardLoadBalancerDefaultMock.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/model/
trunk/HibernateExt/shards/src/test/org/hibernate/shards/model/Building.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/model/Elevator.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/model/Escalator.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/model/Floor.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/model/Office.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/model/Person.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/model/Tenant.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/model/Window.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/QueryEventDefaultMock.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/QueryFactoryDefaultMock.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/SetBigDecimalEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/SetBigIntegerEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/SetBinaryEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/SetBooleanEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/SetByteEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/SetCacheModeEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/SetCacheRegionEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/SetCacheableEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/SetCalendarDateEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/SetCalendarEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/SetCharacterEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/SetCommentEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/SetDateEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/SetDoubleEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/SetEntityEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/SetFetchSizeEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/SetFirstResultEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/SetFloatEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/SetFlushModeEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/SetIntegerEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/SetLocaleEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/SetLockModeEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/SetLongEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/SetMaxResultsEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/SetParameterEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/SetParameterListEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/SetParametersEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/SetPropertiesEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/SetReadOnlyEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/SetResultTransformerEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/SetSerializableEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/SetShortEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/SetStringEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/SetTextEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/SetTimeEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/SetTimeoutEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/SetTimestampEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/query/ShardedQueryDefaultMock.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/session/
trunk/HibernateExt/shards/src/test/org/hibernate/shards/session/CrossShardRelationshipDetectingInterceptorDecoratorTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/session/CrossShardRelationshipDetectingInterceptorTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/session/DisableFilterOpenSessionEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/session/EnableFilterOpenSessionEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/session/OpenSessionEventDefaultMock.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/session/SetCacheModeOpenSessionEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/session/SetFlushModeOpenSessionEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/session/SetReadOnlyOpenSessionEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/session/SetSessionOnRequiresSessionEventTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/session/ShardIdResolverDefaultMock.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/session/ShardedSessionFactoryImplTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/session/ShardedSessionImplTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/strategy/
trunk/HibernateExt/shards/src/test/org/hibernate/shards/strategy/ShardStrategyDefaultMock.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/strategy/ShardStrategyFactoryDefaultMock.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/strategy/access/
trunk/HibernateExt/shards/src/test/org/hibernate/shards/strategy/access/ParallelShardAccessStrategyTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/strategy/access/ParallelShardOperationCallableTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/strategy/access/ShardAccessStrategyDefaultMock.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/strategy/access/StartAwareFutureTaskTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/strategy/exit/
trunk/HibernateExt/shards/src/test/org/hibernate/shards/strategy/exit/AggregateExitOperationTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/strategy/exit/ExitOperationUtilsTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/strategy/exit/ExitStrategyDefaultMock.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/strategy/exit/FirstResultExitOperationTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/strategy/exit/MaxResultExitOperationTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/strategy/exit/OrderExitOperationTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/strategy/exit/ProjectionExitOperationFactoryTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/strategy/exit/RowCountExitOperationTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/strategy/resolution/
trunk/HibernateExt/shards/src/test/org/hibernate/shards/strategy/resolution/ShardResolutionStrategyDataDefaultMock.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/strategy/resolution/ShardResolutionStrategyDefaultMock.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/strategy/selection/
trunk/HibernateExt/shards/src/test/org/hibernate/shards/strategy/selection/LoadBalancedShardSelectionStrategyTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/strategy/selection/ShardSelectionStrategyDefaultMock.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/transaction/
trunk/HibernateExt/shards/src/test/org/hibernate/shards/transaction/ShardedTransactionImplTest.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/util/
trunk/HibernateExt/shards/src/test/org/hibernate/shards/util/JdbcStrategy.java
trunk/HibernateExt/shards/src/test/org/hibernate/shards/util/JdbcUtil.java
Log:
initial shards check-in
Added: trunk/HibernateExt/shards/build.properties.dist
===================================================================
--- trunk/HibernateExt/shards/build.properties.dist (rev 0)
+++ trunk/HibernateExt/shards/build.properties.dist 2007-03-17 16:31:42 UTC (rev 11294)
@@ -0,0 +1,4 @@
+common.dir=.
+src.dir=src
+test.dir=test
+hibernate-core.home=../hibernate-3.2
\ No newline at end of file
Added: trunk/HibernateExt/shards/build.xml
===================================================================
--- trunk/HibernateExt/shards/build.xml (rev 0)
+++ trunk/HibernateExt/shards/build.xml 2007-03-17 16:31:42 UTC (rev 11294)
@@ -0,0 +1,89 @@
+<!--
+
+ Hibernate Annotations ANT build script.
+
+ You need JDK 5.0 installed to build Hibernate Annotations.
+
+-->
+
+<project name="Hibernate Search" default="dist" basedir=".">
+
+ <!-- Give user a chance to override without editing this file
+ (and without typing -D each time it compiles it) -->
+ <property file="build.properties"/>
+ <property file="${user.home}/.ant.properties"/>
+
+ <!-- Name of project and version, used to create filenames -->
+ <property name="Name" value="Hibernate Shards"/>
+ <property name="name" value="hibernate-shards"/>
+ <property name="version" value="3.0.0.BETA1"/>
+ <property name="javadoc.packagenames" value="org.hibernate.shards.*"/>
+ <property name="copy.test" value="true"/>
+ <property name="javac.source" value="1.5"/>
+ <property name="javac.target" value="1.5"/>
+ <property name="jdbc.dir" value="jdbc"/>
+ <property name="common.dir" value="${basedir}/../common"/>
+
+ <import file="${common.dir}/common-build.xml"/>
+
+ <!-- test set customization to support permuted tests -->
+ <fileset dir="${testclasses.dir}" id="junit.batchtestset">
+ <include name="**/*Test.class"/>
+ <include name="**/PermutedIntegrationTests.class"/>
+ <exclude name="**/*PermutedTest.class"/>
+ </fileset>
+
+ <!-- unit test class path customization -->
+ <path id="junit.moduleclasspath">
+ <pathelement location="etc"/>
+ <fileset dir="${jdbc.dir}">
+ <include name="*.jar"/>
+ <include name="*.zip"/>
+ </fileset>
+ </path>
+
+ <!-- override any needed target that need customization
+ typical usage: override compile and refers to common-build.compile to delegate to the common target -->
+
+ <target name="jar" depends="compile" description="Build the distribution .jar file">
+ <!-- probably make sense to move that up -->
+ <mkdir dir="${classes.dir}/META-INF"/>
+ <manifest file="${classes.dir}/META-INF/MANIFEST.MF">
+ <attribute name="Product" value="${Name}"/>
+ <attribute name="Version" value="${version}"/>
+ </manifest>
+ <antcall target="common-build.jar"/>
+ </target>
+
+ <target name="compiletest" depends="common-build.compiletest">
+ <copy todir="${testclasses.dir}">
+ <fileset dir="src/test">
+ <exclude name="**/*.java"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <!-- Some of this can probably be moved to common-build... -->
+ <target name="dist" depends="jar,javadoc,copysource,copytest,copylib,extras"
+ description="Build everything">
+
+ <ant inheritall="false" dir="${basedir}/doc/reference"/>
+ <copy todir="${dist.dir}/doc/reference" failonerror="false">
+ <fileset dir="${basedir}/doc/reference/build">
+ <include name="**/*.*"/>
+ </fileset>
+ </copy>
+
+ <copy todir="${dist.dir}" failonerror="false">
+ <fileset dir="${common.dir}">
+ <include name="common-build.xml"/>
+ </fileset>
+ </copy>
+
+ <copy file="${basedir}/build.properties.dist" tofile="${dist.dir}/build.properties" failonerror="false">
+ </copy>
+ <antcall target="common-build.dist"/>
+ </target>
+
+
+</project>
Added: trunk/HibernateExt/shards/changelog.txt
===================================================================
--- trunk/HibernateExt/shards/changelog.txt (rev 0)
+++ trunk/HibernateExt/shards/changelog.txt 2007-03-17 16:31:42 UTC (rev 11294)
@@ -0,0 +1,7 @@
+Hibernate Shards Changelog
+==========================
+
+3.0.0.BETA1 (20-03-2007)
+---------------------
+
+Initial release
\ No newline at end of file
Added: trunk/HibernateExt/shards/doc/api/package.html
===================================================================
--- trunk/HibernateExt/shards/doc/api/package.html (rev 0)
+++ trunk/HibernateExt/shards/doc/api/package.html 2007-03-17 16:31:42 UTC (rev 11294)
@@ -0,0 +1 @@
+<body></body>
Added: trunk/HibernateExt/shards/doc/reference/.cvsignore
===================================================================
--- trunk/HibernateExt/shards/doc/reference/.cvsignore (rev 0)
+++ trunk/HibernateExt/shards/doc/reference/.cvsignore 2007-03-17 16:31:42 UTC (rev 11294)
@@ -0,0 +1 @@
+build
Added: trunk/HibernateExt/shards/doc/reference/build.xml
===================================================================
--- trunk/HibernateExt/shards/doc/reference/build.xml (rev 0)
+++ trunk/HibernateExt/shards/doc/reference/build.xml 2007-03-17 16:31:42 UTC (rev 11294)
@@ -0,0 +1,17 @@
+<project name="Documentation" default="all.doc" basedir=".">
+
+ <!-- Use the core Hibernate3 doc build system -->
+ <import file="../../../common/common-build.xml"/>
+ <import file="${hibernate-cvs.doc.reference}/build.xml"/>
+
+
+ <target name="all.doc" depends="clean">
+
+ <!-- TRANSLATOR: Duplicate this call for your language -->
+ <antcall target="lang.all">
+ <param name="docname" value="hibernate_shard"/>
+ <param name="lang" value="en"/>
+ </antcall>
+ </target>
+
+</project>
Added: trunk/HibernateExt/shards/doc/reference/en/images/hibernate_logo_a.png
===================================================================
(Binary files differ)
Property changes on: trunk/HibernateExt/shards/doc/reference/en/images/hibernate_logo_a.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/HibernateExt/shards/doc/reference/en/master.xml
===================================================================
--- trunk/HibernateExt/shards/doc/reference/en/master.xml (rev 0)
+++ trunk/HibernateExt/shards/doc/reference/en/master.xml 2007-03-17 16:31:42 UTC (rev 11294)
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3CR3//EN"
+ "../../../../../Hibernate3/doc/reference/support/docbook-dtd/docbookx.dtd" [
+ <!ENTITY architecture SYSTEM "modules/architecture.xml">
+ <!ENTITY configuration SYSTEM "modules/configuration.xml">
+ <!ENTITY shardstrategy SYSTEM "modules/shardstrategy.xml">
+ <!ENTITY resharding SYSTEM "modules/resharding.xml">
+ <!ENTITY querying SYSTEM "modules/querying.xml">
+ <!ENTITY limitations SYSTEM "modules/limitations.xml">
+ ]>
+<book lang="en">
+ <bookinfo>
+ <title>Hibernate Shards</title>
+ <subtitle>Horizontal Partitioning With Hibernate</subtitle>
+ <subtitle>Reference Guide</subtitle>
+ <releaseinfo>3.0.0.BETA1</releaseinfo>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/hibernate_logo_a.png" format="PNG"/>
+ </imageobject>
+ </mediaobject>
+ </bookinfo>
+ <toc/>
+ <preface id="preface">
+ <title>Preface</title>
+ <para>
+ You can't always put all your relational data in a single relational database.
+ Sometimes you simply have too much data. Sometimes you have a distributed deployment architecture
+ (network latency between California and India might be too high to have a single database). There might
+ even be non-technical reasons (a potential customer simply won't do the deal unless her company's data lives in its
+ own db instance). Whatever your reasons, talking to multiple relational databases inevitably complicates
+ the development of your application. Hibernate Shards is a framework that is designed to encapsulate and
+ minimize this complexity by adding support for
+ <ulink url="http://en.wikipedia.org/w/index.php?title=Partition_%28database%29&oldid=99996308">
+ horizontal partitioning
+ </ulink>
+ on top of Hibernate Core. Simply put, we aim to provide a unified view of multiple databases via Hibernate.
+ </para>
+ <para>
+ So what's a shard? Good question. "Shard" is just another word for "segment" or "partition," but
+ it's the term of choice within Google. Hibernate Shards was originally the
+ <ulink url="http://www.google.com/support/jobs/bin/static.py?page=about.html">20 percent project</ulink>
+ of a small team of Google engineers, so the project nomenclature revolved around shards from the beginning.
+ We're open sourcing what we have so far because we want the Hibernate
+ community to be able to benefit from our efforts as soon as possible, but also with the hope and expectation
+ that this community will be able to help us reach a GA release much faster than if we kept this
+ under wraps. We fully expect to find glitches in both our design and implementation, and we appreciate your
+ patience as we work through them.
+ </para>
+ </preface>
+
+ &architecture;
+
+ &configuration;
+
+ &shardstrategy;
+
+ &resharding;
+
+ &querying;
+
+ &limitations;
+</book>
Added: trunk/HibernateExt/shards/doc/reference/en/modules/architecture.xml
===================================================================
--- trunk/HibernateExt/shards/doc/reference/en/modules/architecture.xml (rev 0)
+++ trunk/HibernateExt/shards/doc/reference/en/modules/architecture.xml 2007-03-17 16:31:42 UTC (rev 11294)
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<chapter id="shards-architecture">
+ <title>Architecture</title>
+ <sect1 id="shards-architecture-overview" revision="1">
+ <title>Overview</title>
+ <para>
+ Hibernate Shards is an extension to Hibernate Core that is designed to encapsulate and minimize the
+ complexity of working with sharded (horizontally partitioned) data. Hibernate Shards can be conceptually
+ divided into two areas, both of which you will need to understand in order to be successful. The two areas
+ are:
+ <itemizedlist mark="opencircle">
+ <listitem>
+ <para>Generalized sharding logic</para>
+ </listitem>
+ <listitem>
+ <para>Application specific sharding logic</para>
+ </listitem>
+ </itemizedlist>
+ We'll discuss each of these areas in turn.
+ </para>
+ </sect1>
+ <sect1 id="shards-architecture-general" revision="1">
+ <title>Generalized Sharding Logic</title>
+ <para>The primary goal of Hibernate Shards is to enable application developers to query and transact against
+ sharded datasets using the standard Hibernate Core API. This allows existing applications that use Hibernate
+ but do not yet need sharding to adopt our solution without major refactoring if and when they do reach this
+ stage. This also allows application developers who are familiar with Hibernate, need sharding, and are starting from
+ scratch to become productive in a short amount of time because there will be no need to ramp-up on a new
+ toolset. With this goal in mind, it should come as no surprise that Hibernate Shards primarily consists of
+ shard-aware implementations of many of the Hibernate Core interfaces you already know and love.
+ </para>
+ <para>
+ Most Hibernate-related application code primarily interacts with four interfaces provided by Hibernate
+ Core:
+ <itemizedlist mark="opencircle">
+ <listitem>
+ <para>
+ <classname>org.hibernate.Session</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <classname>org.hibernate.SessionFactory</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <classname>org.hibernate.Criteria</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <classname>org.hibernate.Query</classname>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Hibernate Shards provides shard-aware extensions of these four interfaces so that your code does not need to
+ know that it is interacting with a sharded dataset (unless of course you have specific reasons for exposing
+ this fact). The shard-aware extensions are:
+ <itemizedlist mark="opencircle">
+ <listitem>
+ <para>
+ <classname>org.hibernate.shards.session.ShardedSession</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <classname>org.hibernate.shards.ShardedSessionFactory</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <classname>org.hibernate.shards.criteria.ShardedCriteria</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <classname>org.hibernate.shards.query.ShardedQuery</classname>
+ </para>
+ </listitem>
+ </itemizedlist>
+ The implementations we provide for these four shard-aware interfaces serve as a sharding engine that knows how to apply your
+ application-specific sharding logic across your various data stores. We don't expect application developers
+ to need to write much code that knowingly interacts with these interfaces, so if you do find yourself
+ declaring or passing around Sharded instances take a step back and see if you can make do with the parent
+ interface instead.
+ </para>
+ </sect1>
+ <sect1 id="shards-architecture-application" revision="1">
+ <title>Application Specific Sharding Logic</title>
+ <para>
+ Every application that uses Hibernate Shards will have its own rules for how data gets distributed across
+ its shards. Rather than attempt to anticipate all these rules (an effort practically guaranteed to fail) we
+ have instead provided a set of interfaces behind which you can encode your application's data distribution
+ logic. These interfaces are:
+ <itemizedlist mark="opencircle">
+ <listitem>
+ <para>
+ <classname>org.hibernate.shards.strategy.selection.ShardSelectionStrategy</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <classname>org.hibernate.shards.strategy.resolution.ShardResolutionStrategy</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <classname>org.hibernate.shards.strategy.access.ShardAccessStrategy</classname>
+ </para>
+ </listitem>
+ </itemizedlist>
+ The implementations you provide for these three interfaces plus the id generation implementation you choose
+ (more on this in the Sharding Strategy chapter) comprise the
+ <emphasis>Sharding Strategy</emphasis>
+ for your application. The sharding engine described in the previous section knows how to use the Sharding
+ Strategy you provide.
+ </para>
+ <para>In order to help you get up and running quickly, Hibernate Shards comes with a couple simple
+ implementations of these interfaces. We expect that they will aid you in your prototyping or in the early
+ stages of actual application development, but we also expect that, sooner or later, most applications will
+ provide their own implementations.
+ </para>
+ <para>For more information on Sharding Strategies please consult the chapter of the same name.</para>
+ </sect1>
+</chapter>
Property changes on: trunk/HibernateExt/shards/doc/reference/en/modules/architecture.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/HibernateExt/shards/doc/reference/en/modules/configuration.xml
===================================================================
--- trunk/HibernateExt/shards/doc/reference/en/modules/configuration.xml (rev 0)
+++ trunk/HibernateExt/shards/doc/reference/en/modules/configuration.xml 2007-03-17 16:31:42 UTC (rev 11294)
@@ -0,0 +1,273 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="shards-configuration">
+ <title>Configuration</title>
+ <sect1 id="shards-configuration-overview" revision="1">
+ <title>Overview</title>
+ <para>
+ When using Hibernate Shards you will find yourself making typical Hibernate Core API calls most of them
+ time. However, in order to get your shard-aware datasource properly configured you'll need to understand a
+ few concepts that are specific to Hibernate Shards. We'll introduce these new concepts as part of a concrete
+ example. Let's take a look at the object model, database schema, and mapping we'll be using in our
+ examples throughout the documentation.
+ </para>
+ <para>
+ Our example application will receive weather reports from cities all over the world and store this information in a
+ relational database.
+ </para>
+ <sect2 id="shards-configuration-overview-sample-schema" revision="1">
+ <title>Weather Report Database Schema</title>
+ <programlisting><![CDATA[
+CREATE TABLE WEATHER_REPORT (
+ REPORT_ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ CONTINENT ENUM('AFRICA', 'ANTARCTICA', 'ASIA', 'AUSTRALIA', 'EUROPE', 'NORTH AMERICA', 'SOUTH AMERICA'),
+ LATITUDE FLOAT,
+ LONGITUDE FLOAT,
+ TEMPERATURE INT,
+ REPORT_TIME TIMESTAMP
+);
+ ]]></programlisting>
+ </sect2>
+ <sect2 id="shards-configuration-overview-sample-model" revision="1">
+ <title>Weather Report Object Model</title>
+ <programlisting><![CDATA[
+public class WeatherReport {
+ private Integer reportId;
+ private String continent;
+ private BigDecimal latitude;
+ private BigDecimal longitude;
+ private int temperature;
+ private Date reportTime;
+
+ ... // getters and setters
+}
+ ]]></programlisting>
+ </sect2>
+ <sect2 id="shards-configuration-overview-sample-mapping" revision="1">
+ <title>Contents of weather.hbm.xml</title>
+ <programlisting><![CDATA[
+<hibernate-mapping package="org.hibernate.shards.example.model">
+ <class name="WeatherReport" table="WEATHER_REPORT">
+ <id name="reportId" column="REPORT_ID">
+ <generator class="native"/>
+ </id>
+ <property name="continent" column="CONTINENT"/>
+ <property name="latitude" column="LATITUDE"/>
+ <property name="longitude" column="LONGITUDE"/>
+ <property name="temperature" column="TEMPERATURE"/>
+ <property name="reportTime" type="timestamp" column="REPORT_TIME"/>
+ </class>
+</hibernate-mapping>
+ ]]></programlisting>
+ </sect2>
+ </sect1>
+ <sect1 id="shards-configuration-sf" revision="1">
+ <title>Obtaining a ShardedSessionFactory</title>
+ <para>
+ Before we show you how to obtain a
+ <classname>ShardedSessionFactory</classname>
+ let's look at some code that allows you to obtain a standard
+ <classname>SessionFactory</classname>.
+ <programlisting><![CDATA[
+1 public SessionFactory createSessionFactory() {
+2 Configuration config = new Configuration();
+3 config.configure("weather.hibernate.cfg.xml");
+4 config.addResource("weather.hbm.xml");
+5 return config.buildSessionFactory();
+6 }
+]]></programlisting>
+ This is pretty straightforward. We're instantiating a new
+ <classname>Configuration</classname>
+ object (line 2), telling that
+ <classname>Configuration</classname>
+ to read
+ its properties from a resource named "weather.hibernate.cfg.xml" (line 3), and then providing
+ "weather.hbm.xml" as a source of OR
+ mapping data (line 4). We are then asking the
+ <classname>Configuration</classname>
+ to build a
+ <classname>SessionFactory</classname>, which we return (line 5).
+ </para>
+ <para>
+ Let's also take a look at the configuration file we're loading in:
+ <programlisting><![CDATA[
+ 1 <!-- Contents of weather.hibernate.cfg.xml -->
+ 2 <hibernate-configuration>
+ 3 <session-factory name="HibernateSessionFactory">
+ 4 <property name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
+ 5 <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
+ 6 <property name="connection.url">jdbc:mysql://localhost:3306/mydb</property>
+ 7 <property name="connection.username">my_user</property>
+ 8 <property name="connection.password">my_password</property>
+ 9 </session-factory>
+ 10 </hibernate-configuration>
+ ]]></programlisting>
+ </para>
+ <para>
+ As you can see, there's nothing particularly interesting going on in the configuration file or the mapping
+ file.
+ </para>
+ <para>
+ You'll be pleased to know that the process of configuring your application to use Hibernate Shards is not
+ radically
+ different. The main difference is that we're providing connectivity information for multiple datasources,
+ and we're
+ also describing our desired sharding behavior via a
+ <classname>ShardStrategyFactory</classname>. Let's look at some sample configuration code for our weather
+ report application, which we're going to run with 3 shards.
+ <programlisting><![CDATA[
+1 public SessionFactory createSessionFactory() {
+2 Configuration prototypeConfig = new Configuration().configure("shard0.hibernate.cfg.xml");
+3 prototypeConfig.addResource("weather.hbm.xml");
+4 List<Configuration> shardConfigs = new ArrayList<Configuration>();
+5 shardConfigs.add(new Configuration().configure("shard0.hibernate.cfg.xml");
+6 shardConfigs.add(new Configuration().configure("shard1.hibernate.cfg.xml");
+7 shardConfigs.add(new Configuration().configure("shard2.hibernate.cfg.xml");
+8 ShardStrategyFactory shardStrategyFactory = buildShardStrategyFactory();
+9 ShardedConfiguration shardedConfig = new ShardedConfiguration(
+10 prototypeConfig,
+11 shardConfigs,
+12 shardStrategyFactory);
+13 return shardedConfig.buildShardedSessionFactory();
+14 }
+15
+16 ShardStrategyFactory buildShardStrategyFactory() {
+17 ShardStrategyFactory shardStrategyFactory = new StrategyFactory() {
+18 public ShardStrategy newShardStrategy(List shardIds) {
+19 RoundRobinShardLoadBalancer loadBalancer = new RoundRobinShardLoadBalancer(shardIds);
+20 ShardSelectionStrategy pss = new RoundRobinShardSelectionStrategy(loadBalancer);
+21 ShardResolutionStrategy prs = new AllShardsShardResolutionStrategy(shardIds);
+22 ShardAccessStrategy pas = new SequentialShardAccessStrategy();
+23 return new ShardStrategyImpl(pss, prs, pas);
+24 }
+25 }
+26 return shardStrategyFactory;
+27 }
+ ]]></programlisting>
+ </para>
+ <para>
+ So what's going on here? First, you'll notice that we're actually allocating four
+ <classname>Configurations</classname>. The first <classname>Configuration</classname>
+ we allocate (line 2) is the prototype <classname>Configuration</classname>. The
+ <classname>ShardedSessionFactory</classname>
+ we eventually construct (line 13) will contain references to 3 standard
+ <classname>SessionFactory</classname> objects. Each of these 3 standard
+ <classname>SessionFactory</classname> objects will have been constructed from the prototype configuration. The
+ only attributes that will differ across these standard <classname>SessionFactory</classname>
+ objects are:
+ <itemizedlist mark="opencircle">
+ <listitem>
+ <para>connection.url</para>
+ </listitem>
+ <listitem>
+ <para>connection.user</para>
+ </listitem>
+ <listitem>
+ <para>connection.password</para>
+ </listitem>
+ </itemizedlist>
+ The three <classname>Configuration</classname> objects we're loading (lines 5 - 7) will be consulted for the
+ shard-specific database url, database user, and database password, and that's all. This means that if you change the
+ connection pool parameters in shard1.hibernate.cfg.xml, those parameters will be ignored. If you add another
+ mapping file to the <classname>Configuration</classname>
+ loaded with the properties defined in weather2.hibernate.cfg.xml, that mapping will be ignored.
+ With the exception of the properties listed above, the configuration of our shard-aware
+ <classname>SessionFactory</classname> comes entirely from the prototype
+ <classname>Configuration</classname>. This may seem a bit strict, but the sharding code
+ needs to assume that all shards are identically configured.
+ </para>
+ <para>
+ If you're looking at this code and thinking it seems a bit silly to provide fully-formed configuration
+ documents that, save a couple special properties, are ignored, rest assured we've looked at this code and
+ thought the same thing. We expect the configuration mechanism to evolve over time. We picked this particular
+ mechanism because it allowed the greatest reuse of configuration code that was already available in
+ Hibernate Core.
+ </para>
+ <para>
+ Once we've built our <classname>Configuration</classname>
+ objects we need to put together a <classname>ShardStrategyFactory</classname>
+ (line 8). A <classname>ShardStrategyFactory</classname>
+ is an object that knows how to create the 3 types of strategies that programmers can use to control the sharding
+ behavior of the system. For more information on these strategies please see the chapters titled Sharding Strategies.
+ </para>
+ <para>
+ Once we've instantiated our <classname>ShardStrategyFactory</classname> we can construct a
+ <classname>ShardedConfiguration</classname> (line 9), and once we've constructed
+ our <classname>ShardedConfiguration</classname> we can ask it to create a
+ <classname>ShardedSessionFactory</classname> (line 13). It's important to note that
+ <classname>ShardedSessionFactory</classname> extends <classname>SessionFactory</classname>. This means we can return a standard
+ <classname>SessionFactory</classname> (line 1). Our application's Hibernate code doesn't need
+ to know that it's interacting with sharded data.
+ </para>
+ <para>
+ Now let's take a look at the configuration and mapping files that we loaded in. You'll definitely recognize
+ them, but there are a few key additions and modifications related to sharding.
+ <programlisting><![CDATA[
+ 1 <!-- Contents of weather0.hibernate.cfg.xml -->
+ 2 <hibernate-configuration>
+ 3 <session-factory name="HibernateSessionFactory0"> <!-- note the different name -->
+ 4 <property name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
+ 5 <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
+ 6 <property name="connection.url">jdbc:mysql://localhost:3306/mydb</property>
+ 7 <property name="connection.username">my_user</property>
+ 8 <property name="connection.password">my_password</property>
+ 9 <property name="hibernate.connection.shard_id">0</property> <!-- new -->
+ 10 <property name="hibernate.shard.check_all_associated_objects_for_different_shards">true</property> <!-- new -->
+ 11 </session-factory>
+ 12 </hibernate-configuration>
+ ]]></programlisting>
+ <programlisting><![CDATA[
+ 1 <!-- Contents of weather1.hibernate.cfg.xml -->
+ 2 <hibernate-configuration>
+ 3 <session-factory name="HibernateSessionFactory1"> <!-- note the different name -->
+ 4 <property name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
+ 5 <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
+ 6 <property name="connection.url">jdbc:mysql://localhost:3306/mydb</property>
+ 7 <property name="connection.username">my_user</property>
+ 8 <property name="connection.password">my_password</property>
+ 9 <property name="hibernate.connection.shard_id">1</property> <!-- new -->
+ 10 <property name="hibernate.shard.check_all_associated_objects_for_different_shards">true</property> <!-- new -->
+ 11 </session-factory>
+ 12 </hibernate-configuration>
+ ]]></programlisting>
+ We'll skip the contents of weather2.hibernate.cfg.xml because the pattern should by now be obvious. We're
+ giving each session factory a unique name via the name attribute of the session-factory element, and we're
+ also giving each session factory a shard id. This is required. If you try to configure a
+ <classname>ShardedSessionFactory</classname> with a <classname>Configuration</classname>
+ object that does not have a shard id you'll get an error. At the moment we require that the shard id of one
+ of your session factories be 0. Beyond that, the internal representation of a shard id is a
+ <classname>java.lang.Integer</classname> so all values within that range are legal. Finally, each shard that is mapped into a
+ <classname>ShardedSessionFactory</classname> must have a unique shard id. If you have a duplicate shard id you'll get an error.
+ </para>
+ <para>
+ The other noteworthy addition is the rather verbose but hopefully descriptive
+ "hibernate.shard.check_all_associated_objects_for_different_shards." You can read more about this in the
+ chapter on limitations.
+ </para>
+ <para>
+ Now let's still see how the mapping file has changed.
+ <programlisting><![CDATA[
+<hibernate-mapping package="org.hibernate.shards.example.model">
+ <class name="WeatherReport" table="WEATHER_REPORT">
+ <id name="reportId" column="REPORT_ID" type="long">
+ <generator class="org.hibernate.shards.id.ShardedTableHiLoGenerator"/>
+ </id>
+ <property name="country" column="COUNTRY"/>
+ <property name="city" column="CITY"/>
+ <property name="temperature" column="TEMPERATURE"/>
+ <property name="reportTime" type="timestamp" column="REPORT_TIME"/>
+ </class>
+</hibernate-mapping>
+ ]]></programlisting>
+ The only meaningful change in the mapping file from the non-sharded version is in our selection of a
+ shard-aware id generator. We'll cover id generation in more detail in the chapter on Shard Strategies.
+ </para>
+ </sect1>
+ <sect1 id="shards-configuration-limitations" revision="1">
+ <title>Configuration Limitations</title>
+ <para>
+ Many of you will quickly realize that the configuration mechanism we've provided won't work if you're
+ configuring your <classname>SessionFactory</classname>
+ via JPA or Hibernate Annotations. It's true. We expect these deficiencies to be addressed shortly.
+ </para>
+ </sect1>
+</chapter>
Property changes on: trunk/HibernateExt/shards/doc/reference/en/modules/configuration.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/HibernateExt/shards/doc/reference/en/modules/limitations.xml
===================================================================
--- trunk/HibernateExt/shards/doc/reference/en/modules/limitations.xml (rev 0)
+++ trunk/HibernateExt/shards/doc/reference/en/modules/limitations.xml 2007-03-17 16:31:42 UTC (rev 11294)
@@ -0,0 +1,204 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="shards-limitations">
+ <title>Limitations</title>
+ <sect1 id="shards-limitations-api" revision="1">
+ <title>Incomplete Implementation of Hibernate API</title>
+ <para>
+ In order to speed-up the initial release of Hibernate Shards, some
+ parts of the Hibernate API that we rarely use were left unimplemented. Of course things that
+ we rarely used are probably critical for some applications, so if we've left you out in the cold
+ we apologize. We're committed to getting the rest of the api implemented quickly. For details on which
+ methods were not implemented, please see the Javadoc for <classname>ShardedSessionImpl</classname>,
+ <classname>ShardedCriteriaImpl</classname>, and <classname>ShardedQueryImpl</classname>.
+ </para>
+ </sect1>
+ <sect1 id="shards-limitations-cross-shard" revision="1">
+ <title>Cross-Shard Object Graphs</title>
+ <para>
+ Hibernate Shards does not currently support cross-shard object graphs.
+ </para>
+ <para>
+ In other words, it is illegal to create an association between objects A and B when A and B
+ live on different shards. The workaround is to define a property on A which uniquely identifies an
+ object of type B, and to use that property to load object B (remember what life was like
+ before Hibernate? Yeah, just like that.)
+ </para>
+ <para>
+ For example:
+ <programlisting>
+ --need domain for examples--
+ </programlisting>
+ </para>
+ <para>
+ In some applications your model may be constructed in such a way that it is difficult to make this kind
+ of mistake, but in some applications it may be easier. The scary thing here is that if you make this
+ mistake, Hibernate will consider the "bad" object in the list to be a new object and, assuming you have
+ cascades enabled for this relationship, it will create a new version of this object on a different shard.
+ This is trouble. In order to help prevent this sort of thing from happening we have an interceptor
+ called <classname>CrossShardRelationshipDetectingInterceptor</classname> that checks for cross-shard
+ relationships on every object that is created or saved.
+ </para>
+ <para>
+ Unfortunately there is a cost associated with using the <classname>CrossShardRelationshipDetectingInterceptor</classname>.
+ In order to determine the shard on which an associated object resides we need to fetch the object from the
+ database, so if you have lazy-loaded associations the interceptor will resolve those associations as part
+ of its checks. This is potentially quite expensive, and may not be suitable for a production system.
+ With this in mind, we've made it easy to configure whether or not this check is performed via the
+ "hibernate.shard.check_all_associated_objects_for_different_shards" property we referenced in the chapter
+ on configuration. If this property is set to "true" a <classname>CrossShardRelationshipDetectingInterceptor</classname>
+ will be registered with every <classname>ShardedSession</classname> that is established. Don't worry,
+ you can still register your own interceptor as well. Our expectation is that most applications will have
+ this check enabled in their dev and qa environments and disabled in their staging, load and performance,
+ and production environments.
+ </para>
+ </sect1>
+ <sect1 id="shards-limitations-txns" revision="1">
+ <title>Distributed Transactions</title>
+ <para>
+ Hibernate Shards does not provide support for distributed transactions within
+ a non-managed environment. If your application requires
+ distributed transactions you need to plug in a transaction management implementation that supports
+ distributed transactions.
+ </para>
+ </sect1>
+ <sect1 id="shards-limitations-interceptors" revision="1">
+ <title>Stateful Interceptors</title>
+ <para>
+ We've done our best to make sure that, by and large, Hibernate Core code runs just fine when using Hibernate
+ Shards. There are, unfortunately, exceptions, and one of those exceptions is when your application needs
+ to use an
+ <classname>org.hibernate.Interceptor</classname>
+ that maintains state.
+ </para>
+ <para>
+ Stateful interceptors need special handling because, under the hood, we're instantiating one
+ <classname>org.hibernate.SessionImpl</classname> per shard. If we want an
+ <classname>Interceptor</classname> associated with the
+ <classname>Session</classname>, we need to pass in whatever
+ <classname>Interceptor</classname> was provided when the
+ <classname>ShardedSession</classname> was created. If that
+ <classname>Interceptor</classname> is stateful, the
+ <classname>Interceptor</classname> state for one
+ <classname>Session</classname> will be visible in all
+ <classname>Sessions</classname>. When you consider the sorts of things that are typically done in stateful
+ <classname>Interceptors</classname> (auditing for example), you can see how this can pose a problem.
+ </para>
+ <para>
+ Our solution is to require users to provide a
+ <classname>StatefulInterceptorFactory</classname> when they establish their
+ <classname>Session</classname> objects (which are really
+ <classname>ShardedSessions</classname>). If the provided
+ <classname>Interceptor</classname> implements this interface, Hibernate Shards will ensure that a
+ fresh instance of the type of <classname>Interceptor</classname>
+ returned by <classname>StatefulInterceptorFactory.newInstance()</classname>
+ will be passed to each <classname>Session</classname>
+ that is established under the hood. Here's an example:
+ <programlisting><![CDATA[
+public class MyStatefulInterceptorFactory extends BaseStatefulInterceptorFactory {
+ public Interceptor newInstance() {
+ return new MyInterceptor();
+ }
+}
+]]></programlisting>
+
+ </para>
+ <para>
+ Many <classname>Interceptor</classname> implementations require a reference to the
+ <classname>Session</classname> with which they're associated. In the case of a stateful
+ <classname>Interceptor</classname>, you want your <classname>Interceptor</classname>
+ to have a reference to the real (shard-specific) <classname>Session</classname>, not the shard-aware
+ <classname>Session</classname>. In order to facilitate this, you have the choice of having the type of
+ <classname>Interceptor</classname> that is constructed by the
+ <classname>StatefulInterceptorFactory</classname> implement the
+ <classname>RequiresSession</classname> interface. If the
+ <classname>Interceptor</classname> constructed by the
+ <classname>StatefulInterceptorFactory</classname> implements this interface, Hibernate Shards will provide the
+ <classname>Interceptor</classname> with a reference to the real (shard-specific)
+ <classname>Session</classname> once the factory constructs it. This way your
+ <classname>Interceptor</classname> can safely and accurately interact with a speicific shard. Here's an example:
+ <programlisting><![CDATA[
+public class MyStatefulInterceptor implements Interceptor, RequiresSession {
+ private Session session;
+
+ public void setSession(Session session) {
+ this.session = session;
+ }
+
+ ... // Interceptor interface impl
+}
+]]></programlisting>
+ </para>
+ <para>
+ Due to the basic nature of the problem we don't expect this to change anytime soon.
+ </para>
+ </sect1>
+ <sect1 id="shards-limitations-base-ids" revision="1">
+ <title>Objects With Ids That Are Base Types</title>
+ <para>
+ With Hibernate your model objects can use whatever they want as their ids so long as the id can be
+ represented by a <classname>Serializable</classname> (or autoboxed into a
+ <classname>Serializable</classname>). With Hibernate Shards you are slightly more constrained
+ because we don't support base types.
+ </para>
+ <para>
+ So this is no good:
+ <programlisting><![CDATA[
+public class WeatherReport {
+ private int weatherReportId; // trouble
+
+ public int getWeatherReportId() {
+ return weatherReportId;
+ }
+
+ public void setWeatherReportId(int id) {
+ weatherReportId = id;
+ }
+}
+]]></programlisting>
+ </para>
+ <para>
+ But this is just lovely:
+ <programlisting><![CDATA[
+public class WeatherReport {
+ private Integer weatherReportId; // goodness
+
+ public Integer getWeatherReportId() {
+ return weatherReportId;
+ }
+
+ public void setWeatherReportId(Integer id) {
+ weatherReportId = id;
+ }
+}
+]]></programlisting>
+ </para>
+ <para>
+ Do we have a good reason for this limitation? Not really. It's the result of an implementation
+ choice that has leaked out and made everyone's lives a tiny bit worse. If you simply must
+ use Hibernate Shards and you simply must model your ids with base types, don't call
+ <classname>Session.saveOrUpdate</classname>. We aim to address this leak soon and let you get back
+ to modeling whatever way you like (although for the record, we prefer object ids because
+ they make it easy to determine whether or not an object has had an id assigned).
+ </para>
+ </sect1>
+ <sect1 id="shards-limitations-replicated-data" revision="1">
+ <title>Replicated Data</title>
+ <para>
+ Even though this is a framework for horizontal partitioning, there is almost always
+ read-only (or at least slow changing) data that lives on every shard. If you're just
+ reading these entities we don't have a problem, but if you want to associate these
+ entities with sharded entities we run into trouble. Suppose you have a Country table
+ on every shard with the exact same data, and suppose WeatherReport has a Country member.
+ How do we guarantee that the Country you associate with that WeatherReport is associated
+ with the same shard as the WeatherReport? If we get it wrong we'll end up with a cross-shard
+ relationship, and that's bad.
+ </para>
+ <para>We have a number
+ of ideas about how to make this easy to deal with but we have not yet implemented any of them.
+ In the short term, we think your best bet is to either not create object relationships between
+ sharded entities and replicated entities. In otherwords, just model the relationship like
+ you would if you weren't using an OR Mapping tool. We know this is clunky and annoying.
+ We'll take care of it soon.
+ </para>
+ </sect1>
+</chapter>
Added: trunk/HibernateExt/shards/doc/reference/en/modules/querying.xml
===================================================================
--- trunk/HibernateExt/shards/doc/reference/en/modules/querying.xml (rev 0)
+++ trunk/HibernateExt/shards/doc/reference/en/modules/querying.xml 2007-03-17 16:31:42 UTC (rev 11294)
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<chapter id="shards-querying">
+ <title>Querying</title>
+ <sect1 id="shards-querying-overview" revision="1">
+ <title>Overview</title>
+ <para>
+ Executing queries across shards can be hard. In this chapter we'll discuss what works,
+ what doesn't, and what you can do to stay out of trouble.
+ </para>
+ </sect1>
+ <sect1 id="shards-querying-criteria" revision="1">
+ <title>Criteria</title>
+ <para>
+ As we discuss in the chapter on Limitations, we do not yet have a complete implementation of the
+ Hibernate Core API. This limitation applies to <classname>ShardedCriteriaImpl</classname>,
+ which is a shard-aware implementation of the <classname>Criteria</classname> interface.
+ In this chapter we won't go into the details of specific things that haven't been implemented.
+ Rather, we're going to discuss the types of <classname>Criteria</classname> queries that are
+ problematic in a sharded environment.
+ </para>
+ <para>
+ Simply put, queries that do sorting are trouble. Why? Because we can't return a properly
+ sorted list without the ability to compare any value in the list to any other value in the list,
+ and the entire list isn't available until the results of the individual queries have been
+ collected in the application tier. The sorting needs to take place inside Hibernate Shards, and
+ in order for this to happen we require that all objects returned by a <classname>Criteria</classname>
+ query with an order-by clause implement the <classname>Comparable</classname> interface.
+ If the type of the objects you return do not implement this exception you'll receive an
+ exception.
+ </para>
+ <para>
+ Distinct clauses are trouble as well. So much trouble, in fact, that at the moment we don't
+ even support them. Sorry about that.
+ </para>
+ <para>
+ On the other hand, while distinct and order-by are trouble, aggregation works just fine.
+ Consider the following example:
+ <programlisting><![CDATA[
+ // fetch the average of all temperatures recorded since last thursday
+ Criteria crit = session.createCriteria(WeatherReport.class);
+ crit.add(Restrictions.gt("timestamp", lastThursday));
+ crit.setProjection(Projections.avg("temperature"));
+ return crit.list();
+ ]]></programlisting>
+ In a single-shard environment this query can be easily answered, but in a multi-shard
+ environment it's a little bit trickier. Why? Because just getting the average from each
+ shard isn't enough to calculate the average across all shards. In order to calculate this
+ piece of information we need not just the average but the number of records from each shard.
+ This is exactly what we do, and the performance hit (doing an extra count as part of
+ each query) is probably negligible.
+ Now, if we wanted the median
+ we'd be in trouble (just adding the count to the query would not provide enough information
+ to perform the calculation), but at the moment <classname>Criteria</classname> doesn't expose
+ a median function so we'll deal with that if and when it becomes and issue.
+ </para>
+ </sect1>
+ <sect1 id="shards-querying-hql" revision="1">
+ <title>HQL</title>
+ <para>
+ Our support for HQL is, at this point, not nearly as good as the support we have for <classname>Criteria</classname>
+ queries. We have not yet implemented any extensions to the query parser, so we don't support
+ distinct, order-by, or aggregations. This means you can only use HQL for very simple queries. You're
+ probably better off staying clear of HQL in this release if you can help it.
+ </para>
+ </sect1>
+ <sect1 id="shards-querying-strategy" revision="1">
+ <title>Use of Shard Strategy When Querying</title>
+ <para>
+ The only component of your shard strategy that is consulted when executing a query (<classname>Criteria</classname>
+ or HQL) is the <classname>ShardAccessStrategy</classname>. <classname>ShardSelectionStrategy</classname>
+ is ignored because executing a query doesn't create any new records in the database. <classname>ShardResolutionStrategy</classname>
+ is ignored because we currently assume that you always want your query executed on all shards. If this
+ isn't the case, the best thing to do is just downcast your <classname>Session</classname> to a <classname>ShardedSession</classname>
+ and dig out the shard-specific <classname>Session</classname>s you need. Clunky, but it works. We'll
+ come up with a better solution for this in later releases.
+ </para>
+ </sect1>
+</chapter>
Added: trunk/HibernateExt/shards/doc/reference/en/modules/resharding.xml
===================================================================
--- trunk/HibernateExt/shards/doc/reference/en/modules/resharding.xml (rev 0)
+++ trunk/HibernateExt/shards/doc/reference/en/modules/resharding.xml 2007-03-17 16:31:42 UTC (rev 11294)
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="shards-resharding">
+ <title>Resharding</title>
+ <para>
+ When an application's dataset grows beyond the capacity of the databases
+ originally allocated to the application it becomes necessary to add more databases, and
+ it is often desirable to redistribute the data across the shards (either to achieve
+ proper load balancing or to satisfy application invariants) - this is
+ called
+ resharding. Resharding is a complicated problem, and it has the potential to cause major
+ complications in the management of your production application if it is not considered during the design.
+ In order to ease some of the pain associated with resharding, Hibernate
+ Shards provides support for virtual shards.
+ </para>
+ <sect1 id="shards-resharding-virtual" revision="1">
+ <title>Virtual Shards</title>
+ <para>
+ In the general case, each object lives on a shard. Resharding consists
+ of two tasks: moving the object to another shard, and changing
+ object-shard mappings. The object-shard mapping is captured either by the shard ID
+ encoded into the object ID or by the internal logic of the shard
+ resolution strategy which the object uses. In the former case, resharding would require
+ changing all the object IDs and FKs. In the latter case, resharding could
+ require anything from changing the runtime configuration of a given
+ <classname>ShardResolutionStrategy</classname>
+ to changing the algorithm of the
+ <classname>ShardResolutionStrategy</classname>. Unfortunately, the problem of changing object-shard
+ mappings becomes even worse once we consider the fact that Hibernate Shards does not support cross-shard
+ relationships. This limitation prevents us from moving a subset of an object graph from one shard to
+ another.
+ </para>
+ <para>
+ The task of changing object-shard mappings can be simplified by adding a level
+ of indirection - each object lives on a virtual shard, and each virtual shard is mapped to
+ one physical shard. During design, developers must decide on the maximum number of physical shards
+ the application will ever require. This maximum is then used as the number of virtual shards, and these
+ virtual shards are then mapped to the physical shards currently required by the application.
+ Since Hibernate
+ Shards'
+ <classname>ShardSelectionStrategy</classname>,
+ <classname>ShardResolutionStrategy</classname>, and
+ <classname>ShardEncodingIdentifierGenerator</classname>
+ all operate on virtual shards, the
+ objects will correctly be distributed across virtual shards. During resharding,
+ object-shard mappings can now simply be changed by changing virtual shard to physical shard
+ mappings.
+ </para>
+ <para>
+ If you're worried about correctly estimating the maximum number of physical shards your application
+ will ever require, aim high. Virtual shards are cheap. Down the road you'll be much better off with extra
+ virtual than if you have to add virtual shards.
+ </para>
+ <para>
+ In order to enable virtual sharding you need to create your <classname>ShardedConfiguration</classname>
+ with a Map from virtual shard ids to physical shard ids. Here's an example where we have 4 virtual
+ shards mapped to 2 physical shards.
+<programlisting><![CDATA[
+Map<Integer, Integer> virtualShardMap = new HashMap<Integer, Integer>();
+virtualShardMap.put(0, 0);
+virtualShardMap.put(1, 0);
+virtualShardMap.put(2, 1);
+virtualShardMap.put(3, 1);
+ShardedConfiguration shardedConfig =
+ new ShardedConfiguration(
+ prototypeConfiguration,
+ configurations,
+ strategyFactory,
+ virtualShardMap);
+return shardedConfig.buildShardedSessionFactory();
+]]></programlisting>
+ In order to change the
+ virtual shard to physical shard mapping later on it is only necessary to change the
+ <classname>virtualShardToShardMap</classname> passed to this constructor.
+ </para>
+ <para>
+ We mentioned that the second task during resharding is moving data from one
+ physical shard to another. Hibernate Shards does not try to provide
+ automatic support for this as this is usually very application-specific, and
+ complexity varies based on the potential need for hot-resharding, deployment
+ architecture of the application, etc.
+ </para>
+ </sect1>
+</chapter>
Added: trunk/HibernateExt/shards/doc/reference/en/modules/shardstrategy.xml
===================================================================
--- trunk/HibernateExt/shards/doc/reference/en/modules/shardstrategy.xml (rev 0)
+++ trunk/HibernateExt/shards/doc/reference/en/modules/shardstrategy.xml 2007-03-17 16:31:42 UTC (rev 11294)
@@ -0,0 +1,247 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="shards-shardstrategy">
+ <title>Shard Strategy</title>
+ <sect1 id="shards-strategy-overview" revision="1">
+ <title>Overview</title>
+ <para>
+ Hibernate Shards gives you enormous flexibility in configuring how your data is distributed across your
+ shards and how your data is queried across your shards. The entry point for this configuration is the
+ <classname>org.hibernate.shards.strategy.ShardStrategy</classname> interface:
+ <programlisting><![CDATA[
+public interface ShardStrategy {
+ ShardSelectionStrategy getShardSelectionStrategy();
+ ShardResolutionStrategy getShardResolutionStrategy();
+ ShardAccessStrategy getShardAccessStrategy();
+}
+]]></programlisting>
+ As you can see, a
+ <classname>ShardStrategy</classname>
+ is comprised of three sub-strategies. We'll discuss each of these in turn.
+ </para>
+ </sect1>
+ <sect1 id="shards-strategy-shardaccess" revision="1">
+ <title>ShardAccessStrategy</title>
+ <para>
+ We'll start with the most simple of the strategies:
+ <classname>ShardAccessStrategy</classname>. Hibernate Shards uses the
+ <classname>ShardAccessStrategy</classname>
+ to determine how to apply database operations across multiple shards. The
+ <classname>ShardAccessStrategy</classname>
+ is consulted whenever you execute a query against your shards. We've already provided two implementations of
+ this interface that we expect will suffice for the majority of applications.
+ </para>
+ <sect2 id="shards-strategy-shardaccess-seq" revision="1">
+ <title>SequentialShardAccessStrategy</title>
+ <para>
+ <classname>SequentialShardAccessStrategy</classname>
+ behaves in the exact way that is implied by its name: queries are executed against your shards in
+ sequence. Depending on the types of queries you execute you may want to avoid this implementation
+ because it will execute queries against your shards in the same order every time. If you execute a lot
+ of row-limited, unordered queries this
+ <emphasis>could</emphasis>
+ result in poor utilization across your shards (shards that appear early in your list will get hammered
+ and shards that appear late will sit idly by, twiddling their shard-thumbs). If this is a concern you
+ should consider using the
+ <classname>LoadBalancedSequentialShardAccessStrategy</classname>
+ instead. This implementation receives a rotated view of your shards on each invocation, thereby
+ distributing query load evenly.
+ </para>
+ </sect2>
+ <sect2 id="shards-strategy-shardaccess-par" revision="1">
+ <title>ParallelShardAccessStrategy</title>
+ <para>
+ <classname>ParallelShardAccessStrategy</classname>
+ also behaves in the exact way that is implied by its name: queries are executed against your shards in
+ parallel. When you use this implementation you need to provide a
+ <classname>java.util.concurrent.ThreadPoolExecutor</classname>
+ that is suitable for the performance and throughput needs of your application.
+ Here's a simple example:
+ <programlisting><![CDATA[
+ ThreadFactory factory = new ThreadFactory() {
+ public Thread newThread(Runnable r) {
+ Thread t = Executors.defaultThreadFactory().newThread(r);
+ t.setDaemon(true);
+ return t;
+ }
+ };
+
+ ThreadPoolExecutor exec =
+ new ThreadPoolExecutor(
+ 10,
+ 50,
+ 60,
+ TimeUnit.SECONDS,
+ new SynchronousQueue<Runnable>(),
+ factory);
+
+ return new ParallelShardAccessStrategy(exec);
+ ]]></programlisting>
+Please note that these are just sample values - proper thread pool configuration is beyond the scope of this document.
+ </para>
+ </sect2>
+ </sect1>
+ <sect1 id="shards-strategy-shardselection" revision="1">
+ <title>ShardSelectionStrategy</title>
+ <para>
+ Hibernate Shards uses the
+ <classname>ShardSelectionStrategy</classname>
+ to determine the shard on which a new object should be created. It's entirely up to you to decide what you
+ want your implementation of this interface to look like, but we've provided a round-robin implementation to
+ get you started (<classname>RoundRobinShardSelectionStrategy</classname>). We expect many applications will
+ want to implement attribute-based sharding, so for our example
+ application that stores weather reports let's shard reports by the continents on which the reports originate:
+ <programlisting><![CDATA[
+public class WeatherReportShardSelectionStrategy implements ShardSelectionStrategy {
+ public ShardId selectShardIdForNewObject(Object obj) {
+ if(obj instanceof WeatherReport) {
+ return ((WeatherReport)obj).getContinent().getShardId();
+ }
+ throw new IllegalArgumentException();
+ }
+}
+]]></programlisting>
+
+ </para>
+ <para>
+ It's important to note that if a multi-level object graph is being saved via Hibernate's cascading
+ functionality, the
+ <classname>ShardSelectionStrategy</classname>
+ will only be consulted when saving the top-level object. All child objects will automatically be saved to
+ the same shard as the parent. You may find your
+ <classname>ShardSelectionStrategy</classname>
+ easier to implement if you prevent developers from creating new objects at more than one level in your
+ object hierarchy. You can accomplish this by making your
+ <classname>ShardSelectionStrategy</classname>
+ implementation aware of the top-level objects in your model and having it throw an exception if it
+ encounters an object that is not in this set. If you do not wish to impose this restriction that's fine,
+ just remember that if you're doing attribute-based shard selection, the attributes you use to make your
+ decision need to be available on every object that gets passed to session.save().
+ </para>
+ </sect1>
+ <sect1 id="shards-strategy-shardresolution" revision="1">
+ <title>ShardResolutionStrategy</title>
+ <para>
+ Hibernate Shards uses the
+ <classname>ShardResolutionStrategy</classname>
+ to determine the set of shards on which an object with a given id might reside. Let's go back to our weather
+ report application and suppose, for example, that each continent has a range of ids associated with it.
+ Whenever we assign an id to a WeatherReport we pick one that falls within the legal range for the continent
+ to which the WeatherReport belongs. Our
+ <classname>ShardResolutionStrategy</classname>
+ can use this information to identify which shard a WeatherReport resides on simply by looking at the id:
+ <programlisting><![CDATA[
+public class WeatherReportShardResolutionStrategy extends AllShardsShardResolutionStrategy {
+ public WeatherReportShardResolutionStrategy(List<ShardId> shardIds) {
+ super(shardIds);
+ }
+
+ public List<ShardId> selectShardIdsFromShardResolutionStrategyData(
+ ShardResolutionStrategyData srsd) {
+ if(srsd.getEntityName().equals(WeatherReport.class.getName())) {
+ return Continent.getContinentByReportId(srsd.getId()).getShardId();
+ }
+ return super.selectShardIdsFromShardResolutionStrategyData(srsd);
+ }
+}
+]]></programlisting>
+ It's worth pointing out that while we have not (yet) implemented a cache that maps entity name/id to shard,
+ the
+ <classname>ShardResolutionStrategy</classname>
+ would be an excellent place to plug in such a cache.
+ </para>
+ <para>
+ Shard Resolution is tightly tied to ID Generation. If you select an ID Generator for your class that encodes
+ the shard id in the id of the object, your
+ <classname>ShardResolutionStrategy</classname>
+ will never even be called. If you plan to only use ID Generators that encode the shard id in the ids of your
+ object you should use
+ <classname>AllShardsShardResolutionStrategy</classname>
+ as your
+ <classname>ShardResolutionStrategy</classname>.
+ </para>
+ </sect1>
+ <sect1 id="shards-strategy-idgen" revision="1">
+ <title>ID Generation</title>
+ <para>
+ Hibernate Sharding supports any ID generation strategy; the only requirement is that
+ object IDs have to be unique across all the shards. There are a few simple ID
+ generation strategies which support this requirement:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis>Native ID generation</emphasis>
+ - use Hibernate's
+ <code>native</code>
+ ID generation strategy, and configure your databases so
+ that the IDs never collide. For example, if you are using
+ <code>identity</code>
+ ID generation, you have 5 databases across which you will
+ evenly distribute the data, and you don't expect you will ever have more
+ than 1 million records, you could configure database 0 to return IDs
+ starting at 0, configure database 1 to return IDs starting at 200000,
+ configure database 2 to return IDs starting at 400000, and so on. As long as
+ your assumptions about the data are correct, the IDs of your objects would
+ never collide.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>Application-level UUID generation</emphasis>
+ - by definition you
+ don't have to worry about ID collisions, but you do need to be willing to
+ deal with potentially unwieldy primary keys for your objects.
+ </para>
+ <para>
+ Hibernate Shards provides an implementation of a simple, shard-aware UUID generator -
+ <classname>ShardedUUIDGenerator</classname>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>Distributed hilo generation</emphasis>
+ - the idea is to have a
+ hilo table on only one shard, which ensures that the identifiers generated
+ by the hi/lo algorithm are unique across all shards. Two main drawbacks of
+ this approach are that the access to the hilo table can become the
+ bottleneck in ID generation, and that storing the hilo table on a single
+ database creates a single point of failure of the system.
+ </para>
+ <para>
+ Hibernate Shards provides an implementation of a distributed hilo generation algorithm -
+ <classname>ShardedTableHiLoGenerator</classname>. This implementation is based on
+ <classname>org.hibernate.id.TableHiLoGenerator</classname>, so for
+ information on the expected structure of the database table on which the implementation
+ depends please see the documentation for this class.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ ID generation is also tightly tied with the shard resolution. The objective of shard
+ resolution is to find the shard an object lives on, given the object's ID. There are
+ two ways to accomplish this objective:
+ <itemizedlist>
+ <listitem>
+ <para>Use the
+ <classname>ShardResolutionStrategy</classname>, described above
+ </para>
+ </listitem>
+ <listitem>
+ <para>Encode the shard ID into the object ID during the ID generation,
+ and retrieve the shard ID during shard resolution
+ </para>
+ </listitem>
+ </itemizedlist>
+ The main advantage of encoding the shard ID into the object ID is that it
+ enables Hibernate Shards
+ to resolve the shard from the object's ID much faster without database
+ lookups, cache lookups, etc. Hibernate Shards does not require any specific
+ algorithm for encoding/decoding of the shard ID - all you have to do is use an ID
+ generator that implements the
+ <classname>ShardEncodingIdentifierGenerator</classname>
+ interface. Of the two ID generators included with Hibernate Shards, the
+ <classname>ShardedUUIDGenerator</classname>
+ implements this interface.
+ </para>
+ </sect1>
+</chapter>
Added: trunk/HibernateExt/shards/doc/reference/en/styles/fopdf.xsl
===================================================================
--- trunk/HibernateExt/shards/doc/reference/en/styles/fopdf.xsl (rev 0)
+++ trunk/HibernateExt/shards/doc/reference/en/styles/fopdf.xsl 2007-03-17 16:31:42 UTC (rev 11294)
@@ -0,0 +1,519 @@
+<?xml version="1.0"?>
+
+<!--
+
+ This is the XSL FO configuration file for the Hibernate
+ Reference Documentation. It defines a custom titlepage and
+ the parameters for the A4 sized PDF printable output.
+
+ It took me days to figure out this stuff and fix most of
+ the obvious bugs in the DocBook XSL distribution. Some of
+ the workarounds might not be appropriate with a newer version
+ of DocBook XSL. This file is released as part of Hibernate,
+ hence LGPL licensed.
+
+ christian at hibernate.org
+
+-->
+
+<!DOCTYPE xsl:stylesheet [
+ <!ENTITY db_xsl_path "../../../../../../Hibernate3/doc/reference/support/docbook-xsl/">
+]>
+
+<xsl:stylesheet
+ version="1.0"
+ xmlns="http://www.w3.org/TR/xhtml1/transitional"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ exclude-result-prefixes="#default">
+
+ <xsl:import href="&db_xsl_path;/fo/docbook.xsl"/>
+
+ <!--###################################################
+ Custom Title Page
+ ################################################### -->
+
+ <xsl:template name="book.titlepage.recto">
+ <fo:block>
+ <fo:table table-layout="fixed" width="175mm">
+ <fo:table-column column-width="175mm"/>
+ <fo:table-body>
+ <fo:table-row>
+ <fo:table-cell text-align="center">
+ <fo:block>
+ <fo:external-graphic src="file:images/hibernate_logo_a.png"/>
+ </fo:block>
+ <fo:block font-family="Helvetica" font-size="22pt" padding-before="10mm">
+ <xsl:value-of select="bookinfo/title"/>
+ </fo:block>
+ <fo:block font-family="Helvetica" font-size="18pt" padding-before="10mm">
+ <xsl:value-of select="bookinfo/subtitle"/>
+ </fo:block>
+ <fo:block font-family="Helvetica" font-size="12pt" padding="10mm">
+ Version:
+ <xsl:value-of select="bookinfo/releaseinfo"/>
+ </fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ </fo:table-body>
+ </fo:table>
+ </fo:block>
+ </xsl:template>
+
+ <!-- Prevent blank pages in output -->
+ <xsl:template name="book.titlepage.before.verso">
+ </xsl:template>
+ <xsl:template name="book.titlepage.verso">
+ </xsl:template>
+ <xsl:template name="book.titlepage.separator">
+ </xsl:template>
+
+ <!--###################################################
+ Header
+ ################################################### -->
+
+ <!-- More space in the center header for long text -->
+ <xsl:attribute-set name="header.content.properties">
+ <xsl:attribute name="font-family">
+ <xsl:value-of select="$body.font.family"/>
+ </xsl:attribute>
+ <xsl:attribute name="margin-left">-5em</xsl:attribute>
+ <xsl:attribute name="margin-right">-5em</xsl:attribute>
+ </xsl:attribute-set>
+
+ <!--###################################################
+ Custom Footer
+ ################################################### -->
+
+ <!-- This footer prints the Hibernate version number on the left side -->
+ <xsl:template name="footer.content">
+ <xsl:param name="pageclass" select="''"/>
+ <xsl:param name="sequence" select="''"/>
+ <xsl:param name="position" select="''"/>
+ <xsl:param name="gentext-key" select="''"/>
+
+ <xsl:variable name="Version">
+ <xsl:choose>
+ <xsl:when test="//releaseinfo">
+ <xsl:text>Hibernate </xsl:text>
+ <xsl:value-of select="//releaseinfo"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- nop -->
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="$sequence='blank'">
+ <xsl:choose>
+ <xsl:when test="$double.sided != 0 and $position = 'left'">
+ <xsl:value-of select="$Version"/>
+ </xsl:when>
+
+ <xsl:when test="$double.sided = 0 and $position = 'center'">
+ <!-- nop -->
+ </xsl:when>
+
+ <xsl:otherwise>
+ <fo:page-number/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+
+ <xsl:when test="$pageclass='titlepage'">
+ <!-- nop: other titlepage sequences have no footer -->
+ </xsl:when>
+
+ <xsl:when test="$double.sided != 0 and $sequence = 'even' and $position='left'">
+ <fo:page-number/>
+ </xsl:when>
+
+ <xsl:when test="$double.sided != 0 and $sequence = 'odd' and $position='right'">
+ <fo:page-number/>
+ </xsl:when>
+
+ <xsl:when test="$double.sided = 0 and $position='right'">
+ <fo:page-number/>
+ </xsl:when>
+
+ <xsl:when test="$double.sided != 0 and $sequence = 'odd' and $position='left'">
+ <xsl:value-of select="$Version"/>
+ </xsl:when>
+
+ <xsl:when test="$double.sided != 0 and $sequence = 'even' and $position='right'">
+ <xsl:value-of select="$Version"/>
+ </xsl:when>
+
+ <xsl:when test="$double.sided = 0 and $position='left'">
+ <xsl:value-of select="$Version"/>
+ </xsl:when>
+
+ <xsl:otherwise>
+ <!-- nop -->
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--###################################################
+ Custom Toc Line
+ ################################################### -->
+
+ <!-- Improve the TOC. -->
+ <xsl:template name="toc.line">
+ <xsl:variable name="id">
+ <xsl:call-template name="object.id"/>
+ </xsl:variable>
+
+ <xsl:variable name="label">
+ <xsl:apply-templates select="." mode="label.markup"/>
+ </xsl:variable>
+
+ <fo:block text-align-last="justify"
+ end-indent="{$toc.indent.width}pt"
+ last-line-end-indent="-{$toc.indent.width}pt">
+ <fo:inline keep-with-next.within-line="always">
+ <fo:basic-link internal-destination="{$id}">
+
+ <!-- Chapter titles should be bold. -->
+ <xsl:choose>
+ <xsl:when test="local-name(.) = 'chapter'">
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:if test="$label != ''">
+ <xsl:copy-of select="$label"/>
+ <xsl:value-of select="$autotoc.label.separator"/>
+ </xsl:if>
+ <xsl:apply-templates select="." mode="titleabbrev.markup"/>
+ </fo:basic-link>
+ </fo:inline>
+ <fo:inline keep-together.within-line="always">
+ <xsl:text> </xsl:text>
+ <fo:leader leader-pattern="dots"
+ leader-pattern-width="3pt"
+ leader-alignment="reference-area"
+ keep-with-next.within-line="always"/>
+ <xsl:text> </xsl:text>
+ <fo:basic-link internal-destination="{$id}">
+ <fo:page-number-citation ref-id="{$id}"/>
+ </fo:basic-link>
+ </fo:inline>
+ </fo:block>
+ </xsl:template>
+
+ <!--###################################################
+ Extensions
+ ################################################### -->
+
+ <!-- These extensions are required for table printing and other stuff -->
+ <xsl:param name="use.extensions">1</xsl:param>
+ <xsl:param name="tablecolumns.extension">0</xsl:param>
+ <!-- FOP provide only PDF Bookmarks at the moment -->
+ <xsl:param name="fop.extensions">1</xsl:param>
+
+ <!--###################################################
+ Table Of Contents
+ ################################################### -->
+
+ <!-- Generate the TOCs for named components only -->
+ <xsl:param name="generate.toc">
+ book toc
+ </xsl:param>
+
+ <!-- Show only Sections up to level 3 in the TOCs -->
+ <xsl:param name="toc.section.depth">3</xsl:param>
+
+ <!-- Dot and Whitespace as separator in TOC between Label and Title-->
+ <xsl:param name="autotoc.label.separator" select="'. '"/>
+
+
+ <!--###################################################
+ Paper & Page Size
+ ################################################### -->
+
+ <!-- Paper type, no headers on blank pages, no double sided printing -->
+ <xsl:param name="paper.type" select="'A4'"/>
+ <xsl:param name="double.sided">0</xsl:param>
+ <xsl:param name="headers.on.blank.pages">0</xsl:param>
+ <xsl:param name="footers.on.blank.pages">0</xsl:param>
+
+ <!-- Space between paper border and content (chaotic stuff, don't touch) -->
+ <xsl:param name="page.margin.top">5mm</xsl:param>
+ <xsl:param name="region.before.extent">10mm</xsl:param>
+ <xsl:param name="body.margin.top">10mm</xsl:param>
+
+ <xsl:param name="body.margin.bottom">15mm</xsl:param>
+ <xsl:param name="region.after.extent">10mm</xsl:param>
+ <xsl:param name="page.margin.bottom">0mm</xsl:param>
+
+ <xsl:param name="page.margin.outer">18mm</xsl:param>
+ <xsl:param name="page.margin.inner">18mm</xsl:param>
+
+ <!-- No intendation of Titles -->
+ <xsl:param name="ti