Skip to content
Advertisement

Tag: hibernate

Spring Find by unique properties

Given 1 relational table Doctor_ID Client_ID 2 2 2 3 2 4 3 5 4 2 4 3 And I want all the occurrences where client_id is not equals to 3, ignoring the same doctor_id. In this example, I would only get the 4th row… Doctor_ID Client_ID 3 5 How could I achieve something like that? Answer This query with

How to check UUID null value in JPQL?

I am using JPA/Hibernate. So I wanna to do nullCheck in JPQL, but when I do that it does not determine dataType. JPQL Query: EXCEPTION: Caused by: org.postgresql.util.PSQLException: ERROR: could not determine data type of parameter $1 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2532) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2267) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:312) at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:448) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:369) at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:153) at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:103) at jdk.internal.reflect.GeneratedMethodAccessor582.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.apache.tomcat.jdbc.pool.StatementFacade$StatementProxy.invoke(StatementFacade.java:114)

Getting errors in getting collection for ManyToMany JPA+Hibernate

I have two classes. A film that keeps authors in it. And the author himself. I want to make the connection ManyToMany for them using EntityManager, where then I can get the data for Set. Class movie: Class author: Method, where i add authors for movie and push to database: Get movie with authors: But i get more exceptions: What

Execute sql native query from two entity using jpa or hibernate

I have 2 tables, salesOrder with column “id”, “customerId”, “textReview(boolean)” and table SalesOrderline with column “salesOrderId”, “productId”. i want to change boolean data in textReview column. I got data from the client in the form is customerId and productId. Native Query SQL that I made like this. update sales order set text_review = true where (select id from salesorder where

Hibernate Native SQL returns some nulls instead of partially filled objects

I have the following (postgress) SQL Query: And what it does is it creates a series of 6 hours per day and takes averages from it. A result may look like this: variable_id date_time sample_count sample_period_ms min_value max_value value 15 2021-06-06 06:00:00 120 59577 -1.4960686 1.1995025 0.30439844254136744 15 2021-06-06 12:00:00 120 59577 -1.4887594 1.1997863 0.30570657099738263 15 2021-06-06 18:00:00 120 59577

Advertisement