-
Notifications
You must be signed in to change notification settings - Fork 1
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
Source code generator #1
Comments
https://thorben-janssen.com/result-set-mapping-basics/ It'd be cool if you can just do the database calls directly from the frontend and have all the backend Java stuff generated for you. The tough part is that it needs to be user-extensible. Aka the user should still be able to write their own backend code and it should be neatly integrated into the autogenerated code. |
let artist = Entity("artist")
.id()
.column(name, StringType)
.colum(fanOf, () => OptionalType(artist))
let db=Database({artist: artist, cat: cat, ..})
let query = db.select("artist").where(builder => "ID = 6 haha hardcoding a where").pagination()
let query2 = db.withInputs({id: NumberType}).select("artist").where(b => b.equals(b.table.artist.id, b.input.id))
let artistAndCountry = Entity(..)
column name string
column country string
let query3 = db.select(artistAndCountry).from(artist)...
let artistLayers = Layers({ entity: artist, queries: { getSix: query, byId: query2 } })
artistLayers.service.byId.custom()
let generated = Generator({ database })
.addLayers(artistLayers)
generated.write()
// Create table
// Entity class
// Endpoint with get for selects
// Dto for selects
// Service that forwards the calls, custom means it writes the code and wraps it in a comment that includes a stable ID...
// JPA query
Missing:
- auth
- validation, can be replaced with .custom() or .extensionPoint()
- transactions https://stackoverflow.com/questions/26200324/how-to-rollback-transaction-in-jpa
- @Lock(LockModeType.PESSIMISTIC_WRITE)
- complex queries, like a search query with optional filters, recursive queries, can be replaced with .custom() or .extensionPoint()
- imports, can be replaced with .custom() or .extensionPoint()
- https://github.com/Blazebit/blaze-persistence#core-quick-start |
https://codebase.show/projects/realworld?category=backend&language=java has example projects |
Entity Graph |
Goals
https://github.com/forge/roaster
The text was updated successfully, but these errors were encountered: