Assert.assertEquals(2, managedTypes.size());
Assert.assertEquals(1, builder.getMappedSuperClassTypes().size());
// on subClass EntityWithAttributeOverrides
AbstractManagedType managedType = managedTypes.get(EntityWithAttributeOverrides.class);
Assert.assertNotNull(managedType);
Assert.assertEquals(5, managedType.getAttributes().size());
Assert.assertNotNull(managedType.getAttribute("mappedInt"));
String jpaName1 = ((AbstractAttribute<X, T>) managedType.getAttribute("mappedInt")).getJPAColumnName();
String jpaName2 = ((AbstractAttribute<X, T>) managedType.getAttribute("mappedFloat")).getJPAColumnName();
Assert.assertEquals("MAPPED_INT", jpaName1);
Assert.assertEquals("MAPPED_FLOAT", jpaName2);
Assert.assertNotNull(managedType.getSingularAttribute("mappedInt", int.class));
// on subClass AttributeOverrideSubClass
managedType = managedTypes.get(AttributeOverrideSubClass.class);
jpaName1 = ((AbstractAttribute<X, T>) managedType.getAttribute("mappedInt")).getJPAColumnName();
jpaName2 = ((AbstractAttribute<X, T>) managedType.getAttribute("mappedFloat")).getJPAColumnName();
Assert.assertEquals("MAPPED_INT", jpaName1);
Assert.assertEquals("mappedFloat", jpaName2);
Assert.assertNotNull(managedType);
Assert.assertEquals(5, managedType.getAttributes().size());
Assert.assertNotNull(managedType.getAttribute("mappedInt"));
Assert.assertNotNull(managedType.getSingularAttribute("mappedInt", int.class));
clazz = (X) EntityWithIdAttributeOverride.class;
// MetaModelBuilder builder = new MetaModelBuilder<X, T>();
builder.process(clazz);
field = clazz.getDeclaredFields();
for (Field f : field)
{
builder.construct(clazz, f);
}
managedType = managedTypes.get(EntityWithIdAttributeOverride.class);
jpaName1 = ((AbstractAttribute<X, T>) managedType.getAttribute("id")).getJPAColumnName();
jpaName2 = ((AbstractAttribute<X, T>) managedType.getAttribute("mappedFloat")).getJPAColumnName();
String jpaName3 = ((AbstractAttribute<X, T>) managedType.getAttribute("mappedInt")).getJPAColumnName();
Assert.assertEquals("ID_ATTRIB", jpaName1);
Assert.assertEquals("MAPPED_FLOAT", jpaName2);
Assert.assertEquals("mappedInt", jpaName3);