Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing spaces in the super powers #22

Closed
cescoffier opened this issue Feb 5, 2022 · 7 comments · Fixed by #24
Closed

Missing spaces in the super powers #22

cescoffier opened this issue Feb 5, 2022 · 7 comments · Fixed by #24

Comments

@cescoffier
Copy link
Member

The imports.sql had an import issue. The superpowers are missing some spaces.
For example: WillInvisibilityLongevityMaster. It should be "Will Invisibility Longevity Master"

@edeandrea
Copy link
Collaborator

@cescoffier
Copy link
Member Author

Yeah, I would need to regenerate these files too.

@edeandrea
Copy link
Collaborator

I notice there are some json files as well in that repo you have. Do those json files contain all the same records? It looks like it uses an array of strings and the powers have spaces in them.

If so, I bet I could write a quick script which re-generates the sql files from that.

@edeandrea
Copy link
Collaborator

Maybe this is also a good opportunity to separate the persistence model from the view model and use Mapstruct in between?

Maybe the persistence model stores the powers as a List<String> and the view model just uses String?

@edeandrea
Copy link
Collaborator

edeandrea commented Feb 5, 2022

@cescoffier How's this?

https://raw.githubusercontent.com/quarkusio/quarkus-super-heroes/characterdata/all-heroes.sql

https://raw.githubusercontent.com/quarkusio/quarkus-super-heroes/characterdata/all-villains.sql

I pulled in the json files in your repo into the characterdata branch and then I created a script which generates the SQL files from the json files: https://raw.githubusercontent.com/quarkusio/quarkus-super-heroes/characterdata/generate-sql-from-json.groovy (things like this are VERY trivial in Groovy!)

It can be run like groovy generate-sql-from-json.groovy all-heroes.json all-heroes.sql hero (for Heroes) and groovy generate-sql-from-json.groovy all-villains.json all-villains.sql villain (for Villains).

If this looks good to you I'll move it into the main branch and re-run my script which randomly grabs 100 of each

@cescoffier
Copy link
Member Author

Looks great! What about using JBang instead of Groovy? It will make @maxandersen happy.

@edeandrea
Copy link
Collaborator

Java is so over-complicated when it comes to things like this :) You see how simple it is in Groovy since dealing with structured data is part of the language itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants