cleanup Hibernate work
This commit is contained in:
parent
79cf459013
commit
c2e8eb2ccc
|
@ -21,7 +21,7 @@ import java.util.Properties;
|
|||
|
||||
@Configuration
|
||||
@EnableTransactionManagement
|
||||
@PropertySource({ "classpath:persistence-h2.properties" })
|
||||
@PropertySource({ "classpath:persistence-mysql.properties" })
|
||||
@ComponentScan({ "com.baeldung.persistence" })
|
||||
public class PersistenceConfig {
|
||||
|
||||
|
|
|
@ -4,24 +4,12 @@
|
|||
"http://hibernate.org/dtd/hibernate-configuration-3.0.dtd">
|
||||
<hibernate-configuration>
|
||||
<session-factory>
|
||||
<property name="hibernate.connection.driver_class">
|
||||
com.mysql.jdbc.Driver
|
||||
</property>
|
||||
<property name="hibernate.connection.password">
|
||||
buddhinisam123
|
||||
</property>
|
||||
<property name="hibernate.connection.url">
|
||||
jdbc:mysql://localhost:3306/spring_hibernate_many_to_many
|
||||
</property>
|
||||
<property name="hibernate.connection.username">
|
||||
root
|
||||
</property>
|
||||
<property name="hibernate.dialect">
|
||||
org.hibernate.dialect.MySQLDialect
|
||||
</property>
|
||||
<property name="hibernate.current_session_context_class">
|
||||
thread
|
||||
</property>
|
||||
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
|
||||
<property name="hibernate.connection.password">tutorialmy5ql</property>
|
||||
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/spring_hibernate_many_to_many</property>
|
||||
<property name="hibernate.connection.username">tutorialuser</property>
|
||||
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
|
||||
<property name="hibernate.current_session_context_class">thread</property>
|
||||
<property name="hibernate.show_sql">true</property>
|
||||
</session-factory>
|
||||
</hibernate-configuration>
|
||||
|
|
|
@ -4,7 +4,6 @@ import com.baeldung.hibernate.immutable.entities.Event;
|
|||
import com.baeldung.hibernate.immutable.entities.EventGeneratedId;
|
||||
import com.baeldung.hibernate.immutable.util.HibernateUtil;
|
||||
import com.google.common.collect.Sets;
|
||||
import org.hibernate.CacheMode;
|
||||
import org.hibernate.Session;
|
||||
import org.junit.*;
|
||||
import org.junit.rules.ExpectedException;
|
||||
|
@ -98,6 +97,7 @@ public class HibernateImmutableIntegrationTest {
|
|||
public void updateEventGenerated() {
|
||||
createEventGenerated();
|
||||
EventGeneratedId eventGeneratedId = (EventGeneratedId) session.createQuery("FROM EventGeneratedId WHERE name LIKE '%John%'").list().get(0);
|
||||
|
||||
eventGeneratedId.setName("Mike");
|
||||
session.update(eventGeneratedId);
|
||||
session.flush();
|
||||
|
|
Loading…
Reference in New Issue