Skip to content

Commit c2e8eb2

Browse files
author
Eugen Paraschiv
committed
cleanup Hibernate work
1 parent 79cf459 commit c2e8eb2

3 files changed

Lines changed: 8 additions & 20 deletions

File tree

‎persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/spring/PersistenceConfig.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
@Configuration
2323
@EnableTransactionManagement
24-
@PropertySource({ "classpath:persistence-h2.properties" })
24+
@PropertySource({ "classpath:persistence-mysql.properties" })
2525
@ComponentScan({ "com.baeldung.persistence" })
2626
public class PersistenceConfig {
2727

‎persistence-modules/spring-hibernate-5/src/main/resources/manytomany.cfg.xml‎

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,12 @@
44
"http://hibernate.org/dtd/hibernate-configuration-3.0.dtd">
55
<hibernate-configuration>
66
<session-factory>
7-
<property name="hibernate.connection.driver_class">
8-
com.mysql.jdbc.Driver
9-
</property>
10-
<property name="hibernate.connection.password">
11-
buddhinisam123
12-
</property>
13-
<property name="hibernate.connection.url">
14-
jdbc:mysql://localhost:3306/spring_hibernate_many_to_many
15-
</property>
16-
<property name="hibernate.connection.username">
17-
root
18-
</property>
19-
<property name="hibernate.dialect">
20-
org.hibernate.dialect.MySQLDialect
21-
</property>
22-
<property name="hibernate.current_session_context_class">
23-
thread
24-
</property>
7+
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
8+
<property name="hibernate.connection.password">tutorialmy5ql</property>
9+
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/spring_hibernate_many_to_many</property>
10+
<property name="hibernate.connection.username">tutorialuser</property>
11+
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
12+
<property name="hibernate.current_session_context_class">thread</property>
2513
<property name="hibernate.show_sql">true</property>
2614
</session-factory>
2715
</hibernate-configuration>

‎persistence-modules/spring-hibernate-5/src/test/java/com/baeldung/hibernate/immutable/HibernateImmutableIntegrationTest.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import com.baeldung.hibernate.immutable.entities.EventGeneratedId;
55
import com.baeldung.hibernate.immutable.util.HibernateUtil;
66
import com.google.common.collect.Sets;
7-
import org.hibernate.CacheMode;
87
import org.hibernate.Session;
98
import org.junit.*;
109
import org.junit.rules.ExpectedException;
@@ -98,6 +97,7 @@ public void deleteCascade() {
9897
public void updateEventGenerated() {
9998
createEventGenerated();
10099
EventGeneratedId eventGeneratedId = (EventGeneratedId) session.createQuery("FROM EventGeneratedId WHERE name LIKE '%John%'").list().get(0);
100+
101101
eventGeneratedId.setName("Mike");
102102
session.update(eventGeneratedId);
103103
session.flush();

0 commit comments

Comments
 (0)