Yes we should fix the example. Note that the JavaDoc covers this case.
id and idInString can be null. If null, all the directory providers
containing entity types should be returned
I'm not against a new method necessarily but I don't see the huge value (ie easier
contract vs breaking existing ones).
On 1 août 2011, at 20:55, Sanne Grinovero wrote:
Hi,
I just noticed that a PurgeAll request will ask the sharding strategy
to know to which shard it should be applied, using the following
method:
getDirectoryProvidersForDeletion(Class<?> entity, Serializable id,
String idInString) {
and passing in null for the second and third arguments.
That's not broken per se as the sharding implementor can easily deal
with this, but in our IdHashShardingStrategy we don't consider this,
so we could at least improve the example.
I'm wondering why we don't use
#getDirectoryProvidersForAllShards()
likely to give more flexibility to implementors; in that case I guess
that because PurgeAll was introduced after sharding, it was not an
option to create a method
getDirectoryProvidersForPurgeAll(Class<?> entity)
shall we add this one?
Alternatively I think we should either fix the example or use the
"all" strategy.
Cheers,
Sanne
_______________________________________________
hibernate-dev mailing list
hibernate-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev