hibernate

Creating the Spring boot Rest api

Help me not clear errors, I started digging in Spring Boot, and tried to create a Rest site, I tried three guides and I alway ... tion for DDL execution Caused by: java.sql.SQLSyntaxErrorException: Unknown database 'messages&servertimezone=utc&'

Should Entity classes implement Serializable

Looking at old videos and articles on Hibernate, I found that all the Entities in their examples implement the Serializable i ... and does not complain about anything. Well, do Entity classes need to implement this interface, or is it a relic of the past?

org.hibernate.AnnotationException: @OneToOne or @ManyToOne

It seems to have added @OneToMany and @ManyToOne to the link code, but for some reason it gives an error when running Spring- ... stractAutowireCapableBeanFactory.java:1792) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] ... 16 common frames omitted

How does JDBC and ORM work?

I read a lot of information about JDBC and ORM, now I would like to test my understanding of working with databases in Java a ... nt projects, that is, sometimes it is profitable to use JDBC, and sometimes ORM. Please tell me if I am reasoning correctly?

Embeddable access to fields from the hibernate criteria

There is an entity in one file (inside a class with @Embedded), in another file a class with @Embeddable, the question is how ... lds from two places,I'm trying to pull out a field that exists in the database,but itself is exactly in the class @Embeddable

Rewrite the SQL query in HQL

You need to rewrite the request SELECT * FROM learn.employee JOIN learn.department on department.id WHERE department.head_id ... y the month of March. If you specify an integer for month-Hibernate swears that it is impossible to compare Date and Integer.

Creating and deleting a table manually in Hibernate using sql queries

You must manually create and delete a table in the database using sql queries using Hibernate. Class-the entity that the tabl ... esn't help, it's just that the table is no longer created automatically. How do I make the methods work, what did I do wrong?

Property not available in the file hibernate.cfg.xml

In the file hibernate.cfg.xml property ("Cannot resolve symbol 'connection.password '" and all the others) is not available i ... rnate (I check Create default Hibernate configuration), then even in created automatically hibernate.cfg.xml same problem.

Infinite recursion when using @OneToMany and @ManyToOne + MapStruct

entity Entity @Table(name ="posts") public class Post { @Id @SequenceGenerator(name = "jpaSequence.Post", ... debug mode, still see infinite nesting, and this is despite the fact that Fetch = FetchType.LAZY Who knows how to fix it?

Spring 4, Hibernate. How to configure it?

I'll start by Googling it. I've been picking at it for over a week. The essence of the question: how to integrate Hibernate i ... framework for a customized web application Spring/Hibernate/MySQL/Maven - I will be just happy to download the source code :)

Java + Hibernate Web Application structure without Spring

I'm trying to figure out a java web application. Using Intellij IDEA First, I wrote a small console application that acces ... .buildSessionFactory(); } public static SessionFactory getSessionFactory() { return sessionFactory; } }

How to set up the OneToMany - ManyToOne relationship correctly?

There are two entities news and categories. Creating a relation in the news entity to the category: @ManyToOne(fetch = Fetc ... m.reweu.server.entity.News.category] setter of com.reweu.server.entity.News.category Please tell me what the reason may be.

Hibernate one to many, do not link tables

Hello, I'm making a table connection on Hibernate, one teacher to many students. Teacher: @Entity @Table(name = "te ... 1 | pupil name | NULL | +----+------------+------------+ Please tell me why I have a null teacher ID in my student ?

Hibernate, could not extract ResultSet

For training purposes, I want to write an application in Spring + Hibernate with the ability to log in and send messages. I c ... a jamb, but due to lack of experience, it is not possible to find it, Google also did not help. Link to GitHubError log

The difference between JPA and Hibernate

How is JPA different from Hibernate? JPA specification. Hibernate-JPA + implementation has its own features. Using sectification allows you to conveniently change one implementation to another. Where is it used and when can it be convenient?

Hibernate Many-to-One relationship using annotations

There are tables "one" and "Two". The relationship between them is "many - to-one". You need to make an insert in the table О ... h codes, so that there are no duplicates of one object). How do I organize an entry in tables with the relation many-to-one?

Hibernate + PostgreSQL vs MySQL

There was a problem in the application using Hibernate when changing the database from MySQL to PostgreSQL. With MySQL connec ... ser = userDao.findUserByLogin(login); userDao.closeCurrentSession(); return user.getPassword().equals(password); } }

SessionFactory in Hibernate 4 for Dummies

I'm trying to understand Hibernate, namely, SessionFactory. Here I read the answer about creating a session (https://ru.stack ... t me: first Properties properties = new Properties();. And then you need to use the put() method to add different properties.

Cascading deletion from the one-to-many Hibernete database

I have two tables DEPARTMENT and EMPLOYEE (the first is the parent, and the second is the child). That is, each department ha ... ession.get(DepartmentDataSet.class, 3)); session.getTransaction().commit(); } I will be glad of any hints where to dig)