diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/meta/TestMetamodel.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/meta/TestMetamodel.java index 762750d86..a272d04d2 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/meta/TestMetamodel.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/meta/TestMetamodel.java @@ -86,7 +86,7 @@ public class TestMetamodel extends SingleEMFTestCase { Class mCls = m.getJavaType(); assertSame(ImplicitFieldAccessSubclass.class, mCls); - Class m2Cls = model.repos.getMetaModel(mCls, true); + Class m2Cls = model.getRepository().getMetaModel(mCls, true); assertNotNull(m2Cls); try { Field f2 = getStaticField(m2Cls, "base"); diff --git a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/CriteriaExpressionBuilder.java b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/CriteriaExpressionBuilder.java index 8f4ccf096..9ec9c4c0c 100644 --- a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/CriteriaExpressionBuilder.java +++ b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/CriteriaExpressionBuilder.java @@ -96,14 +96,14 @@ public class CriteriaExpressionBuilder { for (Join join : root.getJoins()) { Class cls = join.getAttribute().getJavaType(); if (join.getAttribute().isAssociation()) { - ClassMetaData meta = metamodel.repos.getMetaData(cls, null, true); + ClassMetaData meta = metamodel.getRepository().getMetaData(cls, null, true); PersistenceType type = MetamodelImpl.getPersistenceType(meta); if (type == PersistenceType.ENTITY || type == PersistenceType.EMBEDDABLE) metas.add(meta); } } for (Fetch fetch : root.getFetches()) { - metas.add(metamodel.repos.getCachedMetaData(fetch.getAttribute().getJavaType())); + metas.add(metamodel.getRepository().getCachedMetaData(fetch.getAttribute().getJavaType())); } } exps.accessPath = metas.toArray(new ClassMetaData[metas.size()]); diff --git a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/Expressions.java b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/Expressions.java index e20530ddc..39591c135 100644 --- a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/Expressions.java +++ b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/Expressions.java @@ -1043,7 +1043,7 @@ public class Expressions { ClassMetaData can = ((Types.Entity)q.getRoot().getModel()).meta; Class candidate = can.getDescribedType(); if (candidate.isAssignableFrom((Class)value)) { - lit.setMetaData(model.repos.getMetaData((Class)value, null, true)); + lit.setMetaData(model.getRepository().getMetaData((Class)value, null, true)); } else { lit.setMetaData(can); } diff --git a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/FetchPathImpl.java b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/FetchPathImpl.java index 080e91ec4..178d2c22d 100644 --- a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/FetchPathImpl.java +++ b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/FetchPathImpl.java @@ -40,8 +40,8 @@ import org.apache.openjpa.persistence.meta.Members; * @param type of this */ public class FetchPathImpl extends PathImpl implements Fetch { - Set> _fetches; - JoinType joinType; + protected Set> _fetches; + protected JoinType joinType; FetchPathImpl(FetchParent parent, Members.Member member) { diff --git a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/Joins.java b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/Joins.java index 3a563fc0b..e64766f02 100644 --- a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/Joins.java +++ b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/Joins.java @@ -270,8 +270,8 @@ public abstract class Joins { * */ public static abstract class AbstractCollection extends FromImpl implements PluralJoin { - final JoinType joinType; - boolean allowNull = false; + private final JoinType joinType; + private boolean allowNull = false; public AbstractCollection(FromImpl from, Members.PluralAttributeImpl member, JoinType jt) { @@ -553,8 +553,8 @@ public abstract class Joins { public static class MapKey extends PathImpl { - Map map; - MapAttributeImpl attr; + private final Map map; + private final MapAttributeImpl attr; public MapKey(Map joinMap){ super(((MapAttribute)joinMap.getAttribute()).getKeyJavaType()); @@ -588,7 +588,7 @@ public abstract class Joins { } public static class MapEntry extends ExpressionImpl> { - Map map; + private final Map map; public MapEntry(Map joinMap){ super(((MapAttribute)joinMap.getAttribute()).getJavaType()); diff --git a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/PathImpl.java b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/PathImpl.java index 891291ff7..b2eaeb59c 100644 --- a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/PathImpl.java +++ b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/PathImpl.java @@ -181,7 +181,7 @@ public class PathImpl extends ExpressionImpl implements Path { } } else if (_parent == null) { path = factory.newPath(); - path.setMetaData(model.repos.getCachedMetaData(getJavaType())); + path.setMetaData(model.getRepository().getCachedMetaData(getJavaType())); } if (_member != null && !_member.isCollection()) { path.setImplicitType(getJavaType()); diff --git a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/PredicateImpl.java b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/PredicateImpl.java index 1ef067e81..5b3fff2ef 100644 --- a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/PredicateImpl.java +++ b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/PredicateImpl.java @@ -47,8 +47,8 @@ public abstract class PredicateImpl extends ExpressionImpl implements P public static final Predicate FALSE = new Expressions.NotEqual(ONE,ONE); protected final List _exps = new ArrayList(); - protected final BooleanOperator _op; - protected boolean _negated = false; + private final BooleanOperator _op; + private boolean _negated = false; /** * A predicate no arguments representing AND operator. diff --git a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/meta/AbstractManagedType.java b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/meta/AbstractManagedType.java index c923833cb..8411174f4 100644 --- a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/meta/AbstractManagedType.java +++ b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/meta/AbstractManagedType.java @@ -783,30 +783,30 @@ public abstract class AbstractManagedType extends Types.BaseType return null; } - public static , E> C filter(Collection original, + static , E> C filter(Collection original, C result, Filter f1) { return filter(original, result, f1, null, null, null); } - public static , E> C filter(Collection original, + static , E> C filter(Collection original, C result, Filter f1, Filter f2) { return filter(original, result, f1, f2, null, null); } - public static , E> C filter(Collection original, + static , E> C filter(Collection original, C result, Filter f1, Filter f2, Filter f3) { return filter(original, result, f1, f2, f3, null); } - public static T pick(Collection original, Filter f1) { + static T pick(Collection original, Filter f1) { return pick(original, f1, null, null, null); } - public static T pick(Collection original, Filter f1, Filter f2) { + static T pick(Collection original, Filter f1, Filter f2) { return pick(original, f1, f2, null, null); } - public static T pick(Collection original, Filter f1, Filter f2, Filter f3) { + static T pick(Collection original, Filter f1, Filter f2, Filter f3) { return pick(original, f1, f2, f3, null); } diff --git a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/meta/MetamodelImpl.java b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/meta/MetamodelImpl.java index 97885ad43..7cc0400fd 100644 --- a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/meta/MetamodelImpl.java +++ b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/meta/MetamodelImpl.java @@ -65,7 +65,7 @@ import org.apache.openjpa.util.InternalException; * */ public class MetamodelImpl implements Metamodel, Resolver { - public final MetaDataRepository repos; + private final MetaDataRepository repos; private Map, Type> _basics = new HashMap, Type>(); private Map, EntityType> _entities = new HashMap, EntityType>(); private Map, EmbeddableType> _embeddables = new HashMap, EmbeddableType>(); @@ -100,6 +100,10 @@ public class MetamodelImpl implements Metamodel, Resolver { } } } + + public MetaDataRepository getRepository() { + return repos; + } /** * Return the metamodel embeddable type representing the embeddable class. @@ -267,7 +271,7 @@ public class MetamodelImpl implements Metamodel, Resolver { return result; } - public static CollectionType categorizeCollection(Class cls) { + static CollectionType categorizeCollection(Class cls) { if (Set.class.isAssignableFrom(cls)) return CollectionType.SET; if (List.class.isAssignableFrom(cls))