This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Test | |
| @Transactional | |
| public void testSuccessWrong() { | |
| NotifyBuilder notify = new NotifyBuilder(camelContext) | |
| .from("activemq:TestQueue") | |
| .whenCompleted(1) | |
| .create(); | |
| jmsTemplate.send("TestQueue", session -> session.createTextMessage("testtestte")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.forketyfork.hibernate; | |
| public class SneakyCatService { | |
| public SneakyCatService() { | |
| } | |
| public void patACat(Cat cat) { | |
| cat.$$_hibernate_write_name("Buddy"); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <plugin> | |
| <groupId>org.hibernate.orm.tooling</groupId> | |
| <artifactId>hibernate-enhance-maven-plugin</artifactId> | |
| <version>5.4.18.Final</version> | |
| <executions> | |
| <execution> | |
| <configuration> | |
| <failOnError>true</failOnError> | |
| <enableDirtyTracking>true</enableDirtyTracking> | |
| <enableExtendedEnhancement>true</enableExtendedEnhancement> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| session.beginTransaction(); | |
| cat = session.get(Cat.class, id); | |
| new SneakyCatService().patACat(cat); | |
| session.getTransaction().commit(); | |
| session.clear(); | |
| session.beginTransaction(); | |
| cat = session.get(Cat.class, id); | |
| assertEquals("Buddy", cat.getName()); | |
| session.getTransaction().commit(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class SneakyCatService { | |
| public void patACat(Cat cat) { | |
| cat.name = "Buddy"; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void myCustomMethodToChangeData() { | |
| this.$$_hibernate_write_name("Simba"); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Entity | |
| public class Cat implements Serializable { | |
| @Id | |
| @GeneratedValue | |
| private Long id; | |
| @Column | |
| String name; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Entity | |
| public class Cat implements Serializable, ManagedEntity, SelfDirtinessTracker { | |
| @Id | |
| @GeneratedValue | |
| private Long id; | |
| @Column | |
| String name; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Entity | |
| public class Cat implements Serializable { | |
| @Id | |
| @GeneratedValue | |
| private Long id; | |
| @Column | |
| String name; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <plugin> | |
| <groupId>org.hibernate.orm.tooling</groupId> | |
| <artifactId>hibernate-enhance-maven-plugin</artifactId> | |
| <version>5.4.18.Final</version> | |
| <executions> | |
| <execution> | |
| <configuration> | |
| <failOnError>true</failOnError> | |
| <enableDirtyTracking>true</enableDirtyTracking> | |
| </configuration> |