openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pinaki Poddar <ppod...@apache.org>
Subject Re: DistributionPolicy help
Date Tue, 02 Apr 2013 00:53:51 GMT
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.

Mime
View raw message