use of org.hibernate.property.access.spi.GetterMethodImpl in project hibernate-orm by hibernate.
the class AccessMappingTest method testPropertyAnnotationPlacement.
@Test
public void testPropertyAnnotationPlacement() throws Exception {
Configuration cfg = new Configuration();
Class<?> classUnderTest = Course7.class;
cfg.addAnnotatedClass(classUnderTest);
cfg.addAnnotatedClass(Student.class);
SessionFactoryImplementor factory = (SessionFactoryImplementor) cfg.buildSessionFactory(serviceRegistry);
try {
EntityTuplizer tuplizer = factory.getEntityPersister(classUnderTest.getName()).getEntityMetamodel().getTuplizer();
assertTrue("Property access should be used.", tuplizer.getIdentifierGetter() instanceof GetterMethodImpl);
} finally {
factory.close();
}
}
use of org.hibernate.property.access.spi.GetterMethodImpl in project hibernate-orm by hibernate.
the class AccessMappingTest method testExplicitPropertyAccessAnnotationsWithJpaStyleOverride.
@Test
public void testExplicitPropertyAccessAnnotationsWithJpaStyleOverride() throws Exception {
Configuration cfg = new Configuration();
Class<?> classUnderTest = Course5.class;
cfg.addAnnotatedClass(classUnderTest);
cfg.addAnnotatedClass(Student.class);
SessionFactoryImplementor factory = (SessionFactoryImplementor) cfg.buildSessionFactory(serviceRegistry);
try {
EntityTuplizer tuplizer = factory.getEntityPersister(classUnderTest.getName()).getEntityMetamodel().getTuplizer();
assertTrue("Field access should be used.", tuplizer.getIdentifierGetter() instanceof GetterFieldImpl);
assertTrue("Property access should be used.", tuplizer.getGetter(0) instanceof GetterMethodImpl);
} finally {
factory.close();
}
}
Aggregations