44a8fccc86ba364fa1d4c4b631014c0c8376cf7a
various query clauses.
Something like this:
MaxPointsRecord max = load(MaxPointsRecord.class,
new FromOverride(DailyScoreRecord.class),
new Where(DailyScoreRecord.KEY.eq(key)));
List<DailyLeaderRecord> top = findAll(DailyLeaderRecord.class,
new FromOverride(DailyScoreRecord.class),
DailyScoreRecord.KNIGHT_ID.join(KnightRecord.KNIGHT_ID),
new Where(Ops.and(DailyScoreRecord.KEY.eq(key),
DailyScoreRecord.POINTS.eq(max.maxPoints))));
becomes this:
MaxPointsRecord max = load(MaxPointsRecord.class,
from(DailyScoreRecord.class),
where(DailyScoreRecord.KEY.eq(key)));
List<DailyLeaderRecord> top = findAll(DailyLeaderRecord.class,
from(DailyScoreRecord.class),
join(DailyScoreRecord.KNIGHT_ID, KnightRecord.KNIGHT_ID),
where(DailyScoreRecord.KEY.eq(key),
DailyScoreRecord.POINTS.eq(max.maxPoints)));
and the imports for Where and FromOverride go away. It's a modest improvement
in readability.
Both COL.join(OCOL) and join(COL, OCOL) are supported; one can choose based on
the aesthetic demands of an individual query.
Depot Persistence Library ------------------------- Depot is a relational persistence library for Java. It is an ORM library, but has aims that are somewhat different from the popular "managed" persistence libraries like Hibernate and others. Website ------- See the Depot website for documentation and other info: http://code.google.com/p/depot/ Building -------- The library is built using ant. It can be found here: http://jakarta.apache.org/ant/ If you use build-ivy.xml to build, the necessary dependencies will be automatically fetched by Ivy (which will itself be downloaded if needed). To compile the code and generate a jar file, invoke: % ant -f build-ivy.xml dist Invoke 'ant -f build-ivy.xml -p' to see information on other build targets. Depot also provides .classpath and .project files for Eclipse users which require that you set an EXT_LIBS_DIR variable indicating the location of the external jar dependencies. The Depot Eclipse project also depends on the Eclipse project for the samskivert library. That library can be found at: http://code.google.com/p/samskivert/ License and Distribution ------------------------ Depot is released under the LGPL. This means you are free to use Depot on any project, open source or proprietary, but that any modifications made to the library must be made available to the maintainers. See COPYING for more detailed information. The most recent version of the Depot source code is available at the website listed above. $Id$
Description
Languages
Java
95.6%
Shell
4.3%