Speedment is a Java Stream ORM toolkit and runtime. The toolkit analyzes the metadata of an existing SQL database and automatically creates a Java representation of the data model. This powerful ORM enables you to create scalable and efficient Java applications using standard Java Streams with no need to type SQL or use any new API.
Speedment was originally developed by researchers and engineers based in Palo Alto with the purpose to simplify and streamline the development of Java database applications by leveraging the Java Stream API.SQL |
JAVA STREAM |
---|---|
Speedment leverages the Stream API to enable database querying using lamdas without a single line of SQL. A custom delegator is used to optimize the resulting SQL queries for reduced database load, latency, and network load. The examples below illustrate the expressiveness of the stream queries.
FilmApplication app = new FilmApplicationBuilder()
.withPassword("...") // Needs to match the database
.build();
// FilmManager represents a table with films and is generated automatically
FilmManager films = app.getOrThrow(FilmManager.class);
// Searches are optimized in the background!
Optional<Film> longFilm = films.stream()
.filter(Film.LENGTH.greaterThan(120))
.findAny();
Join<Tuple2<Film, Language>> join = joinComponent
.from(FilmManager.IDENTIFIER)
.innerJoinOn(Language.LANGUAGE_ID).equal(Film.LANGUAGE_ID)
.build(Tuples::of);