HHH-11364 - Checkstyle fixups.

(cherry picked from commit f01055985e)
This commit is contained in:
Chris Cranford 2017-01-06 10:22:02 -05:00 committed by Gail Badner
parent 9013768a18
commit e0d4e1f54b
3 changed files with 18 additions and 28 deletions

View File

@ -105,7 +105,12 @@ public class MiddleEmbeddableComponentMapper implements MiddleComponentMapper, C
); );
} }
else { else {
parameters.addWhereOrNullRestriction(prefix1 + '.' + propertyName, false, "=", prefix2 + '.' + propertyName, false); parameters.addWhereOrNullRestriction(
prefix1 + '.' + propertyName,
false,
"=",
prefix2 + '.' + propertyName, false
);
} }
} }
} }

View File

@ -288,6 +288,7 @@ public class Parameters {
/** /**
* Add where clause with a null restriction: (left = right or (left is null and right is null)) * Add where clause with a null restriction: (left = right or (left is null and right is null))
*
* @param left Left property name. * @param left Left property name.
* @param addAliasLeft Whether to add the alias to the left property. * @param addAliasLeft Whether to add the alias to the left property.
* @param op The operator. * @param op The operator.

View File

@ -9,13 +9,12 @@ package org.hibernate.envers.test.integration.collection.embeddable;
import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase;
import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.Priority;
import org.hibernate.envers.test.entities.StrTestNoProxyEntity; import org.hibernate.envers.test.entities.StrTestNoProxyEntity;
import org.hibernate.envers.test.entities.collection.EmbeddableListEntity1;
import org.hibernate.envers.test.entities.collection.EmbeddableListEntity3; import org.hibernate.envers.test.entities.collection.EmbeddableListEntity3;
import org.hibernate.envers.test.entities.components.relations.ManyToOneEagerComponent; import org.hibernate.envers.test.entities.components.relations.ManyToOneEagerComponent;
import org.hibernate.testing.TestForIssue; import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.transaction.TransactionUtil;
import org.junit.Test; import org.junit.Test;
import javax.persistence.EntityManager;
import java.util.Arrays; import java.util.Arrays;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
@ -25,10 +24,7 @@ import static org.junit.Assert.assertEquals;
*/ */
@TestForIssue(jiraKey = "HHH-11364") @TestForIssue(jiraKey = "HHH-11364")
public class EmbeddableList3 extends BaseEnversJPAFunctionalTestCase { public class EmbeddableList3 extends BaseEnversJPAFunctionalTestCase {
private Integer ele3_id = null; private Integer ele3_id;
private ManyToOneEagerComponent component = new ManyToOneEagerComponent(null, "data");
@Override @Override
protected Class<?>[] getAnnotatedClasses() { protected Class<?>[] getAnnotatedClasses() {
@ -38,29 +34,17 @@ public class EmbeddableList3 extends BaseEnversJPAFunctionalTestCase {
@Test @Test
@Priority(10) @Priority(10)
public void initData() { public void initData() {
EntityManager em = getEntityManager(); ele3_id = TransactionUtil.doInJPA( this::entityManagerFactory, entityManager -> {
EmbeddableListEntity3 ele3 = new EmbeddableListEntity3(); EmbeddableListEntity3 ele3 = new EmbeddableListEntity3();
ele3.getComponentList().add( new ManyToOneEagerComponent( null, "data" ) );
// Revision 1 (persist the entity ) entityManager.persist( ele3 );
em.getTransaction().begin(); return ele3.getId();
ele3.getComponentList().add(component); } );
em.persist( ele3 );
em.getTransaction().commit();
em.close();
ele3_id = ele3.getId();
} }
@Test @Test
public void testRevisionsCounts() { public void testRevisionsCounts() {
assertEquals( assertEquals( Arrays.asList( 1 ), getAuditReader().getRevisions( EmbeddableListEntity3.class, ele3_id) );
Arrays.asList(1), getAuditReader().getRevisions(
EmbeddableListEntity3.class,
ele3_id)
);
} }
@Test @Test