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