selectShardIdsFromShardResolutionStrategyData not finding identifiergenerator for subclasses

Description

ShardedSessionImpl calls shardedSessionFactory.getIdentifierGenerator with the entity-name from the ShardResolutionData.

However getIdentifierGenerator is defined in the interface as:
public IdentifierGenerator getIdentifierGenerator(String rootEntityName);

ShardedSessionImpl should therefor first determine the rootEntityName for the entity at hand and use that entityname to determine the identifiergenerator:

[code]]
IdentifierGenerator idGenerator = shardedSessionFactory.getIdentifierGenerator(srsd.getEntityName());
/code

Should be changed to something like

[code]
EntityPersister entityPersister = shardedSessionFactory.getEntityPersister(srsd.getEntityName());
IdentifierGenerator idGenerator = shardedSessionFactory.getIdentifierGenerator(entityPersister.getRootEntityName());
/code

This error can be shown when using a superclass with a ShardEncodingIdentifierGenerator. For the subclasses the ShardResolutionStrategy will be consulted to determine the shardId of the object rather than having the ShardEncodingIdentifierGenerator extracting it from the id.

Environment

Hibernate 3.2.6-GA, Oracle 10.2.0.3

Status

Assignee

Max Ross

Reporter

HA

Labels

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Suitable for new contributors

None

Pull Request

None

backportDecision

None

backportReEvaluate

None

Affects versions

Priority

Major
Configure