My Quarkus Demo
Getting started with Quarkus
-
Create your Quarkus Project (best to use the IntelliJ Plugin)
-
Open a terminal (in IntelliJ), type
./mvnw clean compile quarkus:dev
-
To try this out open another terminal and type
curl -w "\n" http://localhost:8080/<YOUR-PATH>;
Important
|
If you use Linux, and get a permission denied error after one of the above commands use this: chomd +x mvnw
|
Or go to this website: https://quarkus.io/guides/getting-started
Forgot to add an extension?
-
mvn quarkus:list-extensions
-
mvn quarkus:add-extension -Dextensions="groupId:artifactId"
Or look at this website: https://quarkus.io/extensions/
How to add the Quarkus Debugger?
-
in Terminal./mvnw clean compile quarkus:dev
-
Set your breakpoint
-
Press in top Bar on
Run
andAttach to Process…
How to fix datasource Error?
-
Add the right application.properties:
# datasource configuration
quarkus.datasource.url = jdbc:derby://localhost:1527/derbydb
quarkus.datasource.driver = org.apache.derby.jdbc.ClientDriver
quarkus.datasource.username = admin
quarkus.datasource.password = passme
# drop and create the database at startup (use `update` to only update the schema)
quarkus.hibernate-orm.database.generation=drop-and-create
Where do I get the Logger from?
Look at the website: https://quarkus.io/guides/lifecycle
Why is there no Id in the entity?
Instead of an Id you add this to your class: extends PanacheEntity
Note
|
To do this, you need the Quarkus Extension io.quarkus:quarkus-hibernate-orm-panache
|
How works this findAll, findById, find("name"), without named Querys ?
This is the power of panache! :D
You need to implement this into your DAO implements PanacheRepository<Person>
Panache has all kind of pre-coded stuff in it, so just use it. I do not know how to see a list of all right now, but I will add it soon.