HHH-7849 Formatting

This commit is contained in:
brmeyer 2012-12-10 14:15:53 -05:00
parent 02825e9fd6
commit c75b045adc
2 changed files with 13 additions and 12 deletions

View File

@ -15,12 +15,10 @@ public class Component {
@Id @Id
private Long id; private Long id;
@Embedded @Embedded
private Component.Emb emb; private Component.Emb emb;
public Component() {
}
@Access(AccessType.FIELD) @Access(AccessType.FIELD)
@Embeddable @Embeddable
public static class Emb { public static class Emb {

View File

@ -37,7 +37,10 @@ import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
public class ComponentJoinsTest extends BaseCoreFunctionalTestCase { public class ComponentJoinsTest extends BaseCoreFunctionalTestCase {
@Override @Override
public Class[] getAnnotatedClasses() { 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 @Test
@ -46,26 +49,26 @@ public class ComponentJoinsTest extends BaseCoreFunctionalTestCase {
Session session = openSession(); Session session = openSession();
session.beginTransaction(); session.beginTransaction();
// use it in WHERE // 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 // use it in SELECT
session.createQuery("select n.lastName 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(); session.createQuery( "select n from Person p join p.name as n" ).list();
// use it in ORDER BY // 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 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 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" ).list();
session.getTransaction().commit(); session.getTransaction().commit();
session.close(); session.close();
} }
@Test @Test
@TestForIssue(jiraKey = "HHH-7849") @TestForIssue(jiraKey = "HHH-7849")
public void testComponentJoins_HHH_7849() { public void testComponentJoinsHHH7849() {
// Just checking proper query construction and syntax checking via database query parser... // Just checking proper query construction and syntax checking via database query parser...
Session session = openSession(); Session session = openSession();
session.beginTransaction(); session.beginTransaction();
// use it in WHERE // 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.getTransaction().commit();
session.close(); session.close();