Overrides, from David Hoover (belatedly): 'Also nukes trailing whitespace, foreaches a couple loops and varags one thing that leapt out at me while i was skimming it.'
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -105,7 +105,7 @@ public abstract class DepotRepository
|
||||
* in the first pass. This makes it much more efficient, but also less reliable because
|
||||
* there is no invalidation of the keyset query: If records are inserted, deleted or
|
||||
* modified, cached keysets will not be updated.
|
||||
*
|
||||
*
|
||||
* Keysets cached using this strategy may have a long time-to-live.
|
||||
*
|
||||
* Note: This strategy may not be used on @Computed records, for records that do not in
|
||||
@@ -411,7 +411,7 @@ public abstract class DepotRepository
|
||||
switch(cache) {
|
||||
case SHORT_KEYS: case LONG_KEYS: case RECORDS:
|
||||
return _ctx.invoke(new FindAllQuery.WithCache<T>(_ctx, type, clauses, cache));
|
||||
|
||||
|
||||
default:
|
||||
return _ctx.invoke(new FindAllQuery.Explicitly<T>(
|
||||
_ctx, type, clauses, cache == CacheStrategy.CONTENTS));
|
||||
@@ -693,7 +693,7 @@ public abstract class DepotRepository
|
||||
"Field identifier #" + (ii+1) + " is neither String nor ColumnExp");
|
||||
}
|
||||
idx ++;
|
||||
|
||||
|
||||
if (fieldsValues[idx] instanceof SQLExpression) {
|
||||
values[ii] = (SQLExpression) fieldsValues[idx];
|
||||
} else {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
@@ -174,6 +174,7 @@ public class Key<T extends PersistentRecord> extends WhereClause
|
||||
}
|
||||
|
||||
// from WhereClause
|
||||
@Override
|
||||
public SQLExpression getWhereExpression ()
|
||||
{
|
||||
return new Expression<T>(_pClass, _values);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
@@ -30,6 +30,7 @@ import java.util.Iterator;
|
||||
import com.google.common.collect.Iterators;
|
||||
import com.google.common.base.Function;
|
||||
|
||||
import com.samskivert.util.Logger;
|
||||
import com.samskivert.util.StringUtil;
|
||||
|
||||
import com.samskivert.depot.clause.WhereClause;
|
||||
@@ -127,8 +128,7 @@ public abstract class KeySet<T extends PersistentRecord> extends WhereClause
|
||||
super(pClass);
|
||||
}
|
||||
|
||||
// from WhereClause
|
||||
public SQLExpression getWhereExpression () {
|
||||
@Override public SQLExpression getWhereExpression () {
|
||||
return new LiteralExp("(1 = 0)");
|
||||
}
|
||||
|
||||
@@ -169,8 +169,7 @@ public abstract class KeySet<T extends PersistentRecord> extends WhereClause
|
||||
_keys = keys;
|
||||
}
|
||||
|
||||
// from WhereClause
|
||||
public SQLExpression getWhereExpression () {
|
||||
@Override public SQLExpression getWhereExpression () {
|
||||
// Single-column keys result in the compact IN(keyVal1, keyVal2, ...)
|
||||
ColumnExp column = new ColumnExp(_pClass, DepotUtil.getKeyFields(_pClass)[0]);
|
||||
return new Conditionals.In(column, _keys);
|
||||
@@ -220,8 +219,7 @@ public abstract class KeySet<T extends PersistentRecord> extends WhereClause
|
||||
_keys = keys;
|
||||
}
|
||||
|
||||
// from WhereClause
|
||||
public SQLExpression getWhereExpression () {
|
||||
@Override public SQLExpression getWhereExpression () {
|
||||
// Multi-column keys result in OR'd AND's, of unknown efficiency (TODO check).
|
||||
SQLExpression[] keyexps = new SQLExpression[_keys.length];
|
||||
int ii = 0;
|
||||
@@ -273,10 +271,10 @@ public abstract class KeySet<T extends PersistentRecord> extends WhereClause
|
||||
public Collection<Key<T>> toCollection ()
|
||||
{
|
||||
return new AbstractCollection<Key<T>>() {
|
||||
public Iterator<Key<T>> iterator () {
|
||||
@Override public Iterator<Key<T>> iterator () {
|
||||
return KeySet.this.iterator();
|
||||
}
|
||||
public int size () {
|
||||
@Override public int size () {
|
||||
return KeySet.this.size();
|
||||
}
|
||||
};
|
||||
@@ -310,9 +308,9 @@ public abstract class KeySet<T extends PersistentRecord> extends WhereClause
|
||||
public void validateFlushType (Class<?> pClass)
|
||||
{
|
||||
if (!pClass.equals(_pClass)) {
|
||||
throw new IllegalArgumentException(
|
||||
"Class mismatch between persistent record and cache invalidator " +
|
||||
"[record=" + pClass.getSimpleName() + ", invtype=" + _pClass.getSimpleName() + "].");
|
||||
throw new IllegalArgumentException(Logger.format(
|
||||
"Class mismatch between persistent record and cache invalidator",
|
||||
"record", pClass.getSimpleName(), "invtype", _pClass.getSimpleName()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
@@ -218,7 +218,7 @@ public abstract class SchemaMigration extends Modifier
|
||||
super(targetVersion);
|
||||
_ixName = ixName;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
|
||||
String fullIxName = _tableName + "_" + _ixName;
|
||||
@@ -231,7 +231,7 @@ public abstract class SchemaMigration extends Modifier
|
||||
liaison.dropIndex(conn, _tableName, fullIxName);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
protected String _ixName;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
@@ -38,7 +38,7 @@ public @interface FullTextIndex
|
||||
/** For English text search; does basic stemming. */
|
||||
English
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* An identifier for this index, unique with the scope of the record.
|
||||
*/
|
||||
@@ -48,7 +48,7 @@ public @interface FullTextIndex
|
||||
* An array of the field names that should be indexed.
|
||||
*/
|
||||
public String[] fields ();
|
||||
|
||||
|
||||
/**
|
||||
* What parser/dictionary to use for this index.
|
||||
*/
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
@@ -66,7 +66,7 @@ public class Where extends WhereClause
|
||||
_condition = condition;
|
||||
}
|
||||
|
||||
// from WhereClause
|
||||
@Override // from WhereClause
|
||||
public SQLExpression getWhereExpression ()
|
||||
{
|
||||
return _condition;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
@@ -50,8 +50,8 @@ public class FunctionExp implements SQLExpression
|
||||
// from SQLExpression
|
||||
public void addClasses (Collection<Class<? extends PersistentRecord>> classSet)
|
||||
{
|
||||
for (int ii = 0; ii < _arguments.length; ii ++) {
|
||||
_arguments[ii].addClasses(classSet);
|
||||
for (SQLExpression _argument : _arguments) {
|
||||
_argument.addClasses(classSet);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,6 +65,7 @@ public class FunctionExp implements SQLExpression
|
||||
return _arguments;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString ()
|
||||
{
|
||||
return _function + "(" + StringUtil.join(_arguments, ", ") + ")";
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
@@ -53,6 +53,7 @@ public class LiteralExp
|
||||
return _text;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString ()
|
||||
{
|
||||
return _text;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
@@ -38,7 +38,7 @@ public interface SQLExpression
|
||||
_reason = reason;
|
||||
}
|
||||
|
||||
public String toString () {
|
||||
@Override public String toString () {
|
||||
return "[unknown value, reason=" + _reason + "]";
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -498,18 +498,18 @@ public class DepotMarshaller<T extends PersistentRecord>
|
||||
if (getTableName() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// figure out the list of fields that correspond to actual table columns and generate the
|
||||
// SQL used to create and migrate our table (unless we're a computed entity)
|
||||
_columnFields = new String[_allFields.length];
|
||||
ColumnDefinition[] declarations = new ColumnDefinition[_allFields.length];
|
||||
int jj = 0;
|
||||
for (int ii = 0; ii < _allFields.length; ii++) {
|
||||
FieldMarshaller<?> fm = _fields.get(_allFields[ii]);
|
||||
for (String field : _allFields) {
|
||||
FieldMarshaller<?> fm = _fields.get(field);
|
||||
// include all persistent non-computed fields
|
||||
ColumnDefinition colDef = fm.getColumnDefinition();
|
||||
if (colDef != null) {
|
||||
_columnFields[jj] = _allFields[ii];
|
||||
_columnFields[jj] = field;
|
||||
declarations[jj] = colDef;
|
||||
jj ++;
|
||||
}
|
||||
@@ -537,7 +537,7 @@ public class DepotMarshaller<T extends PersistentRecord>
|
||||
return 0;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// fetch all relevant information regarding our table from the database
|
||||
TableMetaData metaData = TableMetaData.load(ctx, getTableName());
|
||||
|
||||
@@ -547,6 +547,7 @@ public class DepotMarshaller<T extends PersistentRecord>
|
||||
log.info("Creating initial version record for " + _pClass.getName() + ".");
|
||||
// if not, create a version entry with version zero
|
||||
ctx.invoke(new SimpleModifier() {
|
||||
@Override
|
||||
protected int invoke (DatabaseLiaison liaison, Statement stmt) throws SQLException {
|
||||
try {
|
||||
return stmt.executeUpdate(
|
||||
@@ -605,6 +606,7 @@ public class DepotMarshaller<T extends PersistentRecord>
|
||||
|
||||
// and update our version in the schema version table
|
||||
ctx.invoke(new SimpleModifier() {
|
||||
@Override
|
||||
protected int invoke (DatabaseLiaison liaison, Statement stmt) throws SQLException {
|
||||
return stmt.executeUpdate(
|
||||
"update " + liaison.tableSQL(SCHEMA_VERSION_TABLE) +
|
||||
@@ -1035,6 +1037,7 @@ public class DepotMarshaller<T extends PersistentRecord>
|
||||
// server to whom we would talk if we were doing a modification (ie. the master, not a
|
||||
// read-only slave)
|
||||
protected class ReadVersion extends SimpleModifier {
|
||||
@Override
|
||||
protected int invoke (DatabaseLiaison liaison, Statement stmt) throws SQLException {
|
||||
ResultSet rs = stmt.executeQuery(
|
||||
" select " + liaison.columnSQL(V_COLUMN) +
|
||||
@@ -1049,6 +1052,7 @@ public class DepotMarshaller<T extends PersistentRecord>
|
||||
_newMigratingVersion = newMigratingVersion;
|
||||
_guardVersion = guardVersion;
|
||||
}
|
||||
@Override
|
||||
protected int invoke (DatabaseLiaison liaison, Statement stmt) throws SQLException {
|
||||
return stmt.executeUpdate(
|
||||
"update " + liaison.tableSQL(SCHEMA_VERSION_TABLE) +
|
||||
@@ -1120,7 +1124,8 @@ public class DepotMarshaller<T extends PersistentRecord>
|
||||
pkColumns.add(rs.getString("COLUMN_NAME"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString ()
|
||||
{
|
||||
return StringUtil.fieldsToString(this);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
@@ -409,7 +409,7 @@ public abstract class FieldMarshaller<T>
|
||||
ByteBuffer bbuf = ByteBuffer.allocate(values.length * 4);
|
||||
bbuf.asIntBuffer().put(values);
|
||||
return bbuf.array();
|
||||
|
||||
|
||||
}
|
||||
@Override public byte[] getFromSet (ResultSet rs)
|
||||
throws SQLException {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -91,11 +91,11 @@ public abstract class FindAllQuery<T extends PersistentRecord> extends Query<Lis
|
||||
_category = (strategy == CacheStrategy.SHORT_KEYS) ?
|
||||
CacheCategory.SHORT_KEYSET : CacheCategory.LONG_KEYSET;
|
||||
break;
|
||||
|
||||
|
||||
case RECORDS:
|
||||
_qkey = null;
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
throw new IllegalArgumentException("Unexpected cache strategy: " + strategy);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -102,6 +102,7 @@ public class HSQLBuilder
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Void visit (MultiOperator operator)
|
||||
{
|
||||
String op;
|
||||
@@ -129,6 +130,7 @@ public class HSQLBuilder
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Void visit (EpochSeconds epochSeconds)
|
||||
{
|
||||
_builder.append("datediff('ss', ");
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -92,6 +92,7 @@ public class MySQLBuilder
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Void visit (EpochSeconds epochSeconds)
|
||||
{
|
||||
_builder.append("unix_timestamp(");
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Depot library - a Java relational persistence library
|
||||
// Copyright (C) 2006-2008 Michael Bayne and Pär Winzell
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
|
||||
@@ -51,7 +51,8 @@ public class TestRepository extends DepotRepository
|
||||
{
|
||||
public int recordId;
|
||||
public String name;
|
||||
public String toString () {
|
||||
|
||||
@Override public String toString () {
|
||||
return recordId + ":" + name;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user