Skip to content
Advertisement

Tag: hibernate

Panache with MongoDB find distinct

I have documents with “tags” arrays as properties. Now I want to query all distinct tag-items. Solution in mongo shell: which gives me: But how can I achieve the same result with Panache? The PanacheMongoEntity does not offer a specific distinct method. Nor do i know how to use the find method to achieve my goal or if it even

How should I persist a PanacheEntity with data coming from a Websocket message?

I’m trying to persist the following entity when receiving a message from the client via Websocket: The following persist works, when receiving a POST request: However, the following code freezes when it reaches the persist line. The message.getPenguin() method is returning an actual Penguin reference (the MessageDecoder.class is doing it’s part): I’m new to Panache/Hibernate, any help would be apreciated,

Create and use database function with JPA

I want to create and immediatly use a database function in a single sql call. As an example, the following works fine in PostgreSQL SQL Editor : But when i try to use it with JPA : I get the following error : How could i make this work ? Answer You’re trying to execute two queries at once. You

printing TypedQuery in console

How to sysout the TypedQuery in eclipse console. Am trying with .toString() and its not working Please find my java code below. Answer You need to enable logging for the the following categories: So a log4j configuration could look like: The first is equivalent to hibernate.show_sql=true legacy property, the second prints the bound parameters among other things. Another solution (non

Advertisement