You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Pinaki Poddar <pp...@apache.org> on 2013/04/02 02:53:51 UTC

Re: DistributionPolicy help

Hi,
  Examples of Slice Distribution Policy can be found in OpenJPA test corpus.
You can either OpenJPA source code and navigate to
openjpa-slice/src/test/java/org/apache/openjpa/slice/policy package, or you
can browse the source code in fisheye [1].

 The context variable passed to DistributionPolicy is declared as an opaque
java.lang.Object type. But in the runtime actually it is an instance of the
EntityManagerFactory on which the perisist() call has been invoked.

 The interface method distribute() should return the name of one of the
slices as declared in your persistence.xml. The object will be persisted in
that slice. 





[1]
https://fisheye6.atlassian.com/browse/openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/policy/EvenOddDistributionPolicy.java?r=772721



-----
Pinaki Poddar
Chair, Apache OpenJPA Project
--
View this message in context: http://openjpa.208410.n2.nabble.com/DistributionPolicy-help-tp7583302p7583311.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.