Hibernate version: h3 CVS
I can not get a way to iterate the columns of a composite-element. Does anyone have an idea how to get one? See comment at the end of the code...
Any help is appreciated!
Code:
private PropertyImpl initializeProperty(org.hibernate.mapping.Property hibernateProperty) throws MetadataException, MappingException
{
PropertyImpl property = createProperty(hibernateProperty);
Type type = hibernateProperty.getType();
HibernateMetaSpace metaSpace = (HibernateMetaSpace)getMetaSpace();
if (type.isAssociationType())
{
org.hibernate.type.AssociationType associationType = (org.hibernate.type.AssociationType)type;
boolean isAssociation = true;
if (associationType.isPersistentCollectionType())
{
PersistentCollectionType persistentCollectionType = (PersistentCollectionType)associationType;
Type elementType = persistentCollectionType.getElementType((SessionFactoryImplementor)metaSpace.getConnectionManager().currentSession().getSessionFactory());
if (elementType.isEntityType() == false)
{
// not an association, it must be a composite-element
isAssociation = false;
Value value = hibernateProperty.getValue();
Class associationTargetType = elementType.getReturnedClass();
if (log.isDebugEnabled())
log.debug("Property [" + property + "] seems to be a composite-element of type [" + associationTargetType + "]");
// iterate on the columns of elementType