@@ -0,0 +1,937 @@
+package com.vladmihalcea.book.hpjp.hibernate.bytecode;%0A%0Aimport com.vladmihalcea.book.hpjp.hibernate.forum.Post;%0Aimport com.vladmihalcea.book.hpjp.hibernate.forum.Tag;%0Aimport com.vladmihalcea.book.hpjp.util.AbstractTest;%0Aimport org.junit.Test;%0A%0A/**%0A * @author Vlad Mihalcea%0A */%0Apublic class BytecodeEnhancementDirtyCheckingTest extends AbstractTest %7B%0A%0A    @Override%0A    protected Class%3C?%3E%5B%5D entities() %7B%0A        return new Class%3C?%3E%5B%5D %7B%0A            Tag.class%0A        %7D;%0A    %7D%0A%0A    @Test%0A    public void testDirtyChecking() %7B%0A        doInJPA(entityManager -%3E %7B%0A            Tag tag = new Tag();%0A            tag.setId(1L);%0A            tag.setName(%22High-Performance Hibernate%22);%0A%0A            entityManager.persist(tag);%0A        %7D);%0A%0A        doInJPA(entityManager -%3E %7B%0A            Tag tag = entityManager.find(Tag.class, 1L);%0A%0A            tag.setName(%22High-Performance Java Persistence%22);%0A            entityManager.flush();%0A        %7D);%0A    %7D%0A%7D%0A

Add new test