/quarkus-rest-api-starter

This is a small Quarkus Tryout Project.

Primary LanguageJava

My Quarkus Demo

Getting started with Quarkus

  1. Create your Quarkus Project (best to use the IntelliJ Plugin)

  2. Open a terminal (in IntelliJ), type ./mvnw clean compile quarkus:dev

  3. 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?

  1. mvn quarkus:list-extensions

  2. mvn quarkus:add-extension -Dextensions="groupId:artifactId"

Or look at this website: https://quarkus.io/extensions/

How to add the Quarkus Debugger?

  1. ./mvnw clean compile quarkus:dev in Terminal

  2. Set your breakpoint

  3. Press in top Bar on Run and Attach 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.

Good Resources for Quarkus-with-Panache

https://in.relation.to/2019/11/19/hibernate-orm-with-panache-in-quarkus/