Is there any way to explicitly set which directory/package where Speedment will put generated code? By default it creates a path like "com.company.project.db0.myschema.mytable" but maybe I want something like "com.company.database".
The directory where source code is generated and the root package for a particular project are two different settings. Both can be configured either in the graphical tool or in the speedment.json-file.
Using the Tool
In the tool, select the root item in the "Node hierarchy" and deselect the "Auto" box to the right of "Package location" and "Package name". You can then enter the desired directory and package name here. You can also select a specific package name for each table by editing that node in the "Node hierarchy".
Without Using the Tool
If you don't want to use the tool, you can do the same changes directly in the speedment.json file. Locate the project and add/edit the following attributes:
"packageLocation" : "src/main/java/",
"packageName" : "com.company.database",