-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: How to get a columnIterator() of a composite-element?
PostPosted: Fri Oct 29, 2004 9:51 am 
Beginner
Beginner

Joined: Mon Mar 22, 2004 10:01 am
Posts: 22
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.