Questions tagged [quarkus-panache]

For questions relating to the Quarkus Panache library, which supports the implementation of Hibernate ORM solutions.

Panache is a library which aims to streamline the implementation of Hibernate ORM (object-relational-mapping) entities. Panache is a part of Quarkus.

Quickstart project: Quarkus demo: Hibernate ORM with Panache and RESTEasy.

Further reading: Quarkus - Simplified Hibernate ORM with Panache.

325 questions
8
votes
3 answers

How to select only certain fields with Quarkus Panache?

Quarkus simplifies Hibernate ORM mappings with Panache. Here is an example of my entity and PanacheRepository: @Entity public class Person { @Id @GeneratedValue private Long id; private String firstName; private String lastName; …
ikos23
  • 4,879
  • 10
  • 41
  • 60
7
votes
1 answer

Update entity data using Quarkus and PanacheRepository is not working

I'm doing some tests with Quarkus and PanacheRepository and I'm getting trouble in update an entity data. The update doesn't work, the field values are not updated. In short: I create an entity and persist the data, after that in another request I…
Isabel Tiburski
  • 113
  • 1
  • 1
  • 7
6
votes
1 answer

Booting an Hibernate Reactive serviceregistry on a non-reactive RecordedState

I'm trying to migrate to the Quarkus Hibernate Reactive dependencies, so I commented out the old ones and added the new reactive dependencies: //implementation 'io.quarkus:quarkus-agroal' //implementation…
Marian Klühspies
  • 15,824
  • 16
  • 93
  • 136
6
votes
1 answer

How to use different datasources for read and write queries in Quarkus?

I need to separate reader/writer PostgreSQL instances. I have one write replica and several read replicas. Quarkus supports adding multiple data sources, however it is not clear how to make Panache/Hibernate pick the right one for different…
Sasha Shpota
  • 9,436
  • 14
  • 75
  • 148
6
votes
2 answers

How to build a query with Panache which depends on optional fields?

Let's say I have the following database entity: Customer - firstname - lastname - status (active | inactive) - email And the following (simplified) Java method: getCustomers (String firstname, String lastname, String status, String email) {...} If…
StSch
  • 377
  • 1
  • 4
  • 12
6
votes
1 answer

Complex mongodb query with Quarkus

I need to migrate a Spring Boot project to Quarkus. The project has been using Spring Data Mongodb for all the queries. Now I find it difficult to migrate complex queries. One example is public List findInProgressData(MyConditions…
4
votes
0 answers

How can I update my entity inside a @PreRemove annotated method before it is deleted?

I would like to update my entity before it gets deleted (because a DB Trigger will use that value later). So I tried this inside my EntityListener: @PreRemove void onRemove(Object entity) { CurrentUser currentUser =…
Tim
  • 3,910
  • 8
  • 45
  • 80
4
votes
0 answers

How to get attribute value from jsonb in postgresql using Panache and Hibernate?

I use quarkus-spring-data-jpa extension, but since native queries are not supported, I can't execute a query similar to this select * from test_table where test_json->>'FirstValue' = :value. I have not found how to do this using only JPQL. How can I…
AAA
  • 51
  • 1
4
votes
2 answers

How do you achieve Integration tests in Quarkus without @DirtiesContext?

With Spring Boot, I use @DirtiesContext to ensure the database is cleared before each test case. There is no @DirtiesContext annotation with Quarkus AFAIK. Instead @TestTransaction is suggested. This way the changes made by the test case are rolled…
Billy Billy
  • 423
  • 4
  • 14
4
votes
1 answer

Quarkus/Hiberante relationship between 2 tables

I try create a simple web application with database. My database has only 2 columns : CREATE TABLE IF NOT EXISTS `Board` ( `BoardID` Integer NOT NULL AUTO_INCREMENT, `Title` Varchar(255), `Position` Integer NOT NULL, PRIMARY KEY…
Logan_on
  • 117
  • 4
  • 11
4
votes
0 answers

Multiple Datasource with Micronautor or Quarkus

I want to migrate to Micronaut or Quarkus from Spring Boot, but in Spring boot there is one feature as AbstractRoutingDataSource, which in runtime change datasouce. Is there anything similar or any mechanism in micronaut or quarkus which gives…
Bohdan Myslyvchuk
  • 1,657
  • 3
  • 24
  • 39
3
votes
1 answer

Is it possible to join two entities with panache?

I want to get two values from two different sql tables. In sql we would do "Select a.value, b.value from A a inner join B b on a.id = b.id where ..." Is it possible to do it with panache? Like join two entities or something like that? Can't really…
3
votes
1 answer

LazyInitializationException in Hibernate Reactive with Quarkus (Panache)

I have three entities: Interview, Question and Answer. Interview can have many Questions (and vice versa, many-to-many), Question can have many Answers (one-to-many). I persist and fetch entities in the following…
E. Dn
  • 940
  • 1
  • 9
  • 21
3
votes
1 answer

How to do a partial search in Hibernate Panache

I'm trying to do a partial search using Hibernate Panache. I'm building a backend using Quarkus and Kotlin. Now when my frontend gives me a search string I'd like to return all partial results. I have the following query: repository.find("firstName…
rjjdv
  • 339
  • 1
  • 3
  • 12
3
votes
0 answers

Quarkus Reactive throws "Session is currently connecting to database"

I'm running into a problem with Quarkus Reactive when running load tests. It seems connections aren't freed up fast enough. The endpoint basically does a database lookup by a received code, and then stores a new event with the entity as a…
Marian Klühspies
  • 15,824
  • 16
  • 93
  • 136
1
2 3
21 22