Speedment is intended to be used to generate Java code from an existing database, but if you also want to generate the database, we recommend using a database migration tool like Flyway.
Yes! Here is a good tutorial to get started with Speedment and Spring. There is also an Enterprise Plugin for Spring that makes it possible to generate a complete REST API with custom query parameters directly from a database.
Speedment works differently from JPA. Instead of using annotations to model a database, Speedment generates the model classes from the database metadata. Speedment is also built from the bottom-up to use the Java 8 APIs which was not available when JPA was introduced. You could argue that Speedment is a more modern way to write object-oriented database code in Java.
Yes, you can attach a logger to the Speedment application builder to see what queries are being generated. More info on how to do that here.
You need to wrap your stream in a transaction handler. You can see examples on how to do this in the Speedment User Guide.
Since Speedment uses the Java Stream API to query a database, JOINs have to be done using on of the following ways: Using a .map()- or .flatMap()-operation on the stream; at generation time using the enterprise feature Virtual Columns or using the JoinComponent. All three methods are described in detail here.
Speedment stores all the information about the database structure in a file called speedment.json that is located in your src/main/json/ folder. This file can be edited either using the Speedment Tool or manually using a regular text editor.
Yes, open the Speedment tool and right-click on the schema node in the tree. There you can both collapse all and disable all. You can then enable the tables you actually want by selecting them and ticking the Enabled checkbox.
In the Speedment tool you can select a TypeMapper to control what Java class will be used for a particular column. If you want a very specific type that is not built into Speedment, you can create your own TypeMapper using a plugin.
Class files named something with GeneratedXXX.java are replaced each time you run the Speedment code generator. These are typically overridden by a short placeholder file without the Generated-prefix. Custom changes should be made there. You can also change the code generation pipeline using plugins if you want greater control over how the generated classes are created. Here is an article which describes how that is done.
Speedment Stream queries the database just like any ORM so there is nothing strange. Speedment HyperStream on the other hand stores a copy of the relevant data in-memory. That view of the data can be updated asynchronously in the background, either programmatically or using a timer, to get eventual consistency.
After making changes in the database schema, simply relaunch the Speedment tool and click Reload or run
mvn speedment:reload from the command-line to update the configuration file. To then trigger a new code generation, either press the Generate-button or run
mvn speedment:generate. You can even automate this process in Maven if you update your database often.
There are several license types available, of which two are free to use. These are: Speedment Open Source - Speedment Java Stream ORM for Open Source databases available on Github and licensed under Apache 2.0. Speedment Stream - a commercial license which also includes enterprise database connectors for Oracle, SQL Server, AS400 and DB2, enterprise plugins and support. Speedment HyperStream - a commercial license which is beyond the capabilities of Stream also includes DataStore which accelerates data access by orders of magnitude. Speedment Free - a free license which is perfect to get familiar with all features of Speedment HyperStream for databases up to 500 MB. For commercial license inquiries, please Contact Sales.