You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by mi...@apache.org on 2009/04/03 05:10:00 UTC
svn commit: r761509 [4/4] - in /openjpa/trunk: ./
openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/
openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/
openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/
openjpa-jdbc/src/main/...
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/QueryDefinition.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/QueryDefinition.java?rev=761509&r1=761508&r2=761509&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/QueryDefinition.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/QueryDefinition.java Fri Apr 3 03:09:53 2009
@@ -126,7 +126,8 @@
* results. Replaces the previous order-by list, if any.
*
* @param orderByItemList -
- * a list containing one or more OrderByItem instances
+ * a list containing one or more OrderByItem
+ * instances
* @return the modified QueryDefinition instance
*/
QueryDefinition orderBy(List<OrderByItem> orderByItemList);
@@ -167,8 +168,8 @@
* @param cls -
* a class with the correponding constructor
* @param args -
- * select items that correspond to result types that are valid as
- * arguments to the constructor
+ * select items that correspond to result types that are valid
+ * as arguments to the constructor
* @result SelectItem instance representing the constructor
*/
SelectItem newInstance(Class cls, SelectItem... args);
@@ -252,7 +253,8 @@
* .elseCase(scalar-expression)
*
* @param caseOperand -
- * value used for testing against the when scalar expressions
+ * value used for testing against the when scalar
+ * expressions
* @return case expression with the given case operand
*/
CaseExpression simpleCase(String caseOperand);
@@ -266,7 +268,8 @@
* .elseCase(scalar-expression)
*
* @param caseOperand -
- * value used for testing against the when scalar expressions
+ * value used for testing against the when scalar
+ * expressions
* @return case expression with the given case operand
*/
CaseExpression simpleCase(Date caseOperand);
@@ -280,7 +283,8 @@
* .elseCase(scalar-expression)
*
* @param caseOperand -
- * value used for testing against the when scalar expressions
+ * value used for testing against the when scalar
+ * expressions
* @return case expression with the given case operand
*/
CaseExpression simpleCase(Calendar caseOperand);
@@ -294,7 +298,8 @@
* .elseCase(scalar-expression)
*
* @param caseOperand -
- * value used for testing against the when scalar expressions
+ * value used for testing against the when scalar
+ * expressions
* @return case expression with the given case operand
*/
CaseExpression simpleCase(Class caseOperand);
@@ -308,7 +313,8 @@
* .elseCase(scalar-expression)
*
* @param caseOperand -
- * value used for testing against the when scalar expressions
+ * value used for testing against the when scalar
+ * expressions
* @return case expression with the given case operand
*/
CaseExpression simpleCase(Enum<?> caseOperand);
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/QueryDefinitionImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/QueryDefinitionImpl.java?rev=761509&r1=761508&r2=761509&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/QueryDefinitionImpl.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/QueryDefinitionImpl.java Fri Apr 3 03:09:53 2009
@@ -81,12 +81,12 @@
AbstractPath next = paths.get(i);
DomainObject newRoot = new NavigationPath(this,
- next.getParent(), next.getLastSegment().toString());
+ next.getParent(), next.getLastSegment().toString());
addDomain((AbstractDomainObject)newRoot);
i++;
for (; i < paths.size(); i++) {
next = paths.get(i);
- newRoot = newRoot.join(next.getLastSegment().toString());
+ newRoot = newRoot.join(next.getLastSegment().toString());
}
return newRoot;
}
@@ -250,7 +250,7 @@
if (i instanceof OrderableItem)
_orderBys.add((OrderableItem)i);
else
- _orderBys.add(new OrderableItem((ExpressionImpl)i));
+ _orderBys.add(new OrderableItem((ExpressionImpl)i));
}
return this;
}
@@ -264,7 +264,7 @@
if (i instanceof OrderableItem)
_orderBys.add((OrderableItem)i);
else
- _orderBys.add(new OrderableItem((ExpressionImpl)i, null));
+ _orderBys.add(new OrderableItem((ExpressionImpl)i, null));
}
return this;
}
@@ -278,7 +278,7 @@
}
public QueryDefinition select(SelectItem... items) {
- return select(items == null ? null : Arrays.asList(items), false);
+ return select(items == null ? null : Arrays.asList(items), false);
}
public QueryDefinition select(List<SelectItem> items) {
@@ -286,14 +286,14 @@
}
public QueryDefinition selectDistinct(SelectItem... items) {
- return select(items == null ? null : Arrays.asList(items), true);
+ return select(items == null ? null : Arrays.asList(items), true);
}
public QueryDefinition selectDistinct(List<SelectItem> items) {
return select(items, true);
}
- private QueryDefinition select(List<SelectItem> items, boolean isDistinct) {
+ private QueryDefinition select(List<SelectItem> items, boolean isDistinct) {
if (_projections == null) {
_projections = new ArrayList<SelectItem>();
} else {
@@ -344,7 +344,7 @@
private List<SelectItem> getProjections() {
if (_projections == null) {
- List<SelectItem> defaultProjection = new ArrayList<SelectItem>();
+ List<SelectItem> defaultProjection = new ArrayList<SelectItem>();
defaultProjection.add(_domains.get(0));
return defaultProjection;
}
@@ -357,12 +357,12 @@
StringBuffer buffer = new StringBuffer();
registerDomains(ctx);
String select = _distinct ? "SELECT DISTINCT " : "SELECT ";
- fillBuffer(select, buffer, ctx, getProjections(), Visit.PROJECTION);
+ fillBuffer(select, buffer, ctx, getProjections(), Visit.PROJECTION);
fillBuffer(" FROM ", buffer, ctx, _domains, Visit.JOINABLE);
fillBuffer(" WHERE ", buffer, ctx, _where);
- fillBuffer(" GROUP BY ", buffer, ctx, _groupBys, Visit.EXPRESSION);
+ fillBuffer(" GROUP BY ", buffer, ctx, _groupBys, Visit.EXPRESSION);
fillBuffer(" HAVING ", buffer, ctx, _having);
- fillBuffer(" ORDER BY ", buffer, ctx, _orderBys, Visit.EXPRESSION);
+ fillBuffer(" ORDER BY ", buffer, ctx, _orderBys, Visit.EXPRESSION);
return buffer.toString();
}
@@ -371,7 +371,7 @@
return asExpression(ctx);
}
- public void fillBuffer(String header, StringBuffer buffer, AliasContext ctx,
+ public void fillBuffer(String header, StringBuffer buffer, AliasContext ctx,
List list, Visit visit) {
if (list == null || list.isEmpty())
return;
@@ -380,19 +380,19 @@
Visitable v = (Visitable)list.get(i);
switch(visit) {
case PROJECTION : buffer.append(v.asProjection(ctx))
- .append(i != list.size()-1 ? ", " : " ");
+ .append(i != list.size()-1 ? ", " : " ");
break;
case EXPRESSION : buffer.append(v.asExpression(ctx))
- .append(i != list.size()-1 ? ", " : " ");
+ .append(i != list.size()-1 ? ", " : " ");
break;
- case JOINABLE : buffer.append(i > 0 && v instanceof RootPath ?
- ", " : " ").append(v.asJoinable(ctx));
+ case JOINABLE : buffer.append(i > 0 && v instanceof RootPath ?
+ ", " : " ").append(v.asJoinable(ctx));
break;
}
}
}
- public void fillBuffer(String header, StringBuffer buffer, AliasContext ctx,
+ public void fillBuffer(String header, StringBuffer buffer, AliasContext ctx,
Predicate p) {
if (p == null)
return;
@@ -402,7 +402,7 @@
}
/**
- * Registers each domain with an alias. Also set alias for order by items
+ * Registers each domain with an alias. Also set alias for order by items
* that are projected.
*/
private void registerDomains(AliasContext ctx) {
@@ -415,7 +415,7 @@
if (_orderBys != null) {
for (OrderableItem o : _orderBys) {
ExpressionImpl e = o.getExpression();
- if (_projections != null && _projections.contains(e))
+ if (_projections != null && _projections.contains(e))
ctx.setAlias(e);
}
}
@@ -423,11 +423,11 @@
static class DomainSorter implements Comparator<AbstractDomainObject> {
static List<Class> _order = Arrays.asList(new Class[] {
- RootPath.class, NavigationPath.class, OperatorPath.class,
+ RootPath.class, NavigationPath.class, OperatorPath.class,
JoinPath.class, FetchPath.class, } );
- public int compare(AbstractDomainObject a, AbstractDomainObject b) {
- return _order.indexOf(a.getClass()) - _order.indexOf(b.getClass());
+ public int compare(AbstractDomainObject a, AbstractDomainObject b) {
+ return _order.indexOf(a.getClass()) - _order.indexOf(b.getClass());
}
}
}
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/QueryExpression.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/QueryExpression.java?rev=761509&r1=761508&r2=761509&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/QueryExpression.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/QueryExpression.java Fri Apr 3 03:09:53 2009
@@ -27,7 +27,7 @@
*/
abstract class QueryExpression extends UnaryOperatorExpression
implements Subquery {
- public QueryExpression(QueryDefinitionImpl q, UnaryFunctionalOperator op) {
+ public QueryExpression(QueryDefinitionImpl q, UnaryFunctionalOperator op) {
super(q, op);
}
}
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/RootPath.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/RootPath.java?rev=761509&r1=761508&r2=761509&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/RootPath.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/RootPath.java Fri Apr 3 03:09:53 2009
@@ -29,7 +29,7 @@
@Override
public String asJoinable(AliasContext ctx) {
- return ctx.getEntityName(getLastSegment()) + " " + ctx.getAlias(this);
+ return ctx.getEntityName(getLastSegment()) + " " + ctx.getAlias(this);
}
@Override
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/SubStringExpression.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/SubStringExpression.java?rev=761509&r1=761508&r2=761509&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/SubStringExpression.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/SubStringExpression.java Fri Apr 3 03:09:53 2009
@@ -45,7 +45,7 @@
_length = new ConstantExpression(len);
}
- public SubStringExpression(Expression op, Expression start, Expression l) {
+ public SubStringExpression(Expression op, Expression start, Expression l) {
super(op, UnaryFunctionalOperator.SUBSTR);
_start = start;
_length = new ConstantExpression(l);
@@ -54,7 +54,7 @@
public String asExpression(AliasContext ctx) {
return _op + "(" + ((Visitable)_e).asExpression(ctx)
+ "," + ((Visitable)_start).asExpression(ctx)
- + (_length == null ? "" : "," + ((Visitable)_length).asExpression(ctx))
- + ")";
+ + (_length == null ? "" : ","
+ + ((Visitable)_length).asExpression(ctx)) + ")";
}
}
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/UnaryExpressionPredicate.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/UnaryExpressionPredicate.java?rev=761509&r1=761508&r2=761509&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/UnaryExpressionPredicate.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/UnaryExpressionPredicate.java Fri Apr 3 03:09:53 2009
@@ -30,7 +30,7 @@
protected final UnaryConditionalOperator _op;
private final UnaryConditionalOperator _nop;
- public UnaryExpressionPredicate(Expression e, UnaryConditionalOperator op,
+ public UnaryExpressionPredicate(Expression e, UnaryConditionalOperator op,
UnaryConditionalOperator nop) {
this._e = e;
this._op = op;
@@ -55,7 +55,7 @@
public Predicate not() {
if (_nop == null)
- throw new UnsupportedOperationException(this.toString());
+ throw new UnsupportedOperationException(this.toString());
return new UnaryExpressionPredicate(_e, _nop, _op);
}
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/UnaryOperatorExpression.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/UnaryOperatorExpression.java?rev=761509&r1=761508&r2=761509&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/UnaryOperatorExpression.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/UnaryOperatorExpression.java Fri Apr 3 03:09:53 2009
@@ -22,7 +22,7 @@
protected final Expression _e;
protected final UnaryFunctionalOperator _op;
- public UnaryOperatorExpression(Expression e, UnaryFunctionalOperator op) {
+ public UnaryOperatorExpression(Expression e, UnaryFunctionalOperator op) {
_e = e;
_op = op;
}
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/WhenClause.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/WhenClause.java?rev=761509&r1=761508&r2=761509&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/WhenClause.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/WhenClause.java Fri Apr 3 03:09:53 2009
@@ -38,7 +38,7 @@
void setThen(Object then) {
if (hasThen())
- throw new IllegalStateException("then() is already set");
+ throw new IllegalStateException("then() is already set");
this.then = then;
}
Modified: openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/DistributedBrokerImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/DistributedBrokerImpl.java?rev=761509&r1=761508&r2=761509&view=diff
==============================================================================
--- openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/DistributedBrokerImpl.java (original)
+++ openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/DistributedBrokerImpl.java Fri Apr 3 03:09:53 2009
@@ -60,7 +60,8 @@
}
public DistributedStoreManager getDistributedStoreManager() {
- return (DistributedStoreManager)getStoreManager().getInnermostDelegate();
+ return (DistributedStoreManager)getStoreManager().
+ getInnermostDelegate();
}
public Slice addSlice(String name, Map properties) {
@@ -71,22 +72,24 @@
}
/**
- * Assigns slice identifier to the resultant StateManager as initialized by
+ * Assigns slice identifier to the resultant StateManager as initialized by
* the super class implementation. The slice identifier is decided by
* {@link DistributionPolicy} for given <code>pc</code> if it is a root
- * instance i.e. the argument of the user application's persist() call. The
+ * instance i.e. the argument of the user application's persist() call. The
* cascaded instances are detected by non-empty status of the current
* operating set. The slice is assigned only if a StateManager has never
* been assigned before.
*/
@Override
- public OpenJPAStateManager persist(Object pc, Object id, boolean explicit,
+ public OpenJPAStateManager persist(Object pc, Object id, boolean explicit,
OpCallbacks call) {
OpenJPAStateManager sm = getStateManager(pc);
SliceInfo info = null;
- boolean replicated = SliceImplHelper.isReplicated(pc, getConfiguration());
- if (getOperatingSet().isEmpty() && !SliceImplHelper.isSliceAssigned(sm)) {
- info = SliceImplHelper.getSlicesByPolicy(pc, getConfiguration(),
+ boolean replicated = SliceImplHelper.isReplicated(pc,
+ getConfiguration());
+ if (getOperatingSet().isEmpty() && !SliceImplHelper.isSliceAssigned(sm))
+ {
+ info = SliceImplHelper.getSlicesByPolicy(pc, getConfiguration(),
this);
_rootSlice = info.getSlices()[0];
}
@@ -94,7 +97,7 @@
if (!SliceImplHelper.isSliceAssigned(sm)) {
if (info == null) {
info = replicated
- ? SliceImplHelper.getSlicesByPolicy(pc, getConfiguration(), this)
+ ? SliceImplHelper.getSlicesByPolicy(pc, getConfiguration(), this)
: new SliceInfo(_rootSlice);
}
info.setInto(sm);
Modified: openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/DistributedConfiguration.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/DistributedConfiguration.java?rev=761509&r1=761508&r2=761509&view=diff
==============================================================================
--- openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/DistributedConfiguration.java (original)
+++ openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/DistributedConfiguration.java Fri Apr 3 03:09:53 2009
@@ -46,7 +46,7 @@
* specified explicitly in <code>openjpa.slice.Names</code> property or
* ordered alphabetically when found by scanning the properties.
* <br>
- * This list always returns the identifiers that are <em>active</em>, slices
+ * This list always returns the identifiers that are <em>active</em>, slices
* that can not be connected to are not included in this list.
*/
List<String> getActiveSliceNames();
Modified: openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/DistributedQueryImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/DistributedQueryImpl.java?rev=761509&r1=761508&r2=761509&view=diff
==============================================================================
--- openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/DistributedQueryImpl.java (original)
+++ openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/DistributedQueryImpl.java Fri Apr 3 03:09:53 2009
@@ -30,7 +30,8 @@
*/
public class DistributedQueryImpl extends QueryImpl {
private final ReentrantSliceLock _lock;
- public DistributedQueryImpl(Broker broker, String language, StoreQuery storeQuery) {
+ public DistributedQueryImpl(Broker broker, String language,
+ StoreQuery storeQuery) {
super(broker, language, storeQuery);
_lock = new ReentrantSliceLock();
}
Modified: openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/DistributionPolicy.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/DistributionPolicy.java?rev=761509&r1=761508&r2=761509&view=diff
==============================================================================
--- openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/DistributionPolicy.java (original)
+++ openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/DistributionPolicy.java Fri Apr 3 03:09:53 2009
@@ -43,7 +43,8 @@
* the list is either explicit <code>openjpa.slice.Names</code> property
* or implicit i.e. alphabetic order of available identifiers if
* <code>openjpa.slice.Names</code> is unspecified.
- * @param context the generic persistence context managing the given instance.
+ * @param context the generic persistence context managing the given
+ * instance.
*
* @return identifier of the slice. This name must match one of the
* given slice names.
@@ -58,7 +59,7 @@
*/
public static class Default implements DistributionPolicy {
private static Random RNG = new Random();
- public String distribute(Object pc, List<String> slices, Object ctx) {
+ public String distribute(Object pc, List<String> slices, Object ctx) {
return slices.get(RNG.nextInt(slices.size()));
}
}
Modified: openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/ProductDerivation.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/ProductDerivation.java?rev=761509&r1=761508&r2=761509&view=diff
==============================================================================
--- openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/ProductDerivation.java (original)
+++ openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/ProductDerivation.java Fri Apr 3 03:09:53 2009
@@ -97,7 +97,7 @@
void forceSet(Value v, String forced, Log log) {
v.setString(forced);
if (log.isWarnEnabled())
- log.warn(_loc.get("forced-set-config", v.getProperty(), forced));
+ log.warn(_loc.get("forced-set-config", v.getProperty(), forced));
}
public Set<String> getSupportedQueryHints() {
Modified: openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/ReplicationPolicy.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/ReplicationPolicy.java?rev=761509&r1=761508&r2=761509&view=diff
==============================================================================
--- openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/ReplicationPolicy.java (original)
+++ openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/ReplicationPolicy.java Fri Apr 3 03:09:53 2009
@@ -34,14 +34,14 @@
*/
public interface ReplicationPolicy {
/**
- * Gets the name of the slices where a given instance will be replicated.
+ * Gets the name of the slices where a given instance will be replicated.
*
* @param pc The newly persistent or to-be-merged object.
* @param slices list of names of the active slices. The ordering of
* the list is either explicit <code>openjpa.slice.Names</code> property
* or implicit i.e. alphabetic order of available identifiers if
* <code>openjpa.slice.Names</code> is unspecified.
- * @param context generic persistence context managing the given instance.
+ * @param context generic persistence context managing the given instance.
*
* @return identifier of the slices. This names must match one of the
* given slice names.
Modified: openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/SliceImplHelper.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/SliceImplHelper.java?rev=761509&r1=761508&r2=761509&view=diff
==============================================================================
--- openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/SliceImplHelper.java (original)
+++ openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/SliceImplHelper.java Fri Apr 3 03:09:53 2009
@@ -40,7 +40,7 @@
/**
* Gets the target slices by calling user-specified
* {@link DistributionPolicy} or {@link ReplicationPolicy}
- * depending on whether the given instance is {@link Replicated replicated}.
+ * depending on whether the given instance is {@link Replicated replicated}.
*/
public static SliceInfo getSlicesByPolicy(Object pc,
DistributedConfiguration conf, Object ctx) {
@@ -50,10 +50,10 @@
boolean replicated = isReplicated(pc, conf);
if (replicated) {
policy = conf.getReplicationPolicyInstance();
- targets = ((ReplicationPolicy)policy).replicate(pc, actives, ctx);
+ targets = ((ReplicationPolicy)policy).replicate(pc, actives, ctx);
} else {
policy = conf.getDistributionPolicyInstance();
- targets = new String[]{((DistributionPolicy)policy).distribute
+ targets = new String[]{((DistributionPolicy)policy).distribute
(pc, actives, ctx)};
}
assertSlices(targets, pc, conf.getActiveSliceNames(), policy);
@@ -84,7 +84,7 @@
/**
* Affirms if the given instance be replicated to multiple slices.
*/
- public static boolean isReplicated(Object pc, OpenJPAConfiguration conf) {
+ public static boolean isReplicated(Object pc, OpenJPAConfiguration conf) {
if (pc == null)
return false;
ClassMetaData meta = conf.getMetaDataRepositoryInstance()
Modified: openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/SliceInfo.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/SliceInfo.java?rev=761509&r1=761508&r2=761509&view=diff
==============================================================================
--- openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/SliceInfo.java (original)
+++ openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/SliceInfo.java Fri Apr 3 03:09:53 2009
@@ -65,14 +65,14 @@
}
/**
- * Constructor for non-replicated instance that is stored in a single slice.
+ * Constructor for non-replicated instance that is stored in a single slice.
*/
public SliceInfo(String slice) {
this(false, new String[]{slice});
}
/**
- * Constructor for replicated instance that is stored in one or more slices.
+ * Constructor for replicated instance that is stored in one or more slices.
*/
public SliceInfo(String[] slices) {
this(true, slices);
@@ -98,8 +98,8 @@
}
/**
- * Sets this receiver as the given StateManager's internal instance-level
- * data. If the given StateManager had existing instance-level data that is
+ * Sets this receiver as the given StateManager's internal instance-level
+ * data. If the given StateManager had existing instance-level data that is
* not a SliceInfo then raise an exception.
*/
public SliceInfo setInto(OpenJPAStateManager sm) {
@@ -110,7 +110,7 @@
Object previous = sm.setImplData(this, true);
if (previous == null || previous instanceof SliceInfo)
return (SliceInfo)previous;
- throw new InternalException(_loc.get("unknown-impl-data", previous,
+ throw new InternalException(_loc.get("unknown-impl-data", previous,
previous.getClass().getName(), sm.getPersistenceCapable())
.getMessage());
}
Modified: openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/SlicePersistence.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/SlicePersistence.java?rev=761509&r1=761508&r2=761509&view=diff
==============================================================================
--- openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/SlicePersistence.java (original)
+++ openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/SlicePersistence.java Fri Apr 3 03:09:53 2009
@@ -41,7 +41,7 @@
/**
* Get the slice identifier for the given instance if it is a managed
* instance and has been assigned to a slice.
- * If the given instance is replicated across multiple slices then returns
+ * If the given instance is replicated across multiple slices then returns
* comma-separated list of slice names.
*
* @return name of the slice, if any. null otherwise.
@@ -49,10 +49,10 @@
public static String getSlice(Object obj) {
if (obj == null)
return null;
- PersistenceCapable pc = ImplHelper.toPersistenceCapable(obj, null);
+ PersistenceCapable pc = ImplHelper.toPersistenceCapable(obj, null);
if (pc == null)
return null;
- OpenJPAStateManager sm = (OpenJPAStateManager)pc.pcGetStateManager();
+ OpenJPAStateManager sm = (OpenJPAStateManager)pc.pcGetStateManager();
SliceInfo info = SliceImplHelper.getSliceInfo(sm);
if (info == null)
return null;
@@ -61,7 +61,7 @@
}
/**
- * Affirms if the given instance is replicated, provided the given instance
+ * Affirms if the given instance is replicated, provided the given instance
* is managed.
*/
public static boolean isReplicated(Object obj) {
Modified: openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedConnection.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedConnection.java?rev=761509&r1=761508&r2=761509&view=diff
==============================================================================
--- openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedConnection.java (original)
+++ openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedConnection.java Fri Apr 3 03:09:53 2009
@@ -90,15 +90,15 @@
}
public Statement createStatement() throws SQLException {
- DistributedStatement ret = DistributedStatement.newInstance(this);
+ DistributedStatement ret = DistributedStatement.newInstance(this);
for (Connection c : real) {
ret.add(c.createStatement());
}
return ret;
}
- public Statement createStatement(int arg0, int arg1) throws SQLException {
- DistributedStatement ret = DistributedStatement.newInstance(this);
+ public Statement createStatement(int arg0, int arg1) throws SQLException {
+ DistributedStatement ret = DistributedStatement.newInstance(this);
for (Connection c : real) {
ret.add(c.createStatement(arg0, arg1));
}
@@ -107,7 +107,7 @@
public Statement createStatement(int arg0, int arg1, int arg2)
throws SQLException {
- DistributedStatement ret = DistributedStatement.newInstance(this);
+ DistributedStatement ret = DistributedStatement.newInstance(this);
for (Connection c : real) {
ret.add(c.createStatement(arg0, arg1, arg2));
}
@@ -176,11 +176,13 @@
throw new UnsupportedOperationException();
}
- public PreparedStatement prepareStatement(String arg0) throws SQLException {
+ public PreparedStatement prepareStatement(String arg0) throws SQLException {
// TODO: Big hack
- if (arg0.startsWith("SELECT SEQUENCE_VALUE FROM OPENJPA_SEQUENCE_TABLE"))
+ if (arg0.startsWith(
+ "SELECT SEQUENCE_VALUE FROM OPENJPA_SEQUENCE_TABLE"))
return master.prepareStatement(arg0);
- DistributedPreparedStatement ret = DistributedPreparedStatement.newInstance(this);
+ DistributedPreparedStatement ret = DistributedPreparedStatement.
+ newInstance(this);
for (Connection c : real) {
ret.add(c.prepareStatement(arg0));
}
@@ -189,7 +191,8 @@
public PreparedStatement prepareStatement(String arg0, int arg1)
throws SQLException {
- DistributedPreparedStatement ret = DistributedPreparedStatement.newInstance(this);
+ DistributedPreparedStatement ret = DistributedPreparedStatement.
+ newInstance(this);
for (Connection c : real) {
ret.add(c.prepareStatement(arg0, arg1));
}
@@ -198,7 +201,8 @@
public PreparedStatement prepareStatement(String arg0, int[] arg1)
throws SQLException {
- DistributedPreparedStatement ret = DistributedPreparedStatement.newInstance(this);
+ DistributedPreparedStatement ret = DistributedPreparedStatement.
+ newInstance(this);
for (Connection c : real) {
ret.add(c.prepareStatement(arg0, arg1));
}
@@ -207,25 +211,28 @@
public PreparedStatement prepareStatement(String arg0, String[] arg1)
throws SQLException {
- DistributedPreparedStatement ret = DistributedPreparedStatement.newInstance(this);
+ DistributedPreparedStatement ret = DistributedPreparedStatement.
+ newInstance(this);
for (Connection c : real) {
ret.add(c.prepareStatement(arg0, arg1));
}
return ret;
}
- public PreparedStatement prepareStatement(String arg0, int arg1, int arg2)
+ public PreparedStatement prepareStatement(String arg0, int arg1, int arg2)
throws SQLException {
- DistributedPreparedStatement ret = DistributedPreparedStatement.newInstance(this);
+ DistributedPreparedStatement ret = DistributedPreparedStatement.
+ newInstance(this);
for (Connection c : real) {
ret.add(c.prepareStatement(arg0, arg1, arg2));
}
return ret;
}
- public PreparedStatement prepareStatement(String arg0, int arg1, int arg2,
+ public PreparedStatement prepareStatement(String arg0, int arg1, int arg2,
int arg3) throws SQLException {
- DistributedPreparedStatement ret = DistributedPreparedStatement.newInstance(this);
+ DistributedPreparedStatement ret = DistributedPreparedStatement.
+ newInstance(this);
for (Connection c : real) {
ret.add(c.prepareStatement(arg0, arg1, arg2));
}
Modified: openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedDataSource.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedDataSource.java?rev=761509&r1=761508&r2=761509&view=diff
==============================================================================
--- openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedDataSource.java (original)
+++ openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedDataSource.java Fri Apr 3 03:09:53 2009
@@ -56,7 +56,7 @@
return getConnection(((DecoratingDataSource)ds)
.getInnermostDelegate());
if (ds instanceof XADataSource)
- return ((XADataSource)ds).getXAConnection().getConnection();
+ return ((XADataSource)ds).getXAConnection().getConnection();
return ds.getConnection();
}
Modified: openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedJDBCBrokerFactory.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedJDBCBrokerFactory.java?rev=761509&r1=761508&r2=761509&view=diff
==============================================================================
--- openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedJDBCBrokerFactory.java (original)
+++ openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedJDBCBrokerFactory.java Fri Apr 3 03:09:53 2009
@@ -44,7 +44,7 @@
private static final Localizer _loc =
Localizer.forPackage(DistributedJDBCBrokerFactory.class);
/**
- * Factory method for constructing a factory from properties. Invoked from
+ * Factory method for constructing a factory from properties. Invoked from
* {@link Bootstrap#newBrokerFactory}.
*/
public static DistributedJDBCBrokerFactory newInstance(
@@ -56,14 +56,14 @@
}
/**
- * Factory method for obtaining a possibly-pooled factory from properties.
+ * Factory method for obtaining a possibly-pooled factory from properties.
* Invoked from {@link Bootstrap#getBrokerFactory}.
*/
public static JDBCBrokerFactory getInstance(ConfigurationProvider cp) {
Map properties = cp.getProperties();
Object key = toPoolKey(properties);
DistributedJDBCBrokerFactory factory =
- (DistributedJDBCBrokerFactory) getPooledFactoryForKey(key);
+ (DistributedJDBCBrokerFactory) getPooledFactoryForKey(key);
if (factory != null)
return factory;
@@ -80,7 +80,7 @@
Map properties = conf.toProperties(false);
Object key = toPoolKey(properties);
DistributedJDBCBrokerFactory factory =
- (DistributedJDBCBrokerFactory) getPooledFactoryForKey(key);
+ (DistributedJDBCBrokerFactory) getPooledFactoryForKey(key);
if (factory != null)
return factory;
@@ -103,7 +103,8 @@
Slice slice = getConfiguration().addSlice(name, properties);
ClassLoader loader = AccessController.doPrivileged(
J2DoPrivHelper.getContextClassLoaderAction());
- synchronizeMappings(loader, (JDBCConfiguration)slice.getConfiguration());
+ synchronizeMappings(loader, (JDBCConfiguration)slice.
+ getConfiguration());
return slice;
}
Modified: openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedJDBCConfigurationImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedJDBCConfigurationImpl.java?rev=761509&r1=761508&r2=761509&view=diff
==============================================================================
--- openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedJDBCConfigurationImpl.java (original)
+++ openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedJDBCConfigurationImpl.java Fri Apr 3 03:09:53 2009
@@ -288,7 +288,8 @@
if (log.isInfoEnabled())
log.info(_loc.get("slice-connect", slice, url));
DataSource ds = DataSourceFactory.newDataSource(conf, false);
- DecoratingDataSource dds = DecoratingDataSource.newDecoratingDataSource(ds);
+ DecoratingDataSource dds = DecoratingDataSource.
+ newDecoratingDataSource(ds);
ds = DataSourceFactory.installDBDictionary(
conf.getDBDictionaryInstance(), dds, conf, false);
verifyDataSource(slice, ds, conf);
@@ -363,7 +364,8 @@
throw new UserException(_loc.get("slice-connect-known-error",
slice, url, ex), ex.getCause());
} else {
- throw new UserException(_loc.get("slice-connect-error", slice, url));
+ throw new UserException(_loc.get("slice-connect-error", slice,
+ url));
}
}
Modified: openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedJDBCStoreManager.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedJDBCStoreManager.java?rev=761509&r1=761508&r2=761509&view=diff
==============================================================================
--- openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedJDBCStoreManager.java (original)
+++ openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedJDBCStoreManager.java Fri Apr 3 03:09:53 2009
@@ -108,7 +108,8 @@
_slices = new ArrayList<SliceStoreManager>();
List<String> sliceNames = conf.getActiveSliceNames();
for (String name : sliceNames) {
- SliceStoreManager slice = new SliceStoreManager(conf.getSlice(name));
+ SliceStoreManager slice =
+ new SliceStoreManager(conf.getSlice(name));
_slices.add(slice);
if (slice.getName().equals(_conf.getMaster().getName()))
_master = slice;
@@ -125,7 +126,8 @@
public SliceStoreManager addSlice(Slice slice) {
SliceStoreManager result = new SliceStoreManager(slice);
- result.setContext(getContext(), (JDBCConfiguration)slice.getConfiguration());
+ result.setContext(getContext(),
+ (JDBCConfiguration)slice.getConfiguration());
_slices.add(result);
return result;
}
@@ -194,7 +196,8 @@
for (String target : targets) {
SliceStoreManager slice = lookup(target);
if (slice == null)
- throw new InternalException(_loc.get("wrong-slice", target, sm));
+ throw new InternalException(_loc.get("wrong-slice", target,
+ sm));
return slice;
}
return null;
@@ -341,7 +344,7 @@
}
/**
- * Separate the given list of StateManagers in separate lists for each slice
+ * Separate the given list of StateManagers in separate lists for each slice
* by the associated slice identifier of each StateManager.
*/
private Map<String, StateManagerSet> bin(Collection sms, Object edata) {
Modified: openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedPreparedStatement.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedPreparedStatement.java?rev=761509&r1=761508&r2=761509&view=diff
==============================================================================
--- openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedPreparedStatement.java (original)
+++ openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedPreparedStatement.java Fri Apr 3 03:09:53 2009
@@ -39,7 +39,8 @@
import org.apache.openjpa.lib.util.ConcreteClassGenerator;
/**
- * A virtual PreparedStaement that delegates to a set of actual PreparedStatements.
+ * A virtual PreparedStaement that delegates to a set of actual
+ * PreparedStatements.
*
* @author Pinaki Poddar
*
@@ -113,7 +114,7 @@
t.setAsciiStream(arg0, arg1, arg2);
}
- public void setBigDecimal(int arg0, BigDecimal arg1) throws SQLException {
+ public void setBigDecimal(int arg0, BigDecimal arg1) throws SQLException {
for (PreparedStatement t : this)
t.setBigDecimal(arg0, arg1);
}
@@ -160,7 +161,8 @@
t.setDate(arg0, arg1);
}
- public void setDate(int arg0, Date arg1, Calendar arg2) throws SQLException {
+ public void setDate(int arg0, Date arg1, Calendar arg2) throws SQLException
+ {
for (PreparedStatement t : this)
t.setDate(arg0, arg1, arg2);
}
@@ -190,7 +192,7 @@
t.setNull(arg0, arg1);
}
- public void setNull(int arg0, int arg1, String arg2) throws SQLException {
+ public void setNull(int arg0, int arg1, String arg2) throws SQLException {
for (PreparedStatement t : this)
t.setNull(arg0, arg1, arg2);
}
@@ -200,7 +202,7 @@
t.setObject(arg0, arg1);
}
- public void setObject(int arg0, Object arg1, int arg2) throws SQLException {
+ public void setObject(int arg0, Object arg1, int arg2) throws SQLException {
for (PreparedStatement t : this)
t.setObject(arg0, arg1, arg2);
}
@@ -237,7 +239,7 @@
t.setTime(arg0, arg1, arg2);
}
- public void setTimestamp(int arg0, Timestamp arg1) throws SQLException {
+ public void setTimestamp(int arg0, Timestamp arg1) throws SQLException {
for (PreparedStatement t : this)
t.setTimestamp(arg0, arg1);
}
Modified: openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedResultSet.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedResultSet.java?rev=761509&r1=761508&r2=761509&view=diff
==============================================================================
--- openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedResultSet.java (original)
+++ openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedResultSet.java Fri Apr 3 03:09:53 2009
@@ -149,11 +149,11 @@
return current.getBigDecimal(arg0);
}
- public BigDecimal getBigDecimal(int arg0, int arg1) throws SQLException {
+ public BigDecimal getBigDecimal(int arg0, int arg1) throws SQLException {
return current.getBigDecimal(arg0, arg1);
}
- public BigDecimal getBigDecimal(String arg0, int arg1) throws SQLException {
+ public BigDecimal getBigDecimal(String arg0, int arg1) throws SQLException {
return current.getBigDecimal(arg0, arg1);
}
@@ -355,7 +355,7 @@
return current.getTimestamp(arg0);
}
- public Timestamp getTimestamp(int arg0, Calendar arg1) throws SQLException {
+ public Timestamp getTimestamp(int arg0, Calendar arg1) throws SQLException {
return current.getTimestamp(arg0, arg1);
}
@@ -405,7 +405,7 @@
}
public boolean isLast() throws SQLException {
- return current != null && current.isLast() && cursor == comps.size()-1;
+ return current != null && current.isLast() && cursor == comps.size()-1;
}
public boolean last() throws SQLException {
@@ -515,7 +515,8 @@
throw new UnsupportedOperationException();
}
- public void updateBigDecimal(int arg0, BigDecimal arg1) throws SQLException {
+ public void updateBigDecimal(int arg0, BigDecimal arg1) throws SQLException
+ {
throw new UnsupportedOperationException();
}
@@ -546,7 +547,7 @@
throw new UnsupportedOperationException();
}
- public void updateBoolean(String arg0, boolean arg1) throws SQLException {
+ public void updateBoolean(String arg0, boolean arg1) throws SQLException {
throw new UnsupportedOperationException();
}
@@ -686,7 +687,7 @@
throw new UnsupportedOperationException();
}
- public void updateTimestamp(int arg0, Timestamp arg1) throws SQLException {
+ public void updateTimestamp(int arg0, Timestamp arg1) throws SQLException {
throw new UnsupportedOperationException();
}
Modified: openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedStoreQuery.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedStoreQuery.java?rev=761509&r1=761508&r2=761509&view=diff
==============================================================================
--- openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedStoreQuery.java (original)
+++ openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedStoreQuery.java Fri Apr 3 03:09:53 2009
@@ -75,7 +75,7 @@
public Executor newDataStoreExecutor(ClassMetaData meta, boolean subs) {
boolean parallel = !getContext().getStoreContext().getBroker()
.getMultithreaded();
- ParallelExecutor ex = new ParallelExecutor(this, meta, subs, _parser,
+ ParallelExecutor ex = new ParallelExecutor(this, meta, subs, _parser,
ctx.getCompilation(), parallel);
for (StoreQuery q : _queries) {
ex.addExecutor(q.newDataStoreExecutor(meta, subs));
@@ -100,8 +100,8 @@
private List<Executor> executors = new ArrayList<Executor>();
private DistributedStoreQuery owner = null;
- public ParallelExecutor(DistributedStoreQuery dsq, ClassMetaData meta,
- boolean subclasses, ExpressionParser parser, Object parsed,
+ public ParallelExecutor(DistributedStoreQuery dsq, ClassMetaData meta,
+ boolean subclasses, ExpressionParser parser, Object parsed,
boolean parallel) {
super(dsq, meta, subclasses, parser, parsed);
owner = dsq;
@@ -112,26 +112,27 @@
}
/**
- * Each child query must be executed with slice context and not the
+ * Each child query must be executed with slice context and not the
* given query context.
*/
public ResultObjectProvider executeQuery(StoreQuery q,
final Object[] params, final Range range) {
List<Future<ResultObjectProvider>> futures =
new ArrayList<Future<ResultObjectProvider>>();
- final List<Executor> usedExecutors = new ArrayList<Executor>();
+ final List<Executor> usedExecutors = new ArrayList<Executor>();
final List<ResultObjectProvider> rops =
new ArrayList<ResultObjectProvider>();
List<SliceStoreManager> targets = findTargets();
QueryContext ctx = q.getContext();
boolean isReplicated = containsReplicated(ctx);
- ExecutorService threadPool = SliceThread.newPool(owner._queries.size());
+ ExecutorService threadPool = SliceThread.newPool(
+ owner._queries.size());
for (int i = 0; i < owner._queries.size(); i++) {
- // if replicated, then execute only on single slice
+ // if replicated, then execute only on single slice
if (isReplicated && !usedExecutors.isEmpty()) {
break;
}
- StoreManager sm = owner.getDistributedStore().getSlice(i);
+ StoreManager sm = owner.getDistributedStore().getSlice(i);
if (!targets.contains(sm))
continue;
StoreQuery query = owner._queries.get(i);
@@ -139,12 +140,12 @@
if (!targets.contains(sm))
continue;
usedExecutors.add(executor);
- QueryExecutor call = new QueryExecutor();
- call.executor = executor;
- call.query = query;
- call.params = params;
- call.range = range;
- futures.add(threadPool.submit(call));
+ QueryExecutor call = new QueryExecutor();
+ call.executor = executor;
+ call.query = query;
+ call.params = params;
+ call.range = range;
+ futures.add(threadPool.submit(call));
}
for (Future<ResultObjectProvider> future : futures) {
try {
@@ -157,7 +158,7 @@
}
ResultObjectProvider[] tmp = rops
- .toArray(new ResultObjectProvider[rops.size()]);
+ .toArray(new ResultObjectProvider[rops.size()]);
ResultObjectProvider result = null;
boolean[] ascending = getAscending(q);
boolean isAscending = ascending.length > 0;
@@ -167,27 +168,27 @@
result = new UniqueResultObjectProvider(tmp, q,
getQueryExpressions());
} else if (isAscending) {
- result = new OrderingMergedResultObjectProvider(tmp, ascending,
- usedExecutors.toArray(new Executor[usedExecutors.size()]),
+ result = new OrderingMergedResultObjectProvider(tmp, ascending,
+ usedExecutors.toArray(new Executor[usedExecutors.size()]),
q, params);
} else {
result = new MergedResultObjectProvider(tmp);
}
if (hasRange) {
- result = new RangeResultObjectProvider(result, ctx
- .getStartRange(), ctx.getEndRange());
+ result = new RangeResultObjectProvider(result,
+ ctx.getStartRange(), ctx.getEndRange());
}
return result;
}
/**
- * Scans metadata to find out if a replicated class is the candidate.
+ * Scans metadata to find out if a replicated class is the candidate.
*/
boolean containsReplicated(QueryContext query) {
Class candidate = query.getCandidateType();
if (candidate != null) {
- ClassMetaData meta = query.getStoreContext().getConfiguration()
- .getMetaDataRepositoryInstance().getMetaData(candidate,
+ ClassMetaData meta = query.getStoreContext().getConfiguration()
+ .getMetaDataRepositoryInstance().getMetaData(candidate,
null, true);
if (meta != null && meta.isReplicated())
return true;
@@ -205,10 +206,10 @@
Iterator<StoreQuery> qs = owner._queries.iterator();
List<Future<Number>> futures = null;
int result = 0;
- ExecutorService threadPool = SliceThread.newPool(executors.size());
+ ExecutorService threadPool = SliceThread.newPool(executors.size());
for (Executor ex : executors) {
if (futures == null)
- futures = new ArrayList<Future<Number>>();
+ futures = new ArrayList<Future<Number>>();
DeleteExecutor call = new DeleteExecutor();
call.executor = ex;
call.query = qs.next();
@@ -236,7 +237,7 @@
ExecutorService threadPool = SliceThread.newPool(executors.size());
for (Executor ex : executors) {
if (futures == null)
- futures = new ArrayList<Future<Number>>();
+ futures = new ArrayList<Future<Number>>();
UpdateExecutor call = new UpdateExecutor();
call.executor = ex;
call.query = qs.next();
@@ -246,7 +247,7 @@
for (Future<Number> future : futures) {
try {
Number n = future.get();
- result += (n == null) ? 0 : n.intValue();
+ result += (n == null) ? 0 : n.intValue();
} catch (InterruptedException e) {
throw new RuntimeException(e);
} catch (ExecutionException e) {
Modified: openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedTemplate.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedTemplate.java?rev=761509&r1=761508&r2=761509&view=diff
==============================================================================
--- openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedTemplate.java (original)
+++ openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedTemplate.java Fri Apr 3 03:09:53 2009
@@ -65,7 +65,8 @@
master = s;
try {
if (!con.contains(s.getConnection()))
- throw new IllegalArgumentException(s + " has different connection");
+ throw new IllegalArgumentException(s +
+ " has different connection");
stmts.add(s);
} catch (SQLException e) {
e.printStackTrace();
@@ -130,7 +131,7 @@
for (Statement s:this) {
int[] tmp = s.executeBatch();
ret = new int[ret.length + tmp.length];
- System.arraycopy(tmp, 0, ret, ret.length-tmp.length, tmp.length);
+ System.arraycopy(tmp, 0, ret, ret.length-tmp.length, tmp.length);
}
return ret;
}
@@ -170,7 +171,7 @@
return ret;
}
- public int executeUpdate(String arg0, String[] arg1) throws SQLException {
+ public int executeUpdate(String arg0, String[] arg1) throws SQLException {
int ret = 0;
for (T s:this)
ret += s.executeUpdate(arg0, arg1);
Modified: openjpa/trunk/openjpa-xmlstore/src/main/java/org/apache/openjpa/xmlstore/ObjectData.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-xmlstore/src/main/java/org/apache/openjpa/xmlstore/ObjectData.java?rev=761509&r1=761508&r2=761509&view=diff
==============================================================================
--- openjpa/trunk/openjpa-xmlstore/src/main/java/org/apache/openjpa/xmlstore/ObjectData.java (original)
+++ openjpa/trunk/openjpa-xmlstore/src/main/java/org/apache/openjpa/xmlstore/ObjectData.java Fri Apr 3 03:09:53 2009
@@ -149,13 +149,13 @@
// the stored value must be a collection
c = (Collection) val;
- // the state manager will create a proxy collection of the needed
- // type depending on the declared type of the user's field; the
- // proxy will perform dirty tracking, etc
+ // the state manager will create a proxy collection of the
+ // needed type depending on the declared type of the user's
+ // field; the proxy will perform dirty tracking, etc
Collection c2 = (Collection) sm.newFieldProxy(fmd.getIndex());
- // populate the proxy collection with our stored data, converting
- // it to the right type from its stored form
+ // populate the proxy collection with our stored data,
+ // converting it to the right type from its stored form
for (Iterator itr = c.iterator(); itr.hasNext();)
c2.add(toNestedLoadable(sm, fmd.getElement(), itr.next(),
fetch));
@@ -221,8 +221,9 @@
case JavaTypes.PC:
case JavaTypes.PC_UNTYPED:
- // for relations to other persistent objects, we store the related
- // object's oid -- convert it back into a persistent instance
+ // for relations to other persistent objects, we store the
+ // related object's oid -- convert it back into a persistent
+ // instance
StoreContext ctx = sm.getContext();
Object pc = ctx.find(val, fetch, null, null, 0);
if (pc != null)
@@ -269,16 +270,16 @@
case JavaTypes.COLLECTION:
c = (Collection) val;
- // create a collection to copy the elements into for storage, and
- // populate it with converted element values
+ // create a collection to copy the elements into for storage,
+ // and populate it with converted element values
Collection c2 = new ArrayList();
for (Iterator itr = c.iterator(); itr.hasNext();)
c2.add(toNestedStorable(fmd.getElement(), itr.next(), ctx));
return c2;
case JavaTypes.ARRAY:
- // create a collection to copy the elements into for storage, and
- // populate it with converted element values
+ // create a collection to copy the elements into for storage,
+ // and populate it with converted element values
c = new ArrayList();
for (int i = 0, len = Array.getLength(val); i < len; i++)
c.add(toNestedStorable(fmd.getElement(), Array.get(val, i),
Modified: openjpa/trunk/openjpa-xmlstore/src/main/java/org/apache/openjpa/xmlstore/XMLFileHandler.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-xmlstore/src/main/java/org/apache/openjpa/xmlstore/XMLFileHandler.java?rev=761509&r1=761508&r2=761509&view=diff
==============================================================================
--- openjpa/trunk/openjpa-xmlstore/src/main/java/org/apache/openjpa/xmlstore/XMLFileHandler.java (original)
+++ openjpa/trunk/openjpa-xmlstore/src/main/java/org/apache/openjpa/xmlstore/XMLFileHandler.java Fri Apr 3 03:09:53 2009
@@ -430,7 +430,8 @@
// field value already constructed
break;
default:
- // construct the field value from text within the element
+ // construct the field value from text within the
+ // element
_fieldVal = fromXMLString(_fmd.getTypeCode(),
_fmd.getTypeMetaData(), _buf.toString());
}
Modified: openjpa/trunk/pom.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/pom.xml?rev=761509&r1=761508&r2=761509&view=diff
==============================================================================
--- openjpa/trunk/pom.xml (original)
+++ openjpa/trunk/pom.xml Fri Apr 3 03:09:53 2009
@@ -665,6 +665,22 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>process-sources</phase>
+ <goals>
+ <goal>checkstyle</goal>
+ </goals>
+ <configuration>
+ <configLocation>checkstyle.xml</configLocation>
+ <failsOnError>true</failsOnError>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
<reporting>
@@ -694,6 +710,13 @@
<groupId>org.codehaus.mojo</groupId>
<artifactId>taglist-maven-plugin</artifactId>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <configuration>
+ <configLocation>checkstyle.xml</configLocation>
+ </configuration>
+ </plugin>
</plugins>
</reporting>