I attached a sample spring boot+postgres project. I added "- List<@Moon> moons" to Planet entity, now
In Planet.java,
@ForeignKey(name = "FK_MOON_PLANET_PLANET", inverseName = "FK_MOON_PLANET_MOON")
shows jpa validation errors: Foreign key "{0}" not found in the table "{1}".
I think the problem is that Hibernate's JPA 2.0 @ForeignKey doesn't create the FK in the database, probably some hibernate bug they don't see a point in fixing, as this annotation is deprecated already. After changing this to JPA 2.1 compliant @ForeignKey everything works as it should, the keys are created and found, but I would have to do it manually in all generated entities after each generate-sources.
Maybe there should be sculptor-generator.properties setting for JPA level? For now it would help greatly even if the only thing it did was to change the @ForeignKey template.
With JPA 2.2 coming soon and provider support that will surely lag behind, this branching is pretty much inevitable anyway.