Skip to content

Commit

Permalink
HHH-7849 Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
brmeyer committed Dec 10, 2012
1 parent 02825e9 commit c75b045
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@
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
Expand All @@ -46,26 +49,26 @@ public void testComponentJoins() {
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();
Expand Down

0 comments on commit c75b045

Please sign in to comment.