mirror of
https://github.com/apache/openjpa.git
synced 2025-02-06 01:59:17 +00:00
OPENJPA-317. Some more API Javadoc cleanup, plus a bit of last-minute renaming and method visibility changes for clarity.
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@567986 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
52d7ab7975
commit
56f6b43790
@ -91,6 +91,7 @@ import org.apache.openjpa.util.UserException;
|
||||
* @author Pinaki Poddar
|
||||
* @author Steve Kim
|
||||
* @author Abe White
|
||||
* @nojavadoc
|
||||
*/
|
||||
public class AnnotationPersistenceMappingParser
|
||||
extends AnnotationPersistenceMetaDataParser {
|
||||
|
@ -77,12 +77,12 @@ public interface JDBCFetchPlan
|
||||
/**
|
||||
* How to determine the size of a large result set.
|
||||
*/
|
||||
public LRSSize getLRSSize();
|
||||
public LRSSizeAlgorithm getLRSSizeAlgorithm();
|
||||
|
||||
/**
|
||||
* How to determine the size of a large result set.
|
||||
*/
|
||||
public JDBCFetchPlan setLRSSize(LRSSize lrsSize);
|
||||
public JDBCFetchPlan setLRSSizeAlgorithm(LRSSizeAlgorithm lrsSizeAlgorithm);
|
||||
|
||||
/**
|
||||
* SQL join syntax.
|
||||
|
@ -33,6 +33,7 @@ import org.apache.openjpa.persistence.PersistenceExceptions;
|
||||
*
|
||||
* @since 0.4.0
|
||||
* @author Abe White
|
||||
* @nojavadoc
|
||||
*/
|
||||
public class JDBCFetchPlanImpl
|
||||
extends FetchPlanImpl
|
||||
@ -91,12 +92,12 @@ public class JDBCFetchPlanImpl
|
||||
return this;
|
||||
}
|
||||
|
||||
public LRSSize getLRSSize() {
|
||||
return LRSSize.fromKernelConstant(_fetch.getLRSSize());
|
||||
public LRSSizeAlgorithm getLRSSizeAlgorithm() {
|
||||
return LRSSizeAlgorithm.fromKernelConstant(_fetch.getLRSSize());
|
||||
}
|
||||
|
||||
public JDBCFetchPlanImpl setLRSSize(LRSSize lrsSize) {
|
||||
_fetch.setLRSSize(lrsSize.toKernelConstant());
|
||||
public JDBCFetchPlanImpl setLRSSizeAlgorithm(LRSSizeAlgorithm lrsSizeAlgorithm) {
|
||||
_fetch.setLRSSize(lrsSizeAlgorithm.toKernelConstant());
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -26,14 +26,14 @@ import org.apache.openjpa.jdbc.kernel.LRSSizes;
|
||||
* @since 1.0.0
|
||||
* @published
|
||||
*/
|
||||
public enum LRSSize {
|
||||
public enum LRSSizeAlgorithm {
|
||||
UNKNOWN(LRSSizes.SIZE_UNKNOWN),
|
||||
LAST(LRSSizes.SIZE_LAST),
|
||||
QUERY(LRSSizes.SIZE_QUERY);
|
||||
|
||||
private final int lrsConstant;
|
||||
|
||||
private LRSSize(int value) {
|
||||
private LRSSizeAlgorithm(int value) {
|
||||
lrsConstant = value;
|
||||
}
|
||||
|
||||
@ -41,7 +41,7 @@ public enum LRSSize {
|
||||
return lrsConstant;
|
||||
}
|
||||
|
||||
static LRSSize fromKernelConstant(int kernelConstant) {
|
||||
static LRSSizeAlgorithm fromKernelConstant(int kernelConstant) {
|
||||
switch (kernelConstant) {
|
||||
case LRSSizes.SIZE_UNKNOWN:
|
||||
return UNKNOWN;
|
@ -27,6 +27,7 @@ package org.apache.openjpa.persistence.jdbc;
|
||||
* Set of mapping tags used in JPA.
|
||||
*
|
||||
* @author Abe White
|
||||
* @nojavadoc
|
||||
*/
|
||||
enum MappingTag {
|
||||
|
||||
|
@ -29,4 +29,4 @@ public enum NonpolymorphicType {
|
||||
EXACT,
|
||||
JOINABLE,
|
||||
FALSE
|
||||
};
|
||||
}
|
@ -44,6 +44,7 @@ import serp.util.Strings;
|
||||
*
|
||||
* @author Steve Kim
|
||||
* @author Abe White
|
||||
* @nojavadoc
|
||||
*/
|
||||
public class PersistenceMappingDefaults
|
||||
extends MappingDefaultsImpl {
|
||||
|
@ -32,6 +32,7 @@ import org.apache.openjpa.persistence.AnnotationPersistenceMetaDataSerializer;
|
||||
*
|
||||
* @author Abe White
|
||||
* @since 0.4.0
|
||||
* @nojavadoc
|
||||
*/
|
||||
public class PersistenceMappingFactory
|
||||
extends PersistenceMetaDataFactory {
|
||||
|
@ -59,31 +59,31 @@ public class TestJDBCEnumToKernelConstantMappings
|
||||
|
||||
public void testLRSSizeType() {
|
||||
assertEquals(LRSSizes.SIZE_UNKNOWN,
|
||||
LRSSize.UNKNOWN.toKernelConstant());
|
||||
assertEquals(LRSSize.UNKNOWN,
|
||||
LRSSize.fromKernelConstant(
|
||||
LRSSizeAlgorithm.UNKNOWN.toKernelConstant());
|
||||
assertEquals(LRSSizeAlgorithm.UNKNOWN,
|
||||
LRSSizeAlgorithm.fromKernelConstant(
|
||||
LRSSizes.SIZE_UNKNOWN));
|
||||
assertEquals(LRSSize.UNKNOWN.toKernelConstant(),
|
||||
LRSSize.UNKNOWN.ordinal());
|
||||
assertEquals(LRSSizeAlgorithm.UNKNOWN.toKernelConstant(),
|
||||
LRSSizeAlgorithm.UNKNOWN.ordinal());
|
||||
|
||||
assertEquals(LRSSizes.SIZE_LAST,
|
||||
LRSSize.LAST.toKernelConstant());
|
||||
assertEquals(LRSSize.LAST,
|
||||
LRSSize.fromKernelConstant(
|
||||
LRSSizeAlgorithm.LAST.toKernelConstant());
|
||||
assertEquals(LRSSizeAlgorithm.LAST,
|
||||
LRSSizeAlgorithm.fromKernelConstant(
|
||||
LRSSizes.SIZE_LAST));
|
||||
assertEquals(LRSSize.LAST.toKernelConstant(),
|
||||
LRSSize.LAST.ordinal());
|
||||
assertEquals(LRSSizeAlgorithm.LAST.toKernelConstant(),
|
||||
LRSSizeAlgorithm.LAST.ordinal());
|
||||
|
||||
assertEquals(LRSSizes.SIZE_QUERY,
|
||||
LRSSize.QUERY.toKernelConstant());
|
||||
assertEquals(LRSSize.QUERY,
|
||||
LRSSize.fromKernelConstant(
|
||||
LRSSizeAlgorithm.QUERY.toKernelConstant());
|
||||
assertEquals(LRSSizeAlgorithm.QUERY,
|
||||
LRSSizeAlgorithm.fromKernelConstant(
|
||||
LRSSizes.SIZE_QUERY));
|
||||
assertEquals(LRSSize.QUERY.toKernelConstant(),
|
||||
LRSSize.QUERY.ordinal());
|
||||
assertEquals(LRSSizeAlgorithm.QUERY.toKernelConstant(),
|
||||
LRSSizeAlgorithm.QUERY.ordinal());
|
||||
|
||||
assertEquals(getConstantCount(LRSSizes.class),
|
||||
LRSSize.values().length);
|
||||
LRSSizeAlgorithm.values().length);
|
||||
}
|
||||
|
||||
public void testJoinSyntaxType() {
|
||||
|
@ -38,6 +38,7 @@ import org.apache.openjpa.meta.XMLMetaData;
|
||||
* JAXB xml annotation metadata parser.
|
||||
*
|
||||
* @author Catalina Wei
|
||||
* @since 1.0.0
|
||||
* @nojavadoc
|
||||
*/
|
||||
public class AnnotationPersistenceXMLMetaDataParser {
|
||||
|
@ -42,7 +42,7 @@ public enum CallbackMode {
|
||||
callbackMode = value;
|
||||
}
|
||||
|
||||
public static EnumSet<CallbackMode> toEnumSet(int callback) {
|
||||
static EnumSet<CallbackMode> toEnumSet(int callback) {
|
||||
EnumSet<CallbackMode> modes = EnumSet.noneOf(CallbackMode.class);
|
||||
if ((callback & CallbackModes.CALLBACK_FAIL_FAST) != 0)
|
||||
modes.add(FAIL_FAST);
|
||||
@ -57,7 +57,7 @@ public enum CallbackMode {
|
||||
return modes;
|
||||
}
|
||||
|
||||
public static int fromEnumSet(EnumSet<CallbackMode> modes) {
|
||||
static int fromEnumSet(EnumSet<CallbackMode> modes) {
|
||||
int callback = 0;
|
||||
for (CallbackMode mode : modes)
|
||||
callback |= mode.callbackMode;
|
||||
|
@ -18,8 +18,6 @@
|
||||
*/
|
||||
package org.apache.openjpa.persistence;
|
||||
|
||||
import org.apache.openjpa.kernel.Seq;
|
||||
|
||||
/**
|
||||
* Represents a store sequence.
|
||||
*
|
||||
|
@ -27,6 +27,7 @@ package org.apache.openjpa.persistence;
|
||||
* Set of metadata tags used in JPA.
|
||||
*
|
||||
* @author Abe White
|
||||
* @nojavadoc
|
||||
*/
|
||||
public enum MetaDataTag {
|
||||
// sorted by XML order
|
||||
|
@ -763,8 +763,9 @@ public interface OpenJPAEntityManager
|
||||
* JavaBeans convention, this method will create a concrete implementation
|
||||
* according to the metadata that defines the class. If <code>cls</code>
|
||||
* is a non-final concrete type that has metadata but does not implement
|
||||
* {@link PersistenceCapable}, this method will create a subclass of the
|
||||
* type that does implement {@link PersistenceCapable}, and will attempt
|
||||
* {@link org.apache.openjpa.enhance.PersistenceCapable}, this method will
|
||||
* create a subclass of the type that does implement
|
||||
* {@link org.apache.openjpa.enhance.PersistenceCapable}, and will attempt
|
||||
* to redefine the methods in <code>cls</code> to enable persistent
|
||||
* attribute tracking. Otherwise, this will return an instance of the
|
||||
* specified class.
|
||||
|
@ -36,7 +36,12 @@ import org.apache.openjpa.kernel.QueryHints;
|
||||
* @published
|
||||
*/
|
||||
public interface OpenJPAQuery
|
||||
extends Query, QueryHints {
|
||||
extends Query {
|
||||
|
||||
/**
|
||||
* Hint key for specifying the number of rows to optimize for.
|
||||
*/
|
||||
public static final String HINT_RESULT_COUNT = QueryHints.HINT_RESULT_COUNT;
|
||||
|
||||
/**
|
||||
* The owning entity manager.
|
||||
|
@ -65,6 +65,7 @@ import org.apache.openjpa.conf.OpenJPAConfiguration;
|
||||
*
|
||||
* @author Patrick Linskey
|
||||
* @author Abe White
|
||||
* @nojavadoc
|
||||
*/
|
||||
public class PersistenceMetaDataDefaults
|
||||
extends AbstractMetaDataDefaults {
|
||||
|
@ -65,6 +65,7 @@ import org.apache.openjpa.util.MetaDataException;
|
||||
*
|
||||
* @author Steve Kim
|
||||
* @since 0.4.0
|
||||
* @nojavadoc
|
||||
*/
|
||||
public class PersistenceMetaDataFactory
|
||||
extends AbstractCFMetaDataFactory
|
||||
|
@ -23,7 +23,6 @@ import java.lang.instrument.IllegalClassFormatException;
|
||||
import java.security.ProtectionDomain;
|
||||
import java.util.Map;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.EntityManagerFactory;
|
||||
import javax.persistence.spi.ClassTransformer;
|
||||
import javax.persistence.spi.PersistenceProvider;
|
||||
import javax.persistence.spi.PersistenceUnitInfo;
|
||||
@ -68,7 +67,7 @@ public class PersistenceProviderImpl
|
||||
* resource or the name of the jar that the resource is contained in.
|
||||
* This does no pooling of EntityManagersFactories.
|
||||
*/
|
||||
public EntityManagerFactory createEntityManagerFactory(String name,
|
||||
public OpenJPAEntityManagerFactory createEntityManagerFactory(String name,
|
||||
String resource, Map m) {
|
||||
PersistenceProductDerivation pd = new PersistenceProductDerivation();
|
||||
try {
|
||||
@ -83,11 +82,12 @@ public class PersistenceProviderImpl
|
||||
}
|
||||
}
|
||||
|
||||
public EntityManagerFactory createEntityManagerFactory(String name, Map m) {
|
||||
public OpenJPAEntityManagerFactory createEntityManagerFactory(String name,
|
||||
Map m) {
|
||||
return createEntityManagerFactory(name, null, m);
|
||||
}
|
||||
|
||||
public EntityManagerFactory createContainerEntityManagerFactory(
|
||||
public OpenJPAEntityManagerFactory createContainerEntityManagerFactory(
|
||||
PersistenceUnitInfo pui, Map m) {
|
||||
PersistenceProductDerivation pd = new PersistenceProductDerivation();
|
||||
try {
|
||||
|
@ -27,6 +27,7 @@ package org.apache.openjpa.persistence;
|
||||
* Set of field persistence strategies used in JPA.
|
||||
*
|
||||
* @author Abe White
|
||||
* @nojavadoc
|
||||
*/
|
||||
public enum PersistenceStrategy {
|
||||
// order matters to match XML spec
|
||||
|
@ -42,7 +42,6 @@ import org.apache.openjpa.lib.meta.SourceTracker;
|
||||
import org.apache.openjpa.lib.util.J2DoPrivHelper;
|
||||
import org.apache.openjpa.lib.util.Localizer;
|
||||
import org.apache.openjpa.lib.util.MultiClassLoader;
|
||||
import org.apache.openjpa.lib.util.TemporaryClassLoader;
|
||||
import org.apache.openjpa.util.ClassResolver;
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user