I’m having some issues with HQL since I’m a newbie with it. Even though I don’t have issues with “simple queries”, I am currently stuck with a query involving three tables. I have already gone through some tutorials, but I haven’t been able to find a valid example for my needs. I have tried my best to explain my problem:
Tag: hibernate
Does TransactionAttributeType.NOT_SUPPORTED make sense for retrieving entities?
Does having TransactionAttributeType.NOT_SUPPORTED on every DB lookup method makes sense? I don’t see the point in having the entity attached if it’s not going to execute an update. Does it still end up in the cache? The only time it seems useful to use the REQUIRED transcation propagation is when an update is required: Other than that I don’t really
org.hibernate.exception.SQLGrammarException: could not insert
Hi i am trying to insert new row in table using hibernate with bean class i am getting exception i am using below mentioned code: hbm file: Action class: Dao class Execption Caused by: where I’m wrong in this code? Answer Mapping database column types to Java types performed by Hibernate mapping configuration that uses Java types. The missing </property>
Error when try to persist entity with Hibernate (MappingException: Unknown entity)
I’m using Hibernate 5.0.6 and Hibernate annotations 3.5.6-Final with MySql 5.1.37 in a standalone maven java application. I’m trying to make a simply persistence example work but I receive the following error when I call save: The classes Is pointed via mapping class in the configuration file. But it is unable to find. But when I do this in HibernateUtil:
Error java.lang.AssertionError: expected: null but was: java.lang.String what does it mean?
I have this strange issue in my Junit 4.12 test code. The application uses Spring Framework 4.1.6 and Hibernate 4. When comparing two beans coming from different databases I get this error What does it mean? How to resolve it? My test class runs with SpringJUnit4ClassRunner and looks similar to this edit: the bean I’m referring to is a simple
How to call a PostgreSQL stored procedure with Hibernate
I want to create a Stored Procedure in PostgreSQL to make some calculation and return it to My java call. I have tried Most of the option from Java-Hibernate but not able to succeed. Below is my SP. In Java How to call this procedure to get the values. NOTE: I’m not using hibernate XML files to call quires. Please
PostgreSQL throws “Connection has been abandoned” -> “An I/O error occurred while sending to the backend”
I know that there are a lot of topics about abandoned connections , however I can’t figure out what is the problem in my case, so I really hope for some help. I have a Java application with Spring, which fetches some data from external services, and tries to save it in database. I have the following configuration for JDBC
What is the solution for the N+1 issue in JPA and Hibernate?
I understand that the N+1 problem is where one query is executed to fetch N records and N queries to fetch some relational records. But how can it be avoided in Hibernate?
Id of entity is different after hibernate save from oracle database with sequence autogeneration id
Entity with id autogenerated from oracle trigger sequence. Service DAO And When I call service’s saveOrUpdate and then try to reach id of entity I get different value than persisted in database. Values on database with autogeneration all is ok. Any suggestions? prints: 4150 but saved id in database is: 84 NOTE: My purpose to get Id comes from that
Hibernate : self join confusion?
I have a category table.In which first 5 are main category and others are sub category. I need to fetch the sub categories of first 5 main category so i have found the sql query The query is joining the same table itself.and am getting the result given below Result How can i convert the SQL query to HQL and