Drive-by: Depot provides a CountRecord.
This commit is contained in:
@@ -19,6 +19,7 @@ import com.google.common.collect.Lists;
|
|||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import com.google.inject.Singleton;
|
import com.google.inject.Singleton;
|
||||||
|
import com.samskivert.depot.CountRecord;
|
||||||
import com.samskivert.depot.DepotRepository;
|
import com.samskivert.depot.DepotRepository;
|
||||||
import com.samskivert.depot.DuplicateKeyException;
|
import com.samskivert.depot.DuplicateKeyException;
|
||||||
import com.samskivert.depot.Funcs;
|
import com.samskivert.depot.Funcs;
|
||||||
@@ -82,14 +83,6 @@ public class DepotUserRepository extends DepotRepository
|
|||||||
DEADBEAT;
|
DEADBEAT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Computed @Entity
|
|
||||||
public static class CountRecord extends PersistentRecord
|
|
||||||
{
|
|
||||||
/** The computed count. */
|
|
||||||
@Computed(fieldDefinition="count(*)")
|
|
||||||
public int count;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Inject public DepotUserRepository (PersistenceContext ctx)
|
@Inject public DepotUserRepository (PersistenceContext ctx)
|
||||||
{
|
{
|
||||||
super(ctx);
|
super(ctx);
|
||||||
|
|||||||
Reference in New Issue
Block a user