OPENJPA-1015 fix line wrapping in source files. Based on patch contributed by B.J. Reed. Updates made to do enforce line wrapping during the process-sources phase of the build.

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@761509 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Dick 2009-04-03 03:09:53 +00:00
parent 318d408ab7
commit b6e661e24a
175 changed files with 899 additions and 698 deletions

View File

@ -317,7 +317,8 @@ public class JDBCConfigurationImpl
preparedQueryCachePlugin.setDefault(aliases[0]);
preparedQueryCachePlugin.setClassName(aliases[1]);
preparedQueryCachePlugin.setDynamic(true);
preparedQueryCachePlugin.setInstantiatingGetter("getQuerySQLCacheInstance");
preparedQueryCachePlugin.setInstantiatingGetter(
"getQuerySQLCacheInstance");
finderCachePlugin = addPlugin("jdbc.FinderCache", true);
aliases = new String[] {

View File

@ -151,7 +151,7 @@ public abstract class AbstractJDBCSeq
* <code>TYPE_CONTIGUOUS</code> the connection from the {@link StoreManager}
* will be returned.
*
* <P>Otherwise a new connection will be obtained using DataSource2 from the
* <P>Otherwise a new connection will be obtained using DataSource2 from the
* current configuration. In this case autocommit is set to false prior to
* returning the connection.</P>
*/

View File

@ -92,9 +92,11 @@ public abstract class AbstractUpdateManager
StateManagerImpl sm = (StateManagerImpl) obj;
if (sm.getMappedByIdFields() != null)
mappedByIdStates.add(sm);
else exceps = populateRowManager(sm, rowMgr, store, exceps, customs);
else exceps = populateRowManager(sm, rowMgr, store, exceps,
customs);
} else
exceps = populateRowManager(obj, rowMgr, store, exceps, customs);
exceps = populateRowManager(obj, rowMgr, store, exceps,
customs);
}
// flush rows
@ -364,8 +366,9 @@ public abstract class AbstractUpdateManager
/**
* Update version and discriminator indicators.
*/
protected void updateIndicators(OpenJPAStateManager sm, ClassMapping mapping,
RowManager rowMgr, JDBCStore store, Collection customs,
protected void updateIndicators(OpenJPAStateManager sm,
ClassMapping mapping, RowManager rowMgr, JDBCStore store,
Collection customs,
boolean versionUpdateOnly) throws SQLException {
while (mapping.getJoinablePCSuperclassMapping() != null)
mapping = mapping.getJoinablePCSuperclassMapping();
@ -410,7 +413,8 @@ public abstract class AbstractUpdateManager
private final OpenJPAStateManager _sm;
private final Strategy _strat;
public CustomMapping(int action, OpenJPAStateManager sm, Strategy strat) {
public CustomMapping(int action, OpenJPAStateManager sm, Strategy strat)
{
_action = action;
_sm = sm;
_strat = strat;

View File

@ -36,7 +36,7 @@ import org.apache.openjpa.util.OpenJPAException;
* the following property:
* <PRE>
* < property name="openjpa.jdbc.UpdateManager"
* value="org.apache.openjpa.jdbc.kernel.YourOperationOrderUpdateManager" />
* value="org.apache.openjpa.jdbc.kernel.YourOperationOrderUpdateManager" />
* </PRE></P>
* @author Teresa Kan
*/

View File

@ -256,7 +256,7 @@ public class BatchingPreparedStatementManagerImpl extends
row.getSQL(_dict)).getMessage());
break;
case Statement.SUCCESS_NO_INFO: // -2
if (_dict.reportsSuccessNoInfoOnBatchUpdates &&
if (_dict.reportsSuccessNoInfoOnBatchUpdates &&
updateSuccessCnt != count.length) {
// Oracle batching specifics:
// treat update/delete of SUCCESS_NO_INFO as failed case

View File

@ -511,8 +511,9 @@ public class ConstraintUpdateManager
if (!breakableLink.isRemovedFromGraph()) {
// use a primary row update to prevent setting pk and fk values
// until after flush, to get latest auto-increment values
// use a primary row update to prevent setting pk and fk
// values until after flush, to get latest auto-increment
// values
PrimaryRow row = (PrimaryRow) breakableLink.getFrom();
if (row.getAction() == Row.ACTION_DELETE) {
addDeleteUpdate(breakableLink, deleteUpdates);

View File

@ -104,7 +104,7 @@ public class FinderCacheImpl
* {@link QueryHints#HINT_IGNORE_FINDER HINT_IGNORE_FINDER} will ignore
* any cached finder that may exist in this cache and will return null.
* {@link QueryHints#HINT_INVALIDATE_FINDER HINT_INVALIDATE_FINDER} will
* invalidate any cached finder that may exist in this cache and will return
* invalidate any cached finder that may exist in this cache and will return
* null.
*
*/

View File

@ -108,7 +108,8 @@ public class JDBCStoreManager
private static final Class<ClientConnection> clientConnectionImpl;
private static final Class<RefCountConnection> refCountConnectionImpl;
private static final Class<CancelStatement> cancelStatementImpl;
private static final Class<CancelPreparedStatement> cancelPreparedStatementImpl;
private static final Class<CancelPreparedStatement>
cancelPreparedStatementImpl;
static {
try {
@ -1415,7 +1416,8 @@ public class JDBCStoreManager
* Connection returned to client code. Makes sure its wrapped connection
* ref count is decremented on finalize.
*/
protected abstract static class ClientConnection extends DelegatingConnection {
protected abstract static class ClientConnection extends
DelegatingConnection {
private boolean _closed = false;
@ -1563,7 +1565,8 @@ public class JDBCStoreManager
* Statement type that adds and removes itself from the set of active
* statements so that it can be canceled.
*/
protected abstract class CancelPreparedStatement extends DelegatingPreparedStatement {
protected abstract class CancelPreparedStatement extends
DelegatingPreparedStatement {
public CancelPreparedStatement(PreparedStatement stmnt,
Connection conn) {

View File

@ -514,7 +514,7 @@ public class JDBCStoreQuery
try {
stmnt = prepareStatement(conn, sql[i]);
dict.setTimeouts(stmnt, fetch, true);
count += executeUpdate(conn, stmnt, sql[i], isUpdate);
count += executeUpdate(conn, stmnt, sql[i], isUpdate);
} catch (SQLException se) {
throw SQLExceptions.getStore(se, sql[i].getSQL(),
_store.getDBDictionary());

View File

@ -60,7 +60,7 @@ public class PreparedQueryCacheImpl implements PreparedQueryCache {
private final QueryStatistics<String> _stats;
private ReentrantLock _lock = new ReentrantLock();
private Log _log;
private Localizer _loc = Localizer.forPackage(PreparedQueryCacheImpl.class);
private Localizer _loc = Localizer.forPackage(PreparedQueryCacheImpl.class);
public PreparedQueryCacheImpl() {
_delegate = new HashMap<String, PreparedQuery>();
@ -68,7 +68,7 @@ public class PreparedQueryCacheImpl implements PreparedQueryCache {
_stats = new QueryStatistics.Default<String>();
}
public Boolean register(String id, Query query, FetchConfiguration hints) {
public Boolean register(String id, Query query, FetchConfiguration hints) {
if (id == null
|| query == null
|| QueryLanguages.LANG_SQL.equals(query.getLanguage())
@ -89,9 +89,9 @@ public class PreparedQueryCacheImpl implements PreparedQueryCache {
public Map<String,String> getMapView() {
lock();
try {
Map<String, String> view = new TreeMap<String, String>();
for (Map.Entry<String, PreparedQuery> entry : _delegate.entrySet())
view.put(entry.getKey(), entry.getValue().getTargetQuery());
Map<String, String> view = new TreeMap<String, String>();
for (Map.Entry<String, PreparedQuery> entry : _delegate.entrySet())
view.put(entry.getKey(), entry.getValue().getTargetQuery());
return view;
} finally {
unlock();
@ -110,7 +110,7 @@ public class PreparedQueryCacheImpl implements PreparedQueryCache {
String id = q.getIdentifier();
if (isCachable(id) == Boolean.FALSE) {
if (_log != null && _log.isWarnEnabled())
_log.warn(_loc.get("prepared-query-not-cachable", id));
_log.warn(_loc.get("prepared-query-not-cachable", id));
return false;
}
String pattern = getMatchedExclusionPattern(id);
@ -145,7 +145,7 @@ public class PreparedQueryCacheImpl implements PreparedQueryCache {
lock();
try {
if (_log.isTraceEnabled())
_log.trace(_loc.get("prepared-query-invalidate", id));
_log.trace(_loc.get("prepared-query-invalidate", id));
return _delegate.remove(id) != null;
} finally {
unlock();
@ -181,14 +181,14 @@ public class PreparedQueryCacheImpl implements PreparedQueryCache {
private PreparedQuery markUncachable(String id, String reason) {
lock();
try {
boolean excludedByUser = _uncachables.get(id) == EXLUDED_BY_USER;
boolean excludedByUser = _uncachables.get(id) == EXLUDED_BY_USER;
if (!excludedByUser)
_uncachables.put(id, reason);
if (_log != null && _log.isInfoEnabled()) {
if (excludedByUser)
_log.info(_loc.get("prepared-query-uncache-strong", id));
else
_log.info(_loc.get("prepared-query-uncache-weak", id,
_log.info(_loc.get("prepared-query-uncache-strong", id));
else
_log.info(_loc.get("prepared-query-uncache-weak", id,
reason));
}
return _delegate.remove(id);
@ -222,8 +222,8 @@ public class PreparedQueryCacheImpl implements PreparedQueryCache {
}
/**
* Adds a pattern for exclusion. Any query cached currently whose identifier
* matches the given pattern will be marked invalidated as a side-effect.
* Adds a pattern for exclusion. Any query cached currently whose identifier
* matches the given pattern will be marked invalidated as a side-effect.
*/
public void addExclusionPattern(String pattern) {
lock();
@ -231,10 +231,10 @@ public class PreparedQueryCacheImpl implements PreparedQueryCache {
if (_exclusionPatterns == null)
_exclusionPatterns = new ArrayList<String>();
_exclusionPatterns.add(pattern);
Collection<String> invalidKeys = getMatchedKeys(pattern,
_delegate.keySet());
if (!invalidKeys.isEmpty() && _log != null && _log.isInfoEnabled())
_log.info(_loc.get("prepared-query-add-pattern", pattern,
Collection<String> invalidKeys = getMatchedKeys(pattern,
_delegate.keySet());
if (!invalidKeys.isEmpty() && _log != null && _log.isInfoEnabled())
_log.info(_loc.get("prepared-query-add-pattern", pattern,
invalidKeys.size(), invalidKeys));
for (String invalidKey : invalidKeys)
markUncachable(invalidKey, pattern);
@ -245,7 +245,7 @@ public class PreparedQueryCacheImpl implements PreparedQueryCache {
/**
* Removes a pattern for exclusion. Any query identifier marked as not
* cachable due to the given pattern will now be removed from the list of
* cachable due to the given pattern will now be removed from the list of
* uncachables as a side-effect.
*/
public void removeExclusionPattern(String pattern) {
@ -254,9 +254,9 @@ public class PreparedQueryCacheImpl implements PreparedQueryCache {
if (_exclusionPatterns == null)
return;
_exclusionPatterns.remove(pattern);
Collection<String> reborns = getMatchedKeys(pattern, _uncachables);
if (!reborns.isEmpty() && _log != null && _log.isInfoEnabled())
_log.info(_loc.get("prepared-query-remove-pattern", pattern,
Collection<String> reborns = getMatchedKeys(pattern, _uncachables);
if (!reborns.isEmpty() && _log != null && _log.isInfoEnabled())
_log.info(_loc.get("prepared-query-remove-pattern", pattern,
reborns.size(), reborns));
for (String rebornKey : reborns)
_uncachables.remove(rebornKey);

View File

@ -130,10 +130,11 @@ public class PreparedSQLStoreQuery extends SQLStoreQuery {
/**
* Convert given userParams to an array whose ordering matches as
* per expected during executeXXX() methods.
* The given userParams is already re-parameterized, so this method have
* The given userParams is already re-parameterized, so this method have
* to merely copy the given Map values.
*
* @see PreparedQueryImpl#reparametrize(Map, org.apache.openjpa.kernel.Broker)
* @see PreparedQueryImpl#reparametrize(Map,
* org.apache.openjpa.kernel.Broker)
*/
public Object[] toParameterArray(StoreQuery q, Map userParams) {
Object[] array = new Object[userParams.size()];

View File

@ -125,7 +125,8 @@ public class PreparedStatementManagerImpl
sql).getMessage());
}
if (autoAssignColNames != null)
populateAutoAssignCols(stmnt, autoAssign, autoAssignColNames, row);
populateAutoAssignCols(stmnt, autoAssign, autoAssignColNames,
row);
else {
StateManagerImpl sm = (StateManagerImpl)row.getPrimaryKey();
if (sm != null) {

View File

@ -377,7 +377,8 @@ public class SQLStoreQuery
tok.wordChars('?', '?');
StringBuffer buf = new StringBuffer(sql.length());
for (int ttype; (ttype = tok.nextToken()) != StreamTokenizer.TT_EOF;) {
for (int ttype; (ttype = tok.nextToken()) !=
StreamTokenizer.TT_EOF;) {
switch (ttype) {
case StreamTokenizer.TT_WORD:
// a token is a positional parameter if it starts with

View File

@ -390,8 +390,9 @@ public class TableJDBCSeq
Unique u = table.addUnique(uniqueName);
for (String columnName : _uniqueColumnNames) {
if (!table.containsColumn(columnName))
throw new UserException(_loc.get("unique-missing-column",
columnName, table.getName(), table.getColumnNames()));
throw new UserException(_loc.get("unique-missing-column",
columnName, table.getName(),
table.getColumnNames()));
Column col = table.getColumn(columnName);
u.addColumn(col);
}
@ -416,7 +417,8 @@ public class TableJDBCSeq
runnable);
}
catch(NotSupportedException nse) {
SQLException sqlEx = new SQLException(nse.getLocalizedMessage());
SQLException sqlEx = new SQLException(
nse.getLocalizedMessage());
sqlEx.initCause(nse);
throw sqlEx;
}
@ -560,7 +562,8 @@ public class TableJDBCSeq
// update the value
upd = new SQLBuffer(dict);
String tableName = resolveTableName(mapping, _seqColumn.getTable());
String tableName = resolveTableName(mapping,
_seqColumn.getTable());
upd.append("UPDATE ").append(tableName).
append(" SET ").append(_seqColumn).append(" = ").
appendValue(Numbers.valueOf(cur + inc), _seqColumn).
@ -570,7 +573,8 @@ public class TableJDBCSeq
stmnt = prepareStatement(conn, upd);
dict.setTimeouts(stmnt, _conf, true);
updates = executeUpdate(_conf, conn, stmnt, upd, RowImpl.ACTION_UPDATE);
updates = executeUpdate(_conf, conn, stmnt, upd,
RowImpl.ACTION_UPDATE);
} finally {
if (rs != null)
try { rs.close(); } catch (SQLException se) {}
@ -765,7 +769,8 @@ public class TableJDBCSeq
* implementation of executing update.
*/
protected int executeUpdate(JDBCConfiguration conf, Connection conn,
PreparedStatement stmnt, SQLBuffer buf, int opcode) throws SQLException {
PreparedStatement stmnt, SQLBuffer buf, int opcode) throws SQLException
{
return stmnt.executeUpdate();
}
@ -782,7 +787,8 @@ public class TableJDBCSeq
* This method is to provide override for non-JDBC or JDBC-like
* implementation of getting sequence from the result set.
*/
protected long getSequence(ResultSet rs, DBDictionary dict) throws SQLException {
protected long getSequence(ResultSet rs, DBDictionary dict)
throws SQLException {
if (rs == null || !rs.next())
return -1;
return dict.getLong(rs, 1);

View File

@ -180,11 +180,13 @@ public class CollectionParam
sql.appendValue(((Object[]) pstate.sqlValue[i])[index],
pstate.getColumn(index), this);
else if (pstate.cols != null)
sql.appendValue(pstate.sqlValue[i], pstate.getColumn(index), this);
sql.appendValue(pstate.sqlValue[i], pstate.getColumn(index),
this);
else if (pstate.discValue[i] != null)
sql.appendValue(pstate.discValue[i]);
else
sql.appendValue(pstate.sqlValue[i], pstate.getColumn(index), this);
sql.appendValue(pstate.sqlValue[i], pstate.getColumn(index),
this);
}
}
}

View File

@ -486,7 +486,8 @@ public class JDBCExpressionFactory
for (int i = 0; i < vals.length; i++) {
if (vals[i] instanceof Lit) {
Lit val = (Lit) vals[i];
StringBuffer value = new StringBuffer(val.getValue().toString());
StringBuffer value =
new StringBuffer(val.getValue().toString());
if (val.getParseType() == Literal.TYPE_SQ_STRING)
value.insert(0, "'").append("'");
val.setValue(new Raw(value.toString()));

View File

@ -97,10 +97,12 @@ public class MapEntry
return new Entry(key, val);
}
public void orderBy(Select sel, ExpContext ctx, ExpState state, boolean asc) {
public void orderBy(Select sel, ExpContext ctx, ExpState state, boolean asc)
{
}
public void select(Select sel, ExpContext ctx, ExpState state, boolean pks) {
public void select(Select sel, ExpContext ctx, ExpState state, boolean pks)
{
selectColumns(sel, ctx, state, pks);
}

View File

@ -92,7 +92,8 @@ public class MapKey
return key;
}
public void select(Select sel, ExpContext ctx, ExpState state, boolean pks) {
public void select(Select sel, ExpContext ctx, ExpState state, boolean pks)
{
selectColumns(sel, ctx, state, pks);
}

View File

@ -211,7 +211,7 @@ public class PCPath
// we build the remaining xpath that follows the root element.
while (itr.hasNext()) {
action = (Action) itr.next();
if (((XMLMetaData) action.data).getXmlname() != null)
if (((XMLMetaData) action.data).getXmlname() != null)
xpath.append(((XMLMetaData) action.data).getXmlname());
else
xpath.append("*");
@ -296,7 +296,8 @@ public class PCPath
case JavaTypes.ARRAY:
case JavaTypes.COLLECTION:
ValueMapping elem = pstate.field.getElementMapping();
if (pstate.joinedRel && elem.getTypeCode() == JavaTypes.PC) {
if (pstate.joinedRel && elem.getTypeCode() == JavaTypes.PC)
{
if (pstate.field.isElementCollection() &&
pstate.field.getElement().isEmbedded())
return ((HandlerCollectionTableFieldStrategy)
@ -544,7 +545,8 @@ public class PCPath
pstate.joins = from.joinSuperclass(pstate.joins, false);
}
}
// nothing more to do from here on as we encountered an xpath action
// nothing more to do from here on as we encountered an xpath
// action
if (action.op == Action.GET_XPATH)
break;
}
@ -628,8 +630,8 @@ public class PCPath
if (action.op != Action.GET && action.op != Action.GET_OUTER)
continue;
try {
candidate = sm.fetchField(((FieldMapping)action.data).getIndex(),
true);
candidate = sm.fetchField(
((FieldMapping)action.data).getIndex(), true);
} catch (ClassCastException cce) {
throw new RuntimeException(action.data + " not a field path");
} finally {

View File

@ -366,7 +366,7 @@ public class ClassMappingInfo
if (cinfo._uniques != null) {
if (_uniques == null)
_uniques = new HashMap<String, List<Unique>>();
for (Entry<String, List<Unique>> entry : cinfo._uniques.entrySet())
for (Entry<String, List<Unique>> entry : cinfo._uniques.entrySet())
if (!_uniques.containsKey(entry.getKey()))
_uniques.put(entry.getKey(), entry.getValue());
}
@ -382,9 +382,9 @@ public class ClassMappingInfo
public void addUnique(String table, Unique unique) {
if (!StringUtils.equals(_tableName, table) &&
(_seconds == null || !_seconds.containsKey(table))) {
throw new UserException(_loc.get("unique-no-table",
new Object[]{table, _className, _tableName,
((_seconds == null) ? "" : _seconds.keySet())}));
throw new UserException(_loc.get("unique-no-table",
new Object[]{table, _className, _tableName,
((_seconds == null) ? "" : _seconds.keySet())}));
}
if (unique == null)
return;
@ -425,16 +425,17 @@ public class ClassMappingInfo
List<Unique> uniqueConstraints = _uniques.get(tableName);
for (Unique template : uniqueConstraints) {
Column[] templateColumns = template.getColumns();
Column[] uniqueColumns = new Column[templateColumns.length];
Table table = getTable((ClassMapping)cm, tableName, adapt);
Column[] uniqueColumns = new Column[templateColumns.length];
Table table = getTable((ClassMapping)cm, tableName, adapt);
for (int i=0; i<uniqueColumns.length; i++) {
String columnName = templateColumns[i].getName();
String columnName = templateColumns[i].getName();
if (!table.containsColumn(columnName)) {
throw new UserException(_loc.get("unique-missing-column",
new Object[]{cm, columnName, tableName,
Arrays.toString(table.getColumnNames())}));
throw new UserException(_loc.get(
"unique-missing-column",
new Object[]{cm, columnName, tableName,
Arrays.toString(table.getColumnNames())}));
}
Column uniqueColumn = table.getColumn(columnName);
Column uniqueColumn = table.getColumn(columnName);
uniqueColumns[i] = uniqueColumn;
}
Unique unique = createUnique(cm, "unique", template,

View File

@ -1187,9 +1187,9 @@ public class FieldMapping
ForeignKey rjfk = rfm.getJoinForeignKey();
if (rjfk == null)
continue;
if (rjfk.getTable() == jfk.getTable()
&& jfk.getTable().getColumns().length
== jfk.getColumns().length + rjfk.getColumns().length) {
if (rjfk.getTable() == jfk.getTable() &&
jfk.getTable().getColumns().length ==
jfk.getColumns().length + rjfk.getColumns().length) {
_bidirectionalJoinTableOwner = true;
break;
}
@ -1227,13 +1227,14 @@ public class FieldMapping
for (int i=0; i<relFmds.length;i++) {
FieldMapping rfm = relFmds[i];
ValueMapping relem = rfm.getElementMapping();
if (relem != null && relem.getDeclaredTypeMapping() == getDeclaringMapping()) {
if (relem != null && relem.getDeclaredTypeMapping() ==
getDeclaringMapping()) {
ForeignKey rjfk = rfm.getJoinForeignKey();
if (rjfk == null)
continue;
if (rjfk.getTable() == jfk.getTable()
&& jfk.getTable().getColumns().length
== jfk.getColumns().length + rjfk.getColumns().length) {
if (rjfk.getTable() == jfk.getTable() &&
jfk.getTable().getColumns().length ==
jfk.getColumns().length + rjfk.getColumns().length) {
_bidirectionalJoinTableNonOwner = true;
break;
}

View File

@ -58,7 +58,7 @@ public class FieldMappingInfo
private Column _orderCol = null;
private boolean _canOrderCol = true;
private String[] _comments = null;
private List<Unique> _joinTableUniques; // Unique constraints on the JoinTable
private List<Unique> _joinTableUniques; // Unique constraints on JoinTable
/**
* The user-supplied name of the table for this field.
@ -158,8 +158,8 @@ public class FieldMappingInfo
if (cols.isEmpty()) {
ClassMapping mapping;
if (field.isEmbedded() &&
field.getDeclaringMapping().getEmbeddingMapping() != null) {
mapping = field.getDeclaringMapping().getEmbeddingMapping()
field.getDeclaringMapping().getEmbeddingMapping() != null) {
mapping = field.getDeclaringMapping().getEmbeddingMapping()
.getFieldMapping().getDeclaringMapping();
} else {
mapping = field.getDefiningMapping();
@ -368,7 +368,8 @@ public class FieldMappingInfo
/**
* Sets internal constraint information to match given mapped constraint.
*/
protected void syncJoinTableUniques(MetaDataContext context, Unique[] unqs) {
protected void syncJoinTableUniques(MetaDataContext context, Unique[] unqs)
{
if (unqs == null) {
_joinTableUniques = null;
return;

View File

@ -470,7 +470,7 @@ public class MappingDefaultsImpl
* Provides a default value for the given Discriminator.
*
* <P>
* The type of the object returned relies on the javaType field being set on
* The type of the object returned relies on the javaType field being set on
* the Discriminator which is provided.
* <TABLE border="2">
* <TH>JavaType

View File

@ -147,8 +147,8 @@ public abstract class MappingInfo
}
/**
* Affirms if this instance represents an implicit relation. For example, a
* relation expressed as the value of primary key of the related class and
* Affirms if this instance represents an implicit relation. For example, a
* relation expressed as the value of primary key of the related class and
* not as object reference.
*
* @since 1.3.0
@ -553,10 +553,10 @@ public abstract class MappingInfo
if ((!adapt && !fill) && given.size() != tmplates.length) {
// try default table
given = getColumns("");
if ((!adapt && !fill) && given.size() != tmplates.length) {
throw new MetaDataException(_loc.get(prefix + "-num-cols",
context, String.valueOf(tmplates.length),
String.valueOf(given.size())));
if ((!adapt && !fill) && given.size() != tmplates.length) {
throw new MetaDataException(_loc.get(prefix + "-num-cols",
context, String.valueOf(tmplates.length),
String.valueOf(given.size())));
}
}
}
@ -573,7 +573,8 @@ public abstract class MappingInfo
return cols;
}
boolean canMerge(List given, Column[] templates, boolean adapt, boolean fill) {
boolean canMerge(List given, Column[] templates, boolean adapt,
boolean fill) {
return !((!given.isEmpty() || (!adapt && !fill))
&& given.size() != templates.length);
}

View File

@ -51,7 +51,8 @@ import org.apache.openjpa.jdbc.meta.strats.MaxEmbeddedByteArrayFieldStrategy;
import org.apache.openjpa.jdbc.meta.strats.MaxEmbeddedCharArrayFieldStrategy;
import org.apache.openjpa.jdbc.meta.strats.MaxEmbeddedClobFieldStrategy;
import org.apache.openjpa.jdbc.meta.strats.MultiColumnVersionStrategy;
import org.apache.openjpa.jdbc.meta.strats.NanoPrecisionTimestampVersionStrategy;
import org.apache.openjpa.jdbc.meta.strats.
NanoPrecisionTimestampVersionStrategy;
import org.apache.openjpa.jdbc.meta.strats.NoneClassStrategy;
import org.apache.openjpa.jdbc.meta.strats.NoneDiscriminatorStrategy;
import org.apache.openjpa.jdbc.meta.strats.NoneFieldStrategy;
@ -60,13 +61,15 @@ import org.apache.openjpa.jdbc.meta.strats.NumberVersionStrategy;
import org.apache.openjpa.jdbc.meta.strats.ObjectIdClassStrategy;
import org.apache.openjpa.jdbc.meta.strats.ObjectIdValueHandler;
import org.apache.openjpa.jdbc.meta.strats.PrimitiveFieldStrategy;
import org.apache.openjpa.jdbc.meta.strats.RelationCollectionInverseKeyFieldStrategy;
import org.apache.openjpa.jdbc.meta.strats.
RelationCollectionInverseKeyFieldStrategy;
import org.apache.openjpa.jdbc.meta.strats.RelationCollectionTableFieldStrategy;
import org.apache.openjpa.jdbc.meta.strats.RelationFieldStrategy;
import org.apache.openjpa.jdbc.meta.strats.RelationHandlerMapTableFieldStrategy;
import org.apache.openjpa.jdbc.meta.strats.RelationMapInverseKeyFieldStrategy;
import org.apache.openjpa.jdbc.meta.strats.RelationMapTableFieldStrategy;
import org.apache.openjpa.jdbc.meta.strats.RelationRelationMapTableFieldStrategy;
import org.apache.openjpa.jdbc.meta.strats.
RelationRelationMapTableFieldStrategy;
import org.apache.openjpa.jdbc.meta.strats.StateComparisonVersionStrategy;
import org.apache.openjpa.jdbc.meta.strats.StringFieldStrategy;
import org.apache.openjpa.jdbc.meta.strats.SubclassJoinDiscriminatorStrategy;

View File

@ -54,7 +54,8 @@ import org.apache.openjpa.jdbc.meta.strats.MaxEmbeddedBlobFieldStrategy;
import org.apache.openjpa.jdbc.meta.strats.MaxEmbeddedClobFieldStrategy;
import org.apache.openjpa.jdbc.meta.strats.NoneDiscriminatorStrategy;
import org.apache.openjpa.jdbc.meta.strats.PrimitiveFieldStrategy;
import org.apache.openjpa.jdbc.meta.strats.RelationCollectionInverseKeyFieldStrategy;
import org.apache.openjpa.jdbc.meta.strats.
RelationCollectionInverseKeyFieldStrategy;
import org.apache.openjpa.jdbc.meta.strats.RelationCollectionTableFieldStrategy;
import org.apache.openjpa.jdbc.meta.strats.RelationFieldStrategy;
import org.apache.openjpa.jdbc.meta.strats.StateComparisonVersionStrategy;

View File

@ -70,8 +70,9 @@ public class VersionMappingInfo
boolean adapt) {
Table primaryTable = vers.getClassMapping().getTable();
List<String> secondaryTableNames = Arrays.asList(vers
.getClassMapping().getMappingInfo().getSecondaryTableNames());
Map<Table, List<Column>> assign = new LinkedHashMap<Table, List<Column>>();
.getClassMapping().getMappingInfo().getSecondaryTableNames());
Map<Table, List<Column>> assign = new LinkedHashMap<Table,
List<Column>>();
for (Column col : templates) {
String tableName = col.getTableName();
Table table;
@ -81,7 +82,7 @@ public class VersionMappingInfo
} else if (secondaryTableNames.contains(tableName)) {
table = primaryTable.getSchema().getTable(tableName);
} else {
throw new UserException(_loc.get("bad-version-column-table",
throw new UserException(_loc.get("bad-version-column-table",
col.getName(), tableName));
}
if (!assign.containsKey(table))
@ -94,7 +95,7 @@ public class VersionMappingInfo
List<Column> cols = assign.get(table);
Column[] partTemplates = cols.toArray(new Column[cols.size()]);
def.populateColumns(vers, table, partTemplates);
result.addAll(Arrays.asList(createColumns(vers, null, partTemplates,
result.addAll(Arrays.asList(createColumns(vers, null, partTemplates,
table, adapt)));
}
return result.toArray(new Column[result.size()]);

View File

@ -65,8 +65,8 @@ public abstract class ColumnVersionStrategy
* one column.
*/
protected int getJavaType(int i) {
throw new AbstractMethodError(
_loc.get("multi-column-version-unsupported",getAlias()).toString());
throw new AbstractMethodError(_loc.get(
"multi-column-version-unsupported",getAlias()).toString());
}
/**
@ -107,13 +107,13 @@ public abstract class ColumnVersionStrategy
/**
* Compare each element of the given arrays that must be of equal size.
* The given array values represent version values and the result designate
* The given array values represent version values and the result designate
* whether first version is earlier, same or later than the second one.
*
* @return If any element of a1 is later than corresponding element of
* a2 then returns 1 i.e. the first version is later than the second version.
* If each element of a1 is equal to corresponding element of a2 then return
* 0 i.e. the first version is same as the second version.
* a2 then returns 1 i.e. the first version is later than the second
* version. If each element of a1 is equal to corresponding element of a2
* then return 0 i.e. the first version is same as the second version.
* else return a negative number i.e. the first version is earlier than
* the second version.
*/
@ -148,7 +148,7 @@ public abstract class ColumnVersionStrategy
templates[i].setTableName(infoColumn.getTableName());
templates[i].setType(infoColumn.getType());
templates[i].setSize(infoColumn.getSize());
templates[i].setDecimalDigits(infoColumn.getDecimalDigits());
templates[i].setDecimalDigits(infoColumn.getDecimalDigits());
templates[i].setJavaType(getJavaType(i));
templates[i].setName(infoColumn.getName());
}
@ -162,7 +162,8 @@ public abstract class ColumnVersionStrategy
tmplate.setJavaType(getJavaType());
tmplate.setName("versn");
Column[] cols = info.getColumns(vers, new Column[]{ tmplate }, adapt);
Column[] cols = info.getColumns(vers, new Column[]{ tmplate },
adapt);
cols[0].setVersionStrategy(this);
vers.setColumns(cols);
vers.setColumnIO(info.getColumnIO());
@ -178,7 +179,8 @@ public abstract class ColumnVersionStrategy
ColumnIO io = vers.getColumnIO();
Object initial = nextVersion(null);
for (int i = 0; i < cols.length; i++) {
Row row = rm.getRow(cols[i].getTable(), Row.ACTION_INSERT, sm, true);
Row row = rm.getRow(cols[i].getTable(), Row.ACTION_INSERT, sm,
true);
if (io.isInsertable(i, initial == null))
row.setObject(cols[i], getColumnValue(initial, i));
}
@ -201,7 +203,8 @@ public abstract class ColumnVersionStrategy
// set where and update conditions on row
for (int i = 0; i < cols.length; i++) {
Row row = rm.getRow(cols[i].getTable(), Row.ACTION_UPDATE, sm, true);
Row row = rm.getRow(cols[i].getTable(), Row.ACTION_UPDATE, sm,
true);
row.setFailedObject(sm.getManagedInstance());
if (curVersion != null && sm.isVersionCheckRequired()) {
row.whereObject(cols[i], getColumnValue(curVersion, i));

View File

@ -152,9 +152,11 @@ public abstract class EmbedValueHandler
if (cval instanceof PersistenceCapable) {
OpenJPAStateManager embedSm = (OpenJPAStateManager)
((PersistenceCapable)cval).pcGetStateManager();
idx = toDataStoreValue1(embedSm, val, store, cols, rvals, idx);
idx = toDataStoreValue1(embedSm, val, store, cols, rvals,
idx);
} else if (cval instanceof ObjectIdStateManager) {
idx = toDataStoreValue1((ObjectIdStateManager)cval, val, store, cols, rvals, idx);
idx = toDataStoreValue1((ObjectIdStateManager)cval, val,
store, cols, rvals, idx);
} else if (cval == null) {
idx = toDataStoreValue1(null, val, store, cols, rvals, idx);
}
@ -222,7 +224,8 @@ public abstract class EmbedValueHandler
idx = toObjectValue1(em1, vm1, val, store, fetch, cols, idx);
} else if (em instanceof ObjectIdStateManager) {
em1 = new ObjectIdStateManager(null, null, vm1);
idx = toObjectValue1(em1, vm1, val, store, null, getColumns(fms[i]), idx);
idx = toObjectValue1(em1, vm1, val, store, null,
getColumns(fms[i]), idx);
}
cval = em1.getManagedInstance();
} else {

View File

@ -148,7 +148,7 @@ public class HandlerCollectionTableFieldStrategy
ValueMapping elem = field.getElementMapping();
Column order = field.getOrderColumn();
boolean setOrder = field.getOrderColumnIO().isInsertable(order, false);
boolean setOrder = field.getOrderColumnIO().isInsertable(order, false);
int idx = (setOrder && order != null) ? order.getBase() : 0;
for (Iterator itr = coll.iterator(); itr.hasNext(); idx++) {
HandlerStrategies.set(elem, itr.next(), store, row, _cols,

View File

@ -115,7 +115,8 @@ public class HandlerHandlerMapTableFieldStrategy
} else {
DBDictionary dict = field.getMappingRepository().getDBDictionary();
_kcols = HandlerStrategies.map(key,
dict.getValidColumnName("key", field.getTable()), _kio, adapt);
dict.getValidColumnName("key", field.getTable()), _kio,
adapt);
}
_vio = new ColumnIO();
_vcols = HandlerStrategies.map(val, "value", _vio, adapt);

View File

@ -204,7 +204,8 @@ public abstract class MapTableFieldStrategy
throw new MetaDataException(_loc.get
("mapped-inverse-unjoined", field.getName(),
field.getDefiningMapping(), mapped));
ForeignKey fk = mapped.getForeignKey(field.getDefiningMapping());
ForeignKey fk = mapped.getForeignKey(
field.getDefiningMapping());
field.setForeignKey(fk);
field.setJoinForeignKey(fk);
} else if (mapped.getElement().getTypeCode() == JavaTypes.PC) {
@ -220,7 +221,8 @@ public abstract class MapTableFieldStrategy
ValueMapping elem = mapped.getElementMapping();
ForeignKey fk = elem.getForeignKey();
field.setJoinForeignKey(fk);
field.getElementMapping().setForeignKey(mapped.getJoinForeignKey());
field.getElementMapping().setForeignKey(
mapped.getJoinForeignKey());
} else
throw new MetaDataException(_loc.get("not-inv-relation",
field, mapped));
@ -256,8 +258,9 @@ public abstract class MapTableFieldStrategy
return true;
}
protected boolean populateKey(Row row, OpenJPAStateManager valsm, Object obj,
StoreContext ctx, RowManager rm, JDBCStore store) throws SQLException {
protected boolean populateKey(Row row, OpenJPAStateManager valsm,
Object obj, StoreContext ctx, RowManager rm, JDBCStore store)
throws SQLException {
ClassMapping meta = (ClassMapping)valsm.getMetaData();
FieldMapping fm = getFieldMapping(meta);
if (fm == null)

View File

@ -46,7 +46,7 @@ public class MultiColumnVersionStrategy extends NumberVersionStrategy {
Column[] cols = vers.getColumns();
_initials = new Number[cols.length];
for (int i = 0; i < cols.length; i++) {
_initials[i] = nextValue(Numbers.valueOf(0), getJavaType(i));
_initials[i] = nextValue(Numbers.valueOf(0), getJavaType(i));
}
}
super.initialize();
@ -78,7 +78,7 @@ public class MultiColumnVersionStrategy extends NumberVersionStrategy {
protected int getJavaType(int i) {
if (_javaTypes == null) {
_javaTypes = new Integer[vers.getMappingInfo().getColumns().size()];
_javaTypes = new Integer[vers.getMappingInfo().getColumns().size()];
}
if (_javaTypes[i] == null) {
Column col = (Column)vers.getMappingInfo().getColumns().get(i);

View File

@ -213,15 +213,18 @@ public class RelationFieldStrategy
if ((fmds[i].getName().equals(mappedByIdValue)) ||
mappedByIdValue.length() == 0) {
if (fmds[i].getValue().getEmbeddedMetaData() != null) {
EmbedValueHandler.getEmbeddedIdCols((FieldMapping)fmds[i], cols);
EmbedValueHandler.getEmbeddedIdCols(
(FieldMapping)fmds[i], cols);
} else
EmbedValueHandler.getIdColumns((FieldMapping)fmds[i], cols);
EmbedValueHandler.getIdColumns(
(FieldMapping)fmds[i], cols);
}
}
return cols;
} else { // primary key is single-value
Class pkType = pk.getDeclaredType();
FieldMetaData[] pks = field.getValue().getDeclaredTypeMetaData().getPrimaryKeyFields();
FieldMetaData[] pks = field.getValue().getDeclaredTypeMetaData().
getPrimaryKeyFields();
if (pks.length != 1 || pks[0].getDeclaredType() != pkType)
return Collections.EMPTY_LIST;
pkCols = pk.getColumns();
@ -346,9 +349,9 @@ public class RelationFieldStrategy
nullInverse(sm, rm);
updateInverse(sm, rel, store, rm);
} else {
int action = (rel == null
&& field.isBidirectionalJoinTableMappingNonOwner()) ?
Row.ACTION_DELETE : Row.ACTION_UPDATE;
int action = (rel == null &&
field.isBidirectionalJoinTableMappingNonOwner()) ?
Row.ACTION_DELETE : Row.ACTION_UPDATE;
Row row = field.getRow(sm, store, rm, action);
if (row != null) {
field.setForeignKey(row, rel);
@ -385,7 +388,7 @@ public class RelationFieldStrategy
fk.getDeleteAction() == ForeignKey.ACTION_CASCADE) {
Row row = field.getRow(sm, store, rm, Row.ACTION_DELETE);
row.setForeignKey(fk, null, rel);
// this is for bi-directional maps, the key and value of the
// this is for bi-directional maps, the key and value of the
// map are stored in the table of the mapped-by entity
setMapKey(sm, rel, store, row);
}
@ -692,7 +695,7 @@ public class RelationFieldStrategy
Object oid = null;
if (relMapping.isMapped()) {
oid = relMapping.getObjectId(store, res, field.getForeignKey(),
field.getPolymorphic() != ValueMapping.POLY_FALSE, null);
field.getPolymorphic() != ValueMapping.POLY_FALSE, null);
} else {
Column[] cols = field.getColumns();
if (relMapping.getIdentityType() == ClassMapping.ID_DATASTORE) {

View File

@ -768,8 +768,8 @@ public class Column
}
/**
* Affirms if this instance represents an implicit relation. For example, a
* relation expressed as the value of primary key of the related class and
* Affirms if this instance represents an implicit relation. For example, a
* relation expressed as the value of primary key of the related class and
* not as object reference.
*
* @since 1.3.0

View File

@ -222,7 +222,7 @@ public class DataSourceFactory {
// add trace info for autoCommit setting
if (log.isTraceEnabled())
log.trace(_loc.get("set-auto-commit", new Object[] {
dict.supportsMultipleNontransactionalResultSets}));
dict.supportsMultipleNontransactionalResultSets}));
}
Options opts = Configurations.parseProperties((factory2)
? conf.getConnectionFactory2Properties()

View File

@ -213,8 +213,8 @@ public class SchemaGroup
// We can't handle the case that one entity has schema name
// and other entity does not have schema name but both entities
// map to the same table.
if (tab != null
&& (schemas[i] == inSchema || inSchema.getName() == null))
if (tab != null &&
(schemas[i] == inSchema || inSchema.getName() == null))
return tab;
}
@ -297,8 +297,8 @@ public class SchemaGroup
Sequence seq;
for (int i = 0; i < schemas.length; i++) {
seq = schemas[i].getSequence(name);
if ((seq != null)
&& (schemas[i] == inSchema || inSchema.getName() == null))
if ((seq != null) &&
(schemas[i] == inSchema || inSchema.getName() == null))
return seq;
}

View File

@ -450,7 +450,8 @@ public class SchemaTool {
for (int i = 0; i < schemas.length; i++) {
seqs = schemas[i].getSequences();
for (int j = 0; j < seqs.length; j++) {
if (db.findSequence(schemas[i], seqs[j].getFullName()) != null)
if (db.findSequence(schemas[i], seqs[j].getFullName()) !=
null)
continue;
if (createSequence(seqs[j])) {

View File

@ -95,8 +95,8 @@ public abstract class SimpleDriverDataSource
throws SQLException {
Connection con = getDriver().connect(_connectionURL, props);
if (con == null) {
throw new SQLException(_eloc.get("poolds-null",
_connectionDriverName, _connectionURL).getMessage());
throw new SQLException(_eloc.get("poolds-null",
_connectionDriverName, _connectionURL).getMessage());
}
return con;
}

View File

@ -233,8 +233,9 @@ public class DB2Dictionary
// TRANSACTION_READ_COMMITTED
conn = super.decorate(conn);
if (conf.getTransactionIsolationConstant() == -1
&& conn.getTransactionIsolation() < Connection.TRANSACTION_READ_COMMITTED)
if (conf.getTransactionIsolationConstant() == -1 &&
conn.getTransactionIsolation() <
Connection.TRANSACTION_READ_COMMITTED)
conn.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
return conn;
@ -278,7 +279,7 @@ public class DB2Dictionary
// verify that database product is supported
if (db2ServerType == 0 || maj == 0)
throw new UnsupportedException(_loc.get("db-not-supported",
new Object[] {databaseProductName, databaseProductVersion }));
new Object[] {databaseProductName, databaseProductVersion }));
if (maj >= 9 || (maj == 8 && min >= 2)) {
supportsLockingWithMultipleTables = true;
@ -843,9 +844,11 @@ public class DB2Dictionary
if (subtype == StoreException.LOCK && errorState.equals("57033")
&& ex.getMessage().indexOf("80") != -1) {
recoverable = Boolean.TRUE;
} else if (subtype == StoreException.QUERY && errorState.equals("57014")
&& ex.getMessage().indexOf("40001") == -1) {
// FIXME drwoods - OPENJPA-964 - Need to determine expected DB2 behavior for query timeouts
} else if (subtype == StoreException.QUERY &&
errorState.equals("57014") &&
ex.getMessage().indexOf("40001") == -1) {
// FIXME drwoods - OPENJPA-964 - Need to determine expected DB2
// behavior for query timeouts
recoverable = Boolean.TRUE;
}
}

View File

@ -399,7 +399,8 @@ public class DBDictionary
// JDBC3-only method, so it might throw a
// AbstractMethodError
isJDBC3 = metaData.getJDBCMajorVersion() >= 3;
supportsGetGeneratedKeys = metaData.supportsGetGeneratedKeys();
supportsGetGeneratedKeys =
metaData.supportsGetGeneratedKeys();
} catch (Throwable t) {
// ignore if not JDBC3
}
@ -1720,7 +1721,7 @@ public class DBDictionary
*
* @param typeName The SQL type ie INT
* @param size The size clause ie (10)
* @return The typeName + size clause. Usually the size clause will
* @return The typeName + size clause. Usually the size clause will
* be appended to typeName. If the typeName contains a
* marker : {0} or if typeName contains a modifier the
* size clause will be inserted appropriately.
@ -2386,8 +2387,9 @@ public class DBDictionary
boolean distinct, boolean forUpdate, long start, long end,
boolean subselect, boolean checkTableForUpdate) {
return toOperation(getSelectOperation(fetch), selects, from, where,
group, having, order, distinct, start, end,
getForUpdateClause(fetch, forUpdate, null), subselect, checkTableForUpdate);
group, having, order, distinct, start, end,
getForUpdateClause(fetch, forUpdate, null), subselect,
checkTableForUpdate);
}
/**
@ -2460,10 +2462,10 @@ public class DBDictionary
/**
* Return the SQL for the given selecting operation.
*/
private SQLBuffer toOperation(String op, SQLBuffer selects,
SQLBuffer from, SQLBuffer where, SQLBuffer group, SQLBuffer having,
SQLBuffer order, boolean distinct, long start, long end,
String forUpdateClause, boolean subselect, boolean checkTableForUpdate) {
private SQLBuffer toOperation(String op, SQLBuffer selects, SQLBuffer from,
SQLBuffer where, SQLBuffer group, SQLBuffer having, SQLBuffer order,
boolean distinct, long start, long end, String forUpdateClause,
boolean subselect, boolean checkTableForUpdate) {
SQLBuffer buf = new SQLBuffer(this);
buf.append(op);
@ -4093,7 +4095,8 @@ public class DBDictionary
}
private boolean isSupported() {
// if this is a custom dict, traverse to whatever openjpa dict it extends
// if this is a custom dict, traverse to whatever openjpa dict it
// extends
Class c = getClass();
while (!c.getName().startsWith("org.apache.openjpa."))
c = c.getSuperclass();
@ -4158,7 +4161,8 @@ public class DBDictionary
InputStream stream = getClass().getResourceAsStream(rsrc);
String dictionaryClassName = getClass().getName();
if (stream == null) { // User supplied dictionary but no error codes xml
stream = DBDictionary.class.getResourceAsStream(rsrc); // use default
// use default
stream = DBDictionary.class.getResourceAsStream(rsrc);
dictionaryClassName = getClass().getSuperclass().getName();
}
codeReader.parse(stream, dictionaryClassName, this);
@ -4614,7 +4618,8 @@ public class DBDictionary
* This method is to provide override for non-JDBC or JDBC-like
* implementation of executing query.
*/
protected ResultSet executeQuery(Connection conn, PreparedStatement stmnt, String sql
protected ResultSet executeQuery(Connection conn, PreparedStatement stmnt,
String sql
) throws SQLException {
return stmnt.executeQuery();
}

View File

@ -48,7 +48,7 @@ public class DerbyDictionary
substringFunctionName = "SUBSTR";
// Derby name length restriction has been relaxed
// http://www.archivum.info/derby-dev@db.apache.org/2004-12/msg00270.html
//http://www.archivum.info/derby-dev@db.apache.org/2004-12/msg00270.html
maxConstraintNameLength = 128;
maxIndexNameLength = 128;
maxColumnNameLength = 128;
@ -113,7 +113,8 @@ public class DerbyDictionary
int errorCode = ex.getErrorCode();
if (errorStates.contains(errorState)) {
recoverable = Boolean.FALSE;
if ((subtype == StoreException.LOCK || subtype == StoreException.QUERY) && errorCode < 30000) {
if ((subtype == StoreException.LOCK ||
subtype == StoreException.QUERY) && errorCode < 30000) {
recoverable = Boolean.TRUE;
}
}

View File

@ -162,7 +162,8 @@ public class InformixDictionary
else
driverVendor = VENDOR_OTHER;
if (driverName.equals("IBM DB2 JDBC Universal Driver Architecture")) {
if (driverName.equals("IBM DB2 JDBC Universal Driver Architecture"))
{
useJCC = true;
try {
if (meta.storesLowerCaseIdentifiers())

View File

@ -58,7 +58,8 @@ public class PostgresDictionary
(PostgresDictionary.class);
private static Class<PostgresConnection> postgresConnectionImpl;
private static Class<PostgresPreparedStatement> postgresPreparedStatementImpl;
private static Class<PostgresPreparedStatement>
postgresPreparedStatementImpl;
static {
try {
@ -378,7 +379,7 @@ public class PostgresDictionary
.getConnection();
try {
conn.setAutoCommit(false);
PGConnection pgconn = (PGConnection) conn.getInnermostDelegate();
PGConnection pgconn = (PGConnection)conn.getInnermostDelegate();
LargeObjectManager lom = pgconn.getLargeObjectAPI();
// The create method is valid in versions previous 8.3
// in 8.3 this methos is deprecated, use createLO

View File

@ -343,8 +343,8 @@ public class PrimaryRow
} else if (!isDefaultValue(val)) {
throw new InvalidStateException(_loc.get("diff-values",
new Object[]{ col.getFullName(),
(prev == null) ? null : prev.getClass(), prev,
(val == null) ? null : val.getClass(), val })).
(prev == null) ? null : prev.getClass(), prev,
(val == null) ? null : val.getClass(), val })).
setFatal(true);
} else {
// since not allow to update and the new value is 0 or null,

View File

@ -350,9 +350,9 @@ public interface Result
* Return the value stored in the given column or id.
*
* @param obj the column or id whose data to fetch
* @param metaType the type code from {@link org.apache.openjpa.meta.JavaTypes} or
* {@link JavaSQLTypes} for the type of the data; if
* <code>obj</code> is a column, you may specify -1
* @param metaType the type code from
* {@link org.apache.openjpa.meta.JavaTypes} or {@link JavaSQLTypes} for the
* type of the data; if <code>obj</code> is a column, you may specify -1
* to use the column's recorded java type
* @param arg some JDBC data access methods use an argument, such
* as a {@link Calendar} or {@link Map}

View File

@ -41,8 +41,8 @@ import org.apache.openjpa.kernel.OpenJPAStateManager;
/**
* Logical representation of a table row for insert/update/delete. The
* {@link org.apache.openjpa.jdbc.kernel.UpdateManager} is responsible for implementing
* rows to do something useful when the values are set.
* {@link org.apache.openjpa.jdbc.kernel.UpdateManager} is responsible for
* implementing rows to do something useful when the values are set.
*
* @author Abe White
*/

View File

@ -258,7 +258,7 @@ public final class SQLBuffer
* Append a user parameter value for a specific column. User parameters
* are marked as opposed to the parameters inserted by the internal runtime
* system. This helps to reuse the buffer by reparmeterizing it with new
* set of user parameters while the 'internal' parameters remain unchanged.
* set of user parameters while the 'internal' parameters remain unchanged.
*
* @param userParam if non-null, designates a 'user' parameter.
*/

View File

@ -54,9 +54,9 @@ public class SQLErrorCodeReader {
new HashMap<String, Integer>();
static {
storeErrorTypes.put("lock", StoreException.LOCK);
storeErrorTypes.put("object-exists", StoreException.OBJECT_EXISTS);
storeErrorTypes
.put("object-not-found", StoreException.OBJECT_NOT_FOUND);
storeErrorTypes.put("object-exists", StoreException.OBJECT_EXISTS);
storeErrorTypes.put("object-not-found",
StoreException.OBJECT_NOT_FOUND);
storeErrorTypes.put("optimistic", StoreException.OPTIMISTIC);
storeErrorTypes.put("referential-integrity",
StoreException.REFERENTIAL_INTEGRITY);
@ -72,7 +72,7 @@ public class SQLErrorCodeReader {
try {
Document doc = builder.parse(in);
Element root = doc.getDocumentElement();
NodeList nodes = root.getElementsByTagName("dictionary");
NodeList nodes = root.getElementsByTagName("dictionary");
for (int i = 0; i < nodes.getLength(); i++) {
Node node = nodes.item(i);
NamedNodeMap attrs = node.getAttributes();
@ -96,8 +96,8 @@ public class SQLErrorCodeReader {
}
/**
* Parses given stream of XML content for error codes of the given database
* dictionary name. Populates the given dictionary with the error codes.
* Parses given stream of XML content for error codes of the given database
* dictionary name. Populates the given dictionary with the error codes.
*
*/
public void parse(InputStream in, String dictName, DBDictionary dict) {
@ -108,13 +108,13 @@ public class SQLErrorCodeReader {
try {
Document doc = builder.parse(in);
Element root = doc.getDocumentElement();
NodeList nodes = root.getElementsByTagName("dictionary");
NodeList nodes = root.getElementsByTagName("dictionary");
for (int i = 0; i < nodes.getLength(); i++) {
Node node = nodes.item(i);
NamedNodeMap attrs = node.getAttributes();
Node dictionary = attrs.getNamedItem("class");
if (dictionary != null
&& dictionary.getNodeValue().equals(dictName)) {
&& dictionary.getNodeValue().equals(dictName)) {
readErrorCodes(node, dict);
}
}
@ -139,13 +139,13 @@ public class SQLErrorCodeReader {
if (nodeType == Node.ELEMENT_NODE) {
String errorType = child.getNodeName();
Node textNode = child.getFirstChild();
if (storeErrorTypes.containsKey(errorType) && textNode != null){
String errorCodes = textNode.getNodeValue();
if (!StringUtils.isEmpty(errorCodes)) {
String[] codes = errorCodes.split(ERROR_CODE_DELIMITER);
for (String code : codes) {
dict.addErrorCode(storeErrorTypes.get(errorType),
code.trim());
if (storeErrorTypes.containsKey(errorType) && textNode != null){
String errorCodes = textNode.getNodeValue();
if (!StringUtils.isEmpty(errorCodes)) {
String[] codes = errorCodes.split(ERROR_CODE_DELIMITER);
for (String code : codes) {
dict.addErrorCode(storeErrorTypes.get(errorType),
code.trim());
}
}
}

View File

@ -141,7 +141,8 @@ public class SQLServerDictionary
protected void appendLength(SQLBuffer buf, int type) {
if (type == Types.VARCHAR)
buf.append("(").append(Integer.toString(characterColumnSize)).append(")");
buf.append("(").append(Integer.toString(characterColumnSize)).
append(")");
}
/**

View File

@ -487,7 +487,8 @@ public interface Select
* Add an ORDER BY clause.
* Optionally selects ordering data if not already selected.
*/
public boolean orderBy(SQLBuffer sql, boolean asc, boolean sel, Value selAs);
public boolean orderBy(SQLBuffer sql, boolean asc, boolean sel,
Value selAs);
/**
* Add an ORDER BY clause.

View File

@ -322,7 +322,8 @@ public class SelectImpl
stmnt = prepareStatement(conn, sql, null,
ResultSet.TYPE_FORWARD_ONLY,
ResultSet.CONCUR_READ_ONLY, false);
_dict.setQueryTimeout(stmnt, store.getFetchConfiguration().getQueryTimeout());
_dict.setQueryTimeout(stmnt,
store.getFetchConfiguration().getQueryTimeout());
rs = executeQuery(conn, stmnt, sql, false, store);
return getCount(rs);
} finally {
@ -1220,7 +1221,8 @@ public class SelectImpl
return seld;
}
public boolean orderBy(SQLBuffer sql, boolean asc, boolean sel, Value selAs) {
public boolean orderBy(SQLBuffer sql, boolean asc, boolean sel, Value selAs)
{
return orderBy(sql, asc, (Joins) null, sel, selAs);
}
@ -1407,7 +1409,8 @@ public class SelectImpl
int count = 0;
for (int i = 0; i < toCols.length; i++, count++) {
if (pks == null)
val = (oid == null) ? null : Numbers.valueOf(((Id) oid).getId());
val = (oid == null) ? null :
Numbers.valueOf(((Id) oid).getId());
else {
// must be app identity; use pk index to get correct pk value
join = mapping.assertJoinable(toCols[i]);

View File

@ -151,8 +151,8 @@ public class SybaseDictionary
"USER_OPTION", "WAITFOR", "WHILE", "WRITETEXT",
}));
// Sybase does not support foreign key delete/update action NULL, DEFAULT,
// CASCADE
// Sybase does not support foreign key delete/update action NULL,
// DEFAULT, CASCADE
supportsNullDeleteAction = false;
supportsDefaultDeleteAction = false;
supportsCascadeDeleteAction = false;

View File

@ -58,9 +58,10 @@ public interface CacheMarshaller {
/**
* The {@link ValidationPolicy} that this marshaller should use.
* A value for this parameter is required. The class will be instantiated
* via the {@link org.apache.openjpa.lib.conf.Configurations} mechanism, ensuring that if the class
* implements {@link Configurable} or {@link org.apache.openjpa.lib.conf.GenericConfigurable}, it will
* be taken through the appropriate lifecycle.
* via the {@link org.apache.openjpa.lib.conf.Configurations} mechanism,
* ensuring that if the class implements {@link Configurable} or
* {@link org.apache.openjpa.lib.conf.GenericConfigurable}, it will be taken
* through the appropriate lifecycle.
*/
public void setValidationPolicy(String policy)
throws InstantiationException, IllegalAccessException;

View File

@ -220,7 +220,7 @@ public interface OpenJPAConfiguration
public String getSpecification();
/**
* Get the Specification. Specification determines various important default
* Get the Specification. Specification determines various important default
* behaviors.
*
* @since 2.0.0

View File

@ -1545,7 +1545,8 @@ public class OpenJPAConfigurationImpl
public PreparedQueryCache getQuerySQLCacheInstance() {
if (preparedQueryCachePlugin.get() == null) {
preparedQueryCachePlugin.instantiate(PreparedQueryCache.class, this);
preparedQueryCachePlugin.instantiate(PreparedQueryCache.class,
this);
}
return (PreparedQueryCache)preparedQueryCachePlugin.get();
}

View File

@ -378,7 +378,8 @@ public abstract class AbstractQueryCache
/**
* Updates the entity timestamp map with the current time in milliseconds
* @param timestampMap -- a map that contains entityname and its last updated timestamp
* @param timestampMap -- a map that contains entityname and its last
* updated timestamp
*/
protected void updateEntityTimestamp(Map<String,Long> timestampMap) {
if (entityTimestampMap != null)

View File

@ -72,18 +72,18 @@ public interface CacheStatistics extends Serializable {
public long getTotalWriteCount();
/**
* Gets number of total read requests for the given class since last reset.
* Gets number of total read requests for the given class since last reset.
*/
public long getReadCount(Class c);
/**
* Gets number of total read requests that has been found in cache for the
* Gets number of total read requests that has been found in cache for the
* given class since last reset.
*/
public long getHitCount(Class c);
/**
* Gets number of total write requests for the given class since last reset.
* Gets number of total write requests for the given class since last reset.
*/
public long getWriteCount(Class c);
@ -93,7 +93,7 @@ public interface CacheStatistics extends Serializable {
public long getTotalReadCount(Class c);
/**
* Gets number of total read requests that has been found in cache for the
* Gets number of total read requests that has been found in cache for the
* given class since start.
*/
public long getTotalHitCount(Class c);
@ -125,8 +125,8 @@ public interface CacheStatistics extends Serializable {
public static class Default implements CacheStatistics {
private long[] astat = new long[3];
private long[] stat = new long[3];
private Map<Class, long[]> stats = new HashMap<Class, long[]>();
private Map<Class, long[]> astats = new HashMap<Class, long[]>();
private Map<Class, long[]> stats = new HashMap<Class, long[]>();
private Map<Class, long[]> astats = new HashMap<Class, long[]>();
private Date start = new Date();
private Date since = new Date();
@ -182,7 +182,7 @@ public interface CacheStatistics extends Serializable {
return getCount(astats, c, WRITE);
}
private long getCount(Map<Class, long[]> target, Class c, int index) {
private long getCount(Map<Class, long[]> target, Class c, int index) {
long[] row = target.get(c);
return (row == null) ? 0 : row[index];
}
@ -221,7 +221,7 @@ public interface CacheStatistics extends Serializable {
addSample(astats, c, index);
}
private void addSample(Map<Class, long[]> target, Class c, int index) {
private void addSample(Map<Class, long[]> target, Class c, int index) {
long[] row = target.get(c);
if (row == null) {
row = new long[3];

View File

@ -122,7 +122,8 @@ public class DataCachePCDataImpl
/**
* Store field-level information from the given state manager.
* Special process of checking if the cached collection data is out of order.
* Special process of checking if the cached collection data is out of
* order.
*/
protected void storeField(OpenJPAStateManager sm, FieldMetaData fmd) {
if (fmd.getManagement() != fmd.MANAGE_PERSISTENT)

View File

@ -1475,7 +1475,7 @@ public class ApplicationIdTool {
public static interface ObjectIdLoader
{
/**
* Turn on the loading of all identity classes, even if they don't
* Turn on the loading of all identity classes, even if they don't
* exist.
*/
public void setLoadObjectIds ();

View File

@ -141,7 +141,8 @@ public class ManagedClassSubclasser {
// reconfiguration at the end of this method.
ClassMetaData meta = enhancer.getMetaData();
if (meta == null) {
throw new MetaDataException(_loc.get("no-meta", cls)).setFatal(true);
throw new MetaDataException(_loc.get("no-meta", cls)).
setFatal(true);
}
configureMetaData(meta, conf, redefine, false);

View File

@ -210,8 +210,8 @@ public class PCDataGenerator
// if (type == null) {
// try {
// type = Class.forName
// (meta.getDescribedType().getName(), true,
// Thread.currentThread().getContextClassLoader());
// (meta.getDescribedType().getName(), true,
// Thread.currentThread().getContextClassLoader());
// } catch (ClassNotFoundException cnfe) {
// throw new InternalException();
// }

View File

@ -2493,7 +2493,8 @@ public class PCEnhancer {
code.dup();
if(_meta.isEmbeddedOnly()) {
code.aload().setThis();
code.invokevirtual().setMethod(Object.class, "getClass", Class.class, null);
code.invokevirtual().setMethod(Object.class, "getClass",
Class.class, null);
}else
code.classconstant().setClass(getType(_meta));
}
@ -2501,10 +2502,12 @@ public class PCEnhancer {
// new <oid class> ();
code.anew().setType(oidType);
code.dup();
if (_meta.isOpenJPAIdentity() || (obj && usesClsString == Boolean.TRUE)) {
if (_meta.isOpenJPAIdentity() || (obj && usesClsString ==
Boolean.TRUE)) {
if(_meta.isEmbeddedOnly()) {
code.aload().setThis();
code.invokevirtual().setMethod(Object.class, "getClass", Class.class, null);
code.invokevirtual().setMethod(Object.class, "getClass",
Class.class, null);
}else
code.classconstant().setClass(getType(_meta));
}
@ -3069,7 +3072,7 @@ public class PCEnhancer {
}
// if (sm != null)
// return (sm.isDetached ()) ? Boolean.TRUE : Boolean.FALSE;
// return (sm.isDetached ()) ? Boolean.TRUE : Boolean.FALSE;
loadManagedInstance(code, false);
code.getfield().setField(SM, SMTYPE);
JumpInstruction ifins = code.ifnull();

View File

@ -47,28 +47,28 @@ import serp.bytecode.BCMethod;
* <li>must not extend an enhanced class</li>
* <li>all persistent data represented by accessible setter/getter
* methods (persistent properties)</li>
* <li>if versioning is to be used, exactly one persistent property for
* the numeric version data</li> <!-- ##### is this true? -->
* <li>if versioning is to be used, exactly one persistent property for
* the numeric version data</li> <!-- ##### is this true? -->
*
* <li>When using property access, the backing field for a persistent
* <li>When using property access, the backing field for a persistent
* property must be:
* <ul>
* <!-- ##### JPA validation of these needs to be tested -->
* <!-- ##### JPA validation of these needs to be tested -->
* <li>private</li>
* <li>set only in the designated setter,
* in the constructor, or in {@link Object#clone()},
* <code>readObject(ObjectInputStream)</code>, or
* {@link Externalizable#readExternal(ObjectInput)}.</li>
* in the constructor, or in {@link Object#clone()},
* <code>readObject(ObjectInputStream)</code>, or
* {@link Externalizable#readExternal(ObjectInput)}.</li>
* <li>read only in the designated getter and the
* constructor.</li>
* </ul>
* </li>
* </ul>
*
* <p>If you use this technique and use the <code>new</code> keyword instead of
* a OpenJPA-supplied construction routine, OpenJPA will need to do extra work
* with persistent-new-flushed instances, since OpenJPA cannot in this case
* track what happens to such an instance.</p>
* <p>If you use this technique and use the <code>new</code> keyword instead
* of a OpenJPA-supplied construction routine, OpenJPA will need to do extra
* work with persistent-new-flushed instances, since OpenJPA cannot in this
* case track what happens to such an instance.</p>
*
* @since 1.0.0
*/

View File

@ -226,7 +226,7 @@ public class JMSRemoteCommitProvider
} else {
if (log.isWarnEnabled())
log.warn(s_loc.get("jms-receive-error-2",
o.getClass().getName(), _topicName));
o.getClass().getName(), _topicName));
}
} catch (JMSException jmse) {
if (log.isWarnEnabled())

View File

@ -41,14 +41,16 @@ public class LogOrphanedKeyAction
private short _level = Log.WARN;
/**
* The channel to log to. Defaults to <code>org.apache.openjpa.Runtime</code>.
* The channel to log to. Defaults to
* <code>org.apache.openjpa.Runtime</code>.
*/
public String getChannel() {
return _channel;
}
/**
* The channel to log to. Defaults to <code>org.apache.openjpa.Runtime</code>.
* The channel to log to. Defaults to
* <code>org.apache.openjpa.Runtime</code>.
*/
public void setChannel(String channel) {
_channel = channel;

View File

@ -31,7 +31,8 @@ import org.apache.openjpa.lib.util.Closeable;
* <code><pre> import org.apache.openjpa.event.*;
* import org.apache.openjpa.conf.*;
*
* {@link org.apache.openjpa.conf.OpenJPAConfiguration} conf = factory.getConfiguraiton ();
* {@link org.apache.openjpa.conf.OpenJPAConfiguration} conf =
* factory.getConfiguraiton ();
* RemoteCommitListener l = new RemoteCommitListener () {
* public void afterCommit ({@link RemoteCommitEvent} e) {
* // update a Swing widget when remote brokers make

View File

@ -410,7 +410,8 @@ public class BrokerImpl
public void popFetchConfiguration() {
if (_fcs == null || _fcs.isEmpty())
throw new UserException(_loc.get("fetch-configuration-stack-empty"));
throw new UserException(
_loc.get("fetch-configuration-stack-empty"));
_fc = (FetchConfiguration) _fcs.removeLast();
}
@ -4359,7 +4360,8 @@ public class BrokerImpl
public boolean isPersistent(Object obj) {
assertOpen();
if (ImplHelper.isManageable(obj))
return (ImplHelper.toPersistenceCapable(obj, _conf)).pcIsPersistent();
return (ImplHelper.toPersistenceCapable(obj, _conf)).
pcIsPersistent();
return false;
}

View File

@ -860,7 +860,7 @@ public class DetachManager
} else {
for (Iterator itr = map.entrySet().iterator(); itr.hasNext();) {
entry = (Map.Entry) itr.next ();
entry.setValue (detachInternal (entry.getValue ()));
entry.setValue (detachInternal (entry.getValue ()));
}
}
}

View File

@ -405,8 +405,8 @@ public class DetachedStateManager
public void accessingField(int idx) {
if (!_access && !_loaded.get(idx))
// do not access the pc fields by implictly invoking _pc.toString()
// may cause infinite loop if again tries to access unloaded field
// do not access the pc fields by implictly invoking _pc.toString()
// may cause infinite loop if again tries to access unloaded field
throw new IllegalStateException(_loc.get("unloaded-detached",
Exceptions.toString(_pc)).getMessage());
}

View File

@ -338,7 +338,7 @@ public interface FetchConfiguration
public Object getHint (String name);
/**
* Returns an immutable view of the currently active hints and their values.
* Returns an immutable view of the currently active hints and their values.
*
* @since 2.0.0
*/

View File

@ -32,9 +32,9 @@ import org.apache.openjpa.lib.conf.Configurable;
*
* A cached query by an identifier of parameterized type K.
*
* A query can be cached by an identifier and value represented by parameterized
* type V. Caching results in creating a new instance of FinderQuery FQ from the
* value V such that FQ can be executed to return a result of parameterized type
* A query can be cached by an identifier and value represented by parameterized
* type V. Caching results in creating a new instance of FinderQuery FQ from the
* value V such that FQ can be executed to return a result of parameterized type
* R. A request to cache may not be successful if this cache determines the
* value V to be not cachable.
*
@ -51,8 +51,8 @@ import org.apache.openjpa.lib.conf.Configurable;
* execution context changes in a way that will modify the resultant database
* language query FQ.
*
* One of the built-in mechanism (available in JPA facade) is to set query hints
* to either invalidate the query entirely or ignore the cached version for the
* One of the built-in mechanism (available in JPA facade) is to set query hints
* to either invalidate the query entirely or ignore the cached version for the
* current execution.
*
* @see QueryHints#HINT_IGNORE_FINDER
@ -124,7 +124,7 @@ public interface FinderCache<K,V,R> extends Configurable {
public List<String> getExcludes();
/**
* Adds the given pattern to the list of excluded patterns. Any existing
* Adds the given pattern to the list of excluded patterns. Any existing
* cache entry whose key matches the given pattern will be marked
* non-cachable in a reversible manner.
*/

View File

@ -59,7 +59,7 @@ public class InMemorySavepointManager
}
public boolean supportsIncrementalFlush() {
// cannot incrementally flush as saved fields may become out of synch.
// cannot incrementally flush as saved fields may become out of synch.
return false;
}
}

View File

@ -83,7 +83,7 @@ public interface PreparedQuery {
/**
* Initialize from the given argument.
*
* @param o an opaque instance supposed to carry post-execution data such
* @param o an opaque instance supposed to carry post-execution data such
* as target database query, parameters of the query etc.
*
* @return true if this receiver can initialize itself from the given
@ -97,7 +97,7 @@ public interface PreparedQuery {
public boolean isInitialized();
/**
* Get the list of parameters in a map where an entry represents a parameter
* Get the list of parameters in a map where an entry represents a parameter
* key and value after replacing with the given user parameters.
*
* Must be invoked after initialize().

View File

@ -46,7 +46,7 @@ import org.apache.openjpa.lib.conf.Configurable;
* execution context changes in a way that will modify the resultant database
* language query PQ.
*
* One of the built-in mechanism (available in JPA facade) is to set query hints
* One of the built-in mechanism (available in JPA facade) is to set query hints
* to either invalidate the query entirely or ignore the cached version for the
* current execution.
*
@ -55,7 +55,8 @@ import org.apache.openjpa.lib.conf.Configurable;
*
* This cache allows customization of whether a query can be cached or not
* via either explicit marking of certain keys as non-cachable (which is
* irreversible) or addition/removal of exclusion patterns (which is reversible).
* irreversible) or addition/removal of exclusion patterns (which is
* reversible).
*
* @see #markUncachable(String)
* @see #addExclusionPattern(String)
@ -108,7 +109,7 @@ public interface PreparedQueryCache extends Configurable {
* The query must not be cached if either the key matches any exclusion
* pattern or the key has been marked non-cachable.
*
* @return true if the given query is cached. false if it can not be cached
* @return true if the given query is cached. false if it can not be cached
* due to exclusion.
*
* @see #markUncachable(String)
@ -131,10 +132,10 @@ public interface PreparedQueryCache extends Configurable {
/**
* Affirms if a PreparedQuery can be cached against the given key.
*
* @return Boolean.FALSE if the given key is explicitly marked before as not
* @return Boolean.FALSE if the given key is explicitly marked before as not
* be cached or matches any of the exclusion patterns.
* Boolean.TRUE if the given key currently exists in the cache.
* Otherwise, return null implying this receiver can not determine whether
* Otherwise, return null implying this receiver can not determine whether
* this key can be cached on not.
*
*/
@ -145,9 +146,9 @@ public interface PreparedQueryCache extends Configurable {
* Explicit marking helps to avoid repeated computational cost of
* determining whether a query can be cached or not.
*
* Explicit marking can not be reversed by removal of exclusion patterns.
* Explicit marking can not be reversed by removal of exclusion patterns.
*
* @return The value for the given key if it had been cached before. null
* @return The value for the given key if it had been cached before. null
* otherwise.
*/
public PreparedQuery markUncachable(String id);
@ -164,13 +165,13 @@ public interface PreparedQueryCache extends Configurable {
/**
* Sets one or more exclusion regular expression patterns separated by
* semicolon. Any existing cache entry whose key matches any of the given
* semicolon. Any existing cache entry whose key matches any of the given
* pattern will be marked non-cachable in a reversible manner.
*/
public void setExcludes(String excludes);
/**
* Adds the given pattern to the list of excluded patterns. Any existing
* Adds the given pattern to the list of excluded patterns. Any existing
* cache entry whose key matches the given pattern will be marked
* non-cachable in a reversible manner.
*/

View File

@ -900,7 +900,8 @@ public class QueryImpl
* key and index. The index set on the Parameter by the parser is the
* same index used to access the Object[] elements returned by this method.
*
* {@link JPQLExpressionBuilder} creates and populates parameters as follows:
* {@link JPQLExpressionBuilder} creates and populates parameters as
* follows:
* The parameter key is not the token encountered by the parser, but
* converted to Integer or String based on the context in which the token
* appeared.
@ -914,12 +915,14 @@ public class QueryImpl
* This LinkedMap contains the parameter key and their expected
* (if determinable) value types. That it is a LinkedMap points to the
* fact that an ordering is implicit. The ordering of the keys in this Map
* is the same as the order in which parser encountered the parameter tokens.
* is the same as the order in which parser encountered the parameter
* tokens.
*
* For example, parsing result of the following two JPQL queries
* a) UPDATE CompUser e SET e.name= ?1, e.age = ?2 WHERE e.userid = ?3
* b) UPDATE CompUser e SET e.name= :name, e.age = :age WHERE e.userid = :id
* The parameter keys will appear in the order (3,2,1) or (:id, :name, :age)
* b) UPDATE CompUser e SET e.name= :name, e.age = :age WHERE e.userid =
* :id
* The parameter keys will appear in the order (3,2,1) or (:id, :name, :age)
* in the given LinkedMap because WHERE clause is parsed before SET clause.
* The corresponding Parameter Expressions created by the parser will have
* following key and index:
@ -1083,7 +1086,8 @@ public class QueryImpl
try {
val = q.evaluate(value, ob, params, sm);
} catch (UnsupportedException e1) {
throw new UserException(_loc.get("fail-to-get-update-value"));
throw new UserException(
_loc.get("fail-to-get-update-value"));
}
}

View File

@ -66,7 +66,7 @@ public interface QueryStatistics<T> extends Serializable {
public long getTotalExecutionCount(T query);
/**
* Gets number of total query execution that are cached since last reset.
* Gets number of total query execution that are cached since last reset.
*/
public long getHitCount();
@ -197,27 +197,27 @@ public interface QueryStatistics<T> extends Serializable {
}
public void dump(PrintStream out) {
String header = "Query Statistics starting from " + start;
String header = "Query Statistics starting from " + start;
out.print(header);
if (since == start) {
out.println();
out.println("Total Query Execution: " + toString(astat));
out.println("Total Query Execution: " + toString(astat));
out.println("\tTotal \t\tQuery");
} else {
out.println(" last reset on " + since);
out.println("Total Query Execution since start "
+ toString(astat) + " since reset " + toString(stat));
out.println("\tSince Start \tSince Reset \t\tQuery");
out.println("Total Query Execution since start " +
toString(astat) + " since reset " + toString(stat));
out.println("\tSince Start \tSince Reset \t\tQuery");
}
int i = 0;
for (T key : stats.keySet()) {
i++;
long[] arow = astats.get(key);
if (since == start) {
out.println(i + ". \t" + toString(arow) + " \t" + key);
out.println(i + ". \t" + toString(arow) + " \t" + key);
} else {
long[] row = stats.get(key);
out.println(i + ". \t" + toString(arow) + " \t"
out.println(i + ". \t" + toString(arow) + " \t"
+ toString(row) + " \t\t" + key);
}
}
@ -230,7 +230,7 @@ public interface QueryStatistics<T> extends Serializable {
}
String toString(long[] row) {
return row[READ] + ":" + row[HIT] + "(" + pct(row[HIT], row[READ])
return row[READ] + ":" + row[HIT] + "(" + pct(row[HIT], row[READ])
+ "%)";
}
}

View File

@ -1016,7 +1016,7 @@ public class StateManagerImpl
boolean wasFlushed = isFlushed();
boolean wasDeleted = isDeleted();
boolean needPostUpdate = !(wasNew && !wasFlushed)
&& (ImplHelper.getUpdateFields(this) != null);
&& (ImplHelper.getUpdateFields(this) != null);
// all dirty fields were flushed
_flush.or(_dirty);

View File

@ -332,7 +332,7 @@ public interface StoreQuery
/**
* Return a map of {@link FieldMetaData} to update
* {@link Constant}s, in cases where this query is for a bulk update.
* {@link Constant}s, in cases where this query is for a bulk update.
*/
public Map getUpdates (StoreQuery q);
}

View File

@ -29,7 +29,8 @@ import org.apache.openjpa.meta.ClassMetaData;
public class UUIDType4StringSeq
implements Seq {
private static final UUIDType4StringSeq _instance = new UUIDType4StringSeq();
private static final UUIDType4StringSeq _instance =
new UUIDType4StringSeq();
private String _last = null;

View File

@ -287,7 +287,7 @@ public abstract class AbstractExpressionBuilder {
Class cls = meta.getDescribedType();
throw parseException(EX_USER, "no-field",
new Object[] {field, cls.getSimpleName(),
StringDistance.getClosestLevenshteinDistance(field, all),
StringDistance.getClosestLevenshteinDistance(field, all),
cls.getName(), Arrays.toString(all)}, null);
}

View File

@ -1430,7 +1430,8 @@ public class JPQLExpressionBuilder
if (c != null) {
Value lit = factory.newTypeLiteral(c, Literal.TYPE_CLASS);
Class<?> candidate = getCandidateType();
ClassMetaData can = getClassMetaData(candidate.getName(), false);
ClassMetaData can = getClassMetaData(candidate.getName(),
false);
ClassMetaData meta = getClassMetaData(name, false);
if (candidate.isAssignableFrom(c))
lit.setMetaData(meta);
@ -1501,7 +1502,8 @@ public class JPQLExpressionBuilder
return getQualifiedPath(node, false, true);
}
private Value getQualifiedPath(JPQLNode node, boolean pcOnly, boolean inner) {
private Value getQualifiedPath(JPQLNode node, boolean pcOnly, boolean inner)
{
int nChild = node.getChildCount();
JPQLNode firstChild = firstChild(node);
JPQLNode id = firstChild.id == JJTKEY ? onlyChild(firstChild) :

View File

@ -756,7 +756,8 @@ public abstract class AbstractCFMetaDataFactory
(url));
List<String> newNames = Arrays.asList(clss);
if (log.isTraceEnabled())
log.trace(_loc.get("scan-found-names", newNames, rsrc));
log.trace(_loc.get("scan-found-names", newNames,
rsrc));
names.addAll(newNames);
mapPersistentTypeNames(url, clss);
}

View File

@ -1952,8 +1952,8 @@ public class ClassMetaData
if (f != null)
_useIdClassFromParent = false;
else
throw new MetaDataException(_loc.get("invalid-id",
_type, pks[0].getName()));
throw new MetaDataException(_loc.get(
"invalid-id", _type, pks[0].getName()));
}
}
}

View File

@ -1279,7 +1279,7 @@ public class MetaDataRepository
if (!mustExist)
return Collections.EMPTY_LIST;
else
throw new MetaDataException(_loc.get("eager-no-class-found"));
throw new MetaDataException(_loc.get("eager-no-class-found"));
}
// attempt to load classes so that they get processed
@ -1298,7 +1298,7 @@ public class MetaDataRepository
if (cls.isInterface())
getMetaData(cls, clsLoader, false);
} else if (cls == null && mustExist) {
throw new MetaDataException(_loc.get("eager-class-not-found",
throw new MetaDataException(_loc.get("eager-class-not-found",
className));
}
}

View File

@ -204,55 +204,55 @@ class ProxySetupStateManager
public void providedBooleanField(PersistenceCapable pc, int i, boolean b) {
throw new InternalException(_loc.get(
"unexpected_proxy_sm_attribute_type", pc.getClass().getName(),
"unexpected_proxy_sm_attribute_type", pc.getClass().getName(),
"boolean"));
}
public void providedCharField(PersistenceCapable pc, int i, char c) {
throw new InternalException(_loc.get(
"unexpected_proxy_sm_attribute_type", pc.getClass().getName(),
"unexpected_proxy_sm_attribute_type", pc.getClass().getName(),
"char"));
}
public void providedByteField(PersistenceCapable pc, int i, byte b) {
throw new InternalException(_loc.get(
"unexpected_proxy_sm_attribute_type", pc.getClass().getName(),
"unexpected_proxy_sm_attribute_type", pc.getClass().getName(),
"byte"));
}
public void providedShortField(PersistenceCapable pc, int i, short s) {
throw new InternalException(_loc.get(
"unexpected_proxy_sm_attribute_type", pc.getClass().getName(),
"unexpected_proxy_sm_attribute_type", pc.getClass().getName(),
"short"));
}
public void providedIntField(PersistenceCapable pc, int i, int i2) {
throw new InternalException(_loc.get(
"unexpected_proxy_sm_attribute_type", pc.getClass().getName(),
"unexpected_proxy_sm_attribute_type", pc.getClass().getName(),
"int"));
}
public void providedLongField(PersistenceCapable pc, int i, long l) {
throw new InternalException(_loc.get(
"unexpected_proxy_sm_attribute_type", pc.getClass().getName(),
"unexpected_proxy_sm_attribute_type", pc.getClass().getName(),
"long"));
}
public void providedFloatField(PersistenceCapable pc, int i, float f) {
throw new InternalException(_loc.get(
"unexpected_proxy_sm_attribute_type", pc.getClass().getName(),
"unexpected_proxy_sm_attribute_type", pc.getClass().getName(),
"float"));
}
public void providedDoubleField(PersistenceCapable pc, int i, double d) {
throw new InternalException(_loc.get(
"unexpected_proxy_sm_attribute_type", pc.getClass().getName(),
"unexpected_proxy_sm_attribute_type", pc.getClass().getName(),
"double"));
}
public void providedStringField(PersistenceCapable pc, int i, String s) {
throw new InternalException(_loc.get(
"unexpected_proxy_sm_attribute_type", pc.getClass().getName(),
"unexpected_proxy_sm_attribute_type", pc.getClass().getName(),
"String"));
}

View File

@ -287,7 +287,8 @@ public class ProxyCollections
public static Object afterRemove(ProxyCollection coll, int index,
Object removed) {
if (coll.getChangeTracker() != null)
((CollectionChangeTracker) coll.getChangeTracker()).removed(removed);
((CollectionChangeTracker) coll.getChangeTracker()).
removed(removed);
removed(coll, removed, false);
return removed;
}

View File

@ -515,7 +515,7 @@ public class ProxyManagerImpl
assertNotFinal(type);
Project project = new Project();
BCClass bc = AccessController.doPrivileged(J2DoPrivHelper
.loadProjectClassAction(project, getProxyClassName(type, runtime)));
.loadProjectClassAction(project, getProxyClassName(type, runtime)));
bc.setSuperclass(type);
bc.declareInterface(ProxyCollection.class);
@ -553,7 +553,7 @@ public class ProxyManagerImpl
assertNotFinal(type);
Project project = new Project();
BCClass bc = AccessController.doPrivileged(J2DoPrivHelper
.loadProjectClassAction(project, getProxyClassName(type, runtime)));
.loadProjectClassAction(project, getProxyClassName(type, runtime)));
bc.setSuperclass(type);
bc.declareInterface(ProxyMap.class);
@ -573,7 +573,7 @@ public class ProxyManagerImpl
assertNotFinal(type);
Project project = new Project();
BCClass bc = AccessController.doPrivileged(J2DoPrivHelper
.loadProjectClassAction(project, getProxyClassName(type, runtime)));
.loadProjectClassAction(project, getProxyClassName(type, runtime)));
bc.setSuperclass(type);
bc.declareInterface(ProxyDate.class);
@ -593,7 +593,7 @@ public class ProxyManagerImpl
assertNotFinal(type);
Project project = new Project();
BCClass bc = AccessController.doPrivileged(J2DoPrivHelper
.loadProjectClassAction(project, getProxyClassName(type, runtime)));
.loadProjectClassAction(project, getProxyClassName(type, runtime)));
bc.setSuperclass(type);
bc.declareInterface(ProxyCalendar.class);
@ -628,7 +628,7 @@ public class ProxyManagerImpl
Project project = new Project();
BCClass bc = AccessController.doPrivileged(J2DoPrivHelper
.loadProjectClassAction(project, getProxyClassName(type, runtime)));
.loadProjectClassAction(project, getProxyClassName(type, runtime)));
bc.setSuperclass(type);
bc.declareInterface(ProxyBean.class);

View File

@ -34,7 +34,8 @@ public class QueryException
private static final long serialVersionUID = 7375049808087780437L;
private static final transient Localizer _loc = Localizer.forPackage(QueryException.class);
private static final transient Localizer _loc =
Localizer.forPackage(QueryException.class);
private int timeout = -1;

View File

@ -481,18 +481,18 @@ public class Configurations {
if (!invalidEntries.isEmpty() && configurationName != null) {
Localizer.Message msg = null;
String first = (String) invalidEntries.keySet().iterator().next();
String first = (String) invalidEntries.keySet().iterator().next();
if (invalidEntries.keySet().size() == 1 &&
first.indexOf('.') == -1) {
// if there's just one misspelling and this is not a
// if there's just one misspelling and this is not a
// path traversal, check for near misses.
Collection<String> options = findOptionsFor(obj.getClass());
String close = StringDistance.getClosestLevenshteinDistance
Collection<String> options = findOptionsFor(obj.getClass());
String close = StringDistance.getClosestLevenshteinDistance
(first, options, 0.75f);
if (close != null)
msg = _loc.get("invalid-config-param-hint", new Object[]{
configurationName, obj.getClass(), first, close,
options, });
msg = _loc.get("invalid-config-param-hint", new Object[]{
configurationName, obj.getClass(), first, close,
options, });
}
if (msg == null) {

View File

@ -86,7 +86,8 @@ public class ObjectValue extends Value {
/**
* Instantiate the object as an instance of the given class.
*/
public Object instantiate(Class<?> type, Configuration conf, boolean fatal) {
public Object instantiate(Class<?> type, Configuration conf, boolean fatal)
{
throw new UnsupportedOperationException();
}

View File

@ -98,7 +98,8 @@ public class PluginValue extends ObjectValue {
/**
* Instantiate the plugin as an instance of the given class.
*/
public Object instantiate(Class<?> type, Configuration conf, boolean fatal) {
public Object instantiate(Class<?> type, Configuration conf, boolean fatal)
{
Object obj = newInstance(_name, type, conf, fatal);
Configurations.configureInstance(obj, conf, _props,
(fatal) ? getProperty() : null);

View File

@ -113,7 +113,8 @@ public interface ProductDerivation {
*
* @since 1.1.0
*/
public List<String> getAnchorsInFile(File file) throws IOException, Exception;
public List<String> getAnchorsInFile(File file) throws IOException,
Exception;
/**
* Return a List<String> of all the anchors defined in

View File

@ -94,7 +94,8 @@ public class ProductDerivations {
for (int i = 0; i < _derivationErrors.length; i++) {
if (_derivationErrors[i] == null)
continue;
System.err.println(_derivationNames[i] + ":" + _derivationErrors[i]);
System.err.println(_derivationNames[i] + ":" +
_derivationErrors[i]);
break;
}

View File

@ -219,7 +219,7 @@ public class DepthFirstAnalysis {
if (path != null && !edge.getFrom().equals(edge.getTo())) {
// Not a single edge loop
pos = findNodeInPath(edge.getTo(), path);
assert (pos >= 0): _loc.get("node-not-on-path", edge, edge.getTo());
assert (pos >= 0): _loc.get("node-not-on-path", edge, edge.getTo());
} else {
assert (edge.getFrom().equals(edge.getTo())):
_loc.get("edge-no-loop", edge).getMessage();

View File

@ -180,14 +180,16 @@ public class Edge {
}
/**
* List of edges forming a cycle. Only set for TYPE_BACK and TYPE_FORWARD edges.
* List of edges forming a cycle. Only set for TYPE_BACK and TYPE_FORWARD
* edges.
*/
public List getCycle() {
return _cycle;
}
/**
* List of edges forming a cycle. Only set for TYPE_BACK and TYPE_FORWARD edges.
* List of edges forming a cycle. Only set for TYPE_BACK and TYPE_FORWARD
* edges.
*/
public void setCycle(List cycle) {
_cycle = cycle;

View File

@ -788,7 +788,8 @@ public abstract class DelegatingCallableStatement
throw new UnsupportedOperationException();
}
public Object getObject(String a, Map<String, Class<?>>b) throws SQLException {
public Object getObject(String a, Map<String, Class<?>>b) throws
SQLException {
throw new UnsupportedOperationException();
}

View File

@ -595,7 +595,8 @@ public abstract class DelegatingResultSet implements ResultSet, Closeable {
return _stmnt;
}
public Object getObject(int a, Map<String, Class<?>> b) throws SQLException {
public Object getObject(int a, Map<String, Class<?>> b) throws
SQLException {
return _rs.getObject(a, b);
}
@ -615,7 +616,8 @@ public abstract class DelegatingResultSet implements ResultSet, Closeable {
return _rs.getArray(a);
}
public Object getObject(String a, Map<String, Class<?>> b) throws SQLException {
public Object getObject(String a, Map<String, Class<?>> b) throws
SQLException {
return _rs.getObject(a, b);
}

View File

@ -39,7 +39,8 @@ public class JDBCEventConnectionDecorator extends AbstractConcurrentEventManager
private static final Class<EventConnection> eventConnectionImpl;
private static final Class<EventStatement> eventStatementImpl;
private static final Class<EventPreparedStatement> eventPreparedStatementImpl;
private static final Class<EventPreparedStatement>
eventPreparedStatementImpl;
static {
try {
@ -250,7 +251,8 @@ public class JDBCEventConnectionDecorator extends AbstractConcurrentEventManager
/**
* Fires events as appropriate.
*/
protected abstract class EventPreparedStatement extends DelegatingPreparedStatement {
protected abstract class EventPreparedStatement extends
DelegatingPreparedStatement {
private final EventConnection _conn;
private final String _sql;

View File

@ -45,11 +45,16 @@ import java.util.Calendar;
import java.util.Iterator;
import java.util.List;
import org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.LoggingConnection.LoggingCallableStatement;
import org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.LoggingConnection.LoggingDatabaseMetaData;
import org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.LoggingConnection.LoggingPreparedStatement;
import org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.LoggingConnection.LoggingResultSet;
import org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.LoggingConnection.LoggingStatement;
import org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.LoggingConnection.
LoggingCallableStatement;
import org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.LoggingConnection.
LoggingDatabaseMetaData;
import org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.LoggingConnection.
LoggingPreparedStatement;
import org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.LoggingConnection.
LoggingResultSet;
import org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.LoggingConnection.
LoggingStatement;
import org.apache.openjpa.lib.log.Log;
import org.apache.openjpa.lib.util.ConcreteClassGenerator;
import org.apache.openjpa.lib.util.J2DoPrivHelper;
@ -1277,7 +1282,8 @@ public class LoggingConnectionDecorator implements ConnectionDecorator {
_paramBatch = new ArrayList<List<String>>();
// copy parameters since they will be re-used
if (_params != null) {
List<String> copyParms = new ArrayList<String>(_params);
List<String> copyParms =
new ArrayList<String>(_params);
_paramBatch.add(copyParms);
}
else

Some files were not shown because too many files have changed in this diff Show More