diff --git a/hibernate-core/src/test/java/org/hibernate/test/component/basic2/Component.java b/hibernate-core/src/test/java/org/hibernate/test/component/basic2/Component.java index 25f482a102..f70f1766db 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/component/basic2/Component.java +++ b/hibernate-core/src/test/java/org/hibernate/test/component/basic2/Component.java @@ -15,12 +15,10 @@ public class Component { @Id private Long id; + @Embedded private Component.Emb emb; - public Component() { - } - @Access(AccessType.FIELD) @Embeddable public static class Emb { diff --git a/hibernate-core/src/test/java/org/hibernate/test/component/basic2/ComponentJoinsTest.java b/hibernate-core/src/test/java/org/hibernate/test/component/basic2/ComponentJoinsTest.java index a067ca8f44..fdf1ee9281 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/component/basic2/ComponentJoinsTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/component/basic2/ComponentJoinsTest.java @@ -37,7 +37,10 @@ import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; public class ComponentJoinsTest extends BaseCoreFunctionalTestCase { @Override public Class[] getAnnotatedClasses() { - return new Class[]{Person.class, Component.class, Component.Emb.Stuff.class}; + return new Class[] { + Person.class, + Component.class, + Component.Emb.Stuff.class }; } @Test @@ -46,26 +49,26 @@ public class ComponentJoinsTest extends BaseCoreFunctionalTestCase { Session session = openSession(); session.beginTransaction(); // use it in WHERE - session.createQuery("select p from Person p join p.name as n where n.lastName like '%'").list(); + session.createQuery( "select p from Person p join p.name as n where n.lastName like '%'" ).list(); // use it in SELECT - session.createQuery("select n.lastName from Person p join p.name as n").list(); - session.createQuery("select n from Person p join p.name as n").list(); + session.createQuery( "select n.lastName from Person p join p.name as n" ).list(); + session.createQuery( "select n from Person p join p.name as n" ).list(); // use it in ORDER BY - session.createQuery("select n from Person p join p.name as n order by n.lastName").list(); - session.createQuery("select n from Person p join p.name as n order by p").list(); - session.createQuery("select n from Person p join p.name as n order by n").list(); + session.createQuery( "select n from Person p join p.name as n order by n.lastName" ).list(); + session.createQuery( "select n from Person p join p.name as n order by p" ).list(); + session.createQuery( "select n from Person p join p.name as n order by n" ).list(); session.getTransaction().commit(); session.close(); } @Test @TestForIssue(jiraKey = "HHH-7849") - public void testComponentJoins_HHH_7849() { + public void testComponentJoinsHHH7849() { // Just checking proper query construction and syntax checking via database query parser... Session session = openSession(); session.beginTransaction(); // use it in WHERE - session.createQuery("select c from Component c join c.emb as e where e.stuffs is empty ").list(); + session.createQuery( "select c from Component c join c.emb as e where e.stuffs is empty " ).list(); session.getTransaction().commit(); session.close();