hibernate Questions
16
Solved
I have 3 entities with ManyToMany relationships:
Role Entity:
@Entity
public class Role {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer roleID;
private String roleNa...
6
Solved
Can someone please explain to me @MapsId in hibernate? I'm having a hard time understanding it.
It would be great if one could explain it with an example and in what kind of use cases is it most a...
Dictate asked 29/3, 2012 at 10:34
16
What is the problem? Can't connect to database?
org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (
Communications link failure
The last packet sent successf...
1
Solved
Similar to @ManyToOne Referencing a composite key in JPA. This is with an older version of Spring Boot using Hibernate 5.6.
I have three entity classes:
@Entity class A { Long getId(); ... }
@Entit...
Cravens asked 30/4 at 5:36
3
How to create unpaged but sorted Pageable.of(unpaged, unpaged, Sort ) to spring data jpa repository?
How do I pass a Pageable object to Spring JPA Repository with only Sorting information?
I want something like this:
Pageable pageable = PageRequest.of(null, null, Sort());
I know it takes int ...
Hassler asked 8/11, 2019 at 7:57
23
Solved
I'm working on a Spring JPA Application, using MySQL as database. I ensured that all spring-jpa libraries, hibernate and mysql-connector-java is loaded.
I'm running a mysql 5 instance. Here is a e...
3
Solved
I have a Spring app that is using Hibernate and the Spring Data JPA's CrudRepository. Everything seems to work properly if the data that was queried for exists in the database. However, if there is...
Michell asked 10/6, 2016 at 20:57
7
I have a table in postgres with the following structure
CREATE TABLE rpaul."HK_LOGIN_DETAILS"
(
"HK_LOGIN_DETAILS_ID" bigint NOT NULL,
"HK_LOGIN_DETAILS_USERNAME" character varying(10) NOT NULL...
Luettaluevano asked 11/5, 2012 at 6:17
5
I used this annotation successfully for a Dao class. And rollback works for tests.
But now I need to rollback real code, not just tests.
There are special annotations for use in tests. But which ...
5
Solved
I'm following the Learn Spring 5 etc on udemy and I'm at the part where we test our application. Everything worked fine till now, i was able to connect to the postgreSQL database and all but now I'...
Rudbeckia asked 14/3, 2020 at 22:20
11
Solved
If I pass an empty list into a JPA query, I get an error.
For example:
List<Municipality> municipalities = myDao.findAll(); // returns empty list
em.createQuery("SELECT p FROM Profile p ...
Peatroy asked 21/3, 2010 at 22:4
5
I have a question about Postgres and GenerationType.Identity vs Sequence
In this example...
@Id
@SequenceGenerator(name="mytable_id_seq",
sequenceName="mytable_id_seq",
allocationSize=1)
@Gener...
Prudy asked 8/11, 2016 at 22:49
2
I have 2 applications (one is SpringBoot app and another is a C++ app) calling the same Oracle sequence SEQUENCE_A responsible for generating PK on the same table TABLE-A.
The sequence DDL is as:
C...
Dragonhead asked 18/4 at 18:53
38
Solved
I am trying run a spring-boot application which uses hibernate via spring-jpa, but i am getting this error:
Caused by: org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be n...
Brittbritta asked 24/10, 2014 at 13:6
5
Solved
I need to get a resultset via executing a native query in Hibernate. Though I am using EntityManager, the query and resultSet may not be entities.
A need to get ResultSet that is of List. Since t...
35
Solved
Is it possible in Hibernate to print generated SQL queries with real values instead of question marks?
How would you suggest to print queries with real values if it is not possible with Hibernate ...
5
Solved
I have a table with a generated id, but in some cases I would like to set it on my own. Can I, somehow, force Hibernate to ignore the @GeneratedValue?
4
Solved
I've just upgraded the version I use for Hibernate to 5.6.1 and it seems it's now deprecating some Type-related annotations:
@TypeDef(name = "json", typeClass = JsonBinaryType::class)
@...
Leishaleishmania asked 19/11, 2021 at 14:34
10
Solved
I have two entities, an entity "movie" and an entity "Clip"
each clip belongs to one movie and a movie can have multiple clips.
My code looks like:
Movie.java
@OneToMany(mapped...
Evin asked 16/5, 2013 at 2:10
3
Just upgraded from Spring Boot 3.1.5 to 3.2.0 and started having Cannot compare left expression of type 'com.acme.domain.AbstractEntity' with right expression of type 'com.acme.domain.User' in seve...
Eloign asked 12/12, 2023 at 18:27
5
Solved
I am trying to store a JSON object in MySQL database in spring boot. I know I am doing something wrong but I a can't figure out what it is because I am fairly new to Spring.
I have a rest endpoin...
6
Solved
When running my Spring/Hibernate application I see the following unwanted output on the console:
Hibernate: select securityus0_.ID ....
Hibernate: select securityus0_.ID ....
Hibernate: select sec...
4
Solved
I would like to know what's the best way to register a custom SQL function with JPA/Hibernate.
Do I have to go through extending the MysqlInnodb dialect or is there a better way?
Can anyone pleas...
Extinct asked 10/9, 2012 at 7:11
4
Solved
I have an enum with a list of states (e.g.)
enum State
{
UP,
DOWN,
RETRY
};
The column in my database is of type enum. When I try to execute a Hibernate query by setting the parameter in the ...
Aspirin asked 23/12, 2014 at 14:9
33
Solved
I'm unable to get spring boot to automatically load my database schema when I start it up.
Here is my application.properties:
spring.datasource.url=jdbc:mysql://localhost:3306/test
spring.datasou...
Daisey asked 12/11, 2014 at 7:47
© 2022 - 2024 — McMap. All rights reserved.