Search in sources :

Example 11 with Triggerable

use of org.hibernate.testing.logger.Triggerable in project hibernate-orm by hibernate.

the class CollectionPropertyDeprecationsTest method testReferencingMapElements.

@Test
@TestForIssue(jiraKey = "HHH-11400")
public void testReferencingMapElements() {
    // NOTE : JPA's VALUE ought to work fine as we never supported
    // 		that in the legacy form...
    Triggerable triggerable = logInspection.watchForLogMessages("HHH90000016");
    // first the accepted ways
    compileQuery("select elements(h.family) from Human h");
    assertFalse(triggerable.wasTriggered());
    triggerable.reset();
    compileQuery("select h from Human h where h.name.first in elements(h.family)");
    assertFalse(triggerable.wasTriggered());
    triggerable.reset();
    // then the deprecated way
    compileQuery("select h.family.elements from Human h");
    assertTrue(triggerable.wasTriggered());
}
Also used : Triggerable(org.hibernate.testing.logger.Triggerable) Test(org.junit.Test) TestForIssue(org.hibernate.testing.TestForIssue)

Example 12 with Triggerable

use of org.hibernate.testing.logger.Triggerable in project hibernate-orm by hibernate.

the class CollectionPropertyDeprecationsTest method testReferencingBagElements.

@Test
@TestForIssue(jiraKey = "HHH-11400")
public void testReferencingBagElements() {
    Triggerable triggerable = logInspection.watchForLogMessages("HHH90000016");
    // first the accepted ways
    compileQuery("select elements(h.friends) from Human h");
    assertFalse(triggerable.wasTriggered());
    triggerable.reset();
    compileQuery("select h from Human h where h in elements(h.friends)");
    assertFalse(triggerable.wasTriggered());
    triggerable.reset();
    // then the deprecated way
    compileQuery("select h.friends.elements from Human h");
    assertTrue(triggerable.wasTriggered());
}
Also used : Triggerable(org.hibernate.testing.logger.Triggerable) Test(org.junit.Test) TestForIssue(org.hibernate.testing.TestForIssue)

Example 13 with Triggerable

use of org.hibernate.testing.logger.Triggerable in project hibernate-orm by hibernate.

the class CollectionPropertyDeprecationsTest method testReferencingListIndices.

@Test
@TestForIssue(jiraKey = "HHH-11400")
public void testReferencingListIndices() {
    Triggerable triggerable = logInspection.watchForLogMessages("HHH90000016");
    // first the accepted ways
    compileQuery("select indices(u.permissions) from User u");
    assertFalse(triggerable.wasTriggered());
    triggerable.reset();
    compileQuery("select u from User u where u.userName in indices(u.permissions)");
    assertFalse(triggerable.wasTriggered());
    triggerable.reset();
    // then the deprecated way
    compileQuery("select u.permissions.indices from User u");
    assertTrue(triggerable.wasTriggered());
}
Also used : Triggerable(org.hibernate.testing.logger.Triggerable) Test(org.junit.Test) TestForIssue(org.hibernate.testing.TestForIssue)

Example 14 with Triggerable

use of org.hibernate.testing.logger.Triggerable in project hibernate-orm by hibernate.

the class CollectionPropertyDeprecationsTest method testReferencingListElements.

@Test
@TestForIssue(jiraKey = "HHH-11400")
public void testReferencingListElements() {
    Triggerable triggerable = logInspection.watchForLogMessages("HHH90000016");
    // first the accepted ways
    compileQuery("select elements(u.permissions) from User u");
    assertFalse(triggerable.wasTriggered());
    triggerable.reset();
    compileQuery("select u from User u where u.userName in elements(u.permissions)");
    assertFalse(triggerable.wasTriggered());
    triggerable.reset();
    // then the deprecated way
    compileQuery("select u.permissions.elements from User u");
    assertTrue(triggerable.wasTriggered());
}
Also used : Triggerable(org.hibernate.testing.logger.Triggerable) Test(org.junit.Test) TestForIssue(org.hibernate.testing.TestForIssue)

Example 15 with Triggerable

use of org.hibernate.testing.logger.Triggerable in project hibernate-orm by hibernate.

the class CollectionPropertyDeprecationsTest method testReferencingMapIndices.

@Test
@TestForIssue(jiraKey = "HHH-11400")
public void testReferencingMapIndices() {
    // NOTE : JPA's KEY ought to work fine as we never supported
    // 		that in the legacy form...
    Triggerable triggerable = logInspection.watchForLogMessages("HHH90000016");
    // first the accepted ways
    compileQuery("select indices(h.family) from Human h");
    assertFalse(triggerable.wasTriggered());
    triggerable.reset();
    compileQuery("select h from Human h where h.name.first in indices(h.family)");
    assertFalse(triggerable.wasTriggered());
    triggerable.reset();
    // then the deprecated way
    compileQuery("select h.family.indices from Human h");
    assertTrue(triggerable.wasTriggered());
}
Also used : Triggerable(org.hibernate.testing.logger.Triggerable) Test(org.junit.Test) TestForIssue(org.hibernate.testing.TestForIssue)

Aggregations

Triggerable (org.hibernate.testing.logger.Triggerable)18 Test (org.junit.Test)18 TestForIssue (org.hibernate.testing.TestForIssue)12 Session (org.hibernate.Session)8 CollectionEntry (org.hibernate.engine.spi.CollectionEntry)5 Transaction (org.hibernate.Transaction)3 Metadata (org.hibernate.boot.Metadata)3 MetadataSources (org.hibernate.boot.MetadataSources)3 StandardServiceRegistryBuilder (org.hibernate.boot.registry.StandardServiceRegistryBuilder)3 SessionImplementor (org.hibernate.engine.spi.SessionImplementor)3 HashMap (java.util.HashMap)2 Map (java.util.Map)2 Criteria (org.hibernate.Criteria)2 ServiceRegistryImplementor (org.hibernate.service.spi.ServiceRegistryImplementor)2 CachingRegionFactory (org.hibernate.testing.cache.CachingRegionFactory)2 BMRules (org.jboss.byteman.contrib.bmunit.BMRules)2