Examples of CollectionMetaData


Examples of org.datanucleus.metadata.CollectionMetaData

    this.storeMgr = storeMgr;
    this.ownerMemberMetaData = ownerMmd;
    this.clr = clr;
    this.relationType = ownerMemberMetaData.getRelationType(clr);

    CollectionMetaData colmd = ownerMemberMetaData.getCollection();
    if (colmd == null) {
      throw new NucleusUserException(LOCALISER.msg("056001", ownerMemberMetaData.getFullFieldName()));
    }

    // Load the element class
    elementType = colmd.getElementType();
    Class element_class = clr.classForName(elementType);

    if (ClassUtils.isReferenceType(element_class)) {
      if (storeMgr.getNucleusContext().getMetaDataManager().isPersistentInterface(elementType)) {
        elementCmd = storeMgr.getNucleusContext().getMetaDataManager().getMetaDataForInterface(element_class,clr);
View Full Code Here

Examples of org.datanucleus.metadata.CollectionMetaData

                childValue = Arrays.asList((Object[]) childValue);
              }

              String expectedType = mmd.getTypeName();
              if (mmd.getCollection() != null) {
                CollectionMetaData cmd = mmd.getCollection();
                expectedType = cmd.getElementType();
              } else if (mmd.getArray() != null) {
                ArrayMetaData amd = mmd.getArray();
                expectedType = amd.getElementType();
              }
View Full Code Here

Examples of org.hibernate.metadata.CollectionMetadata

    return entityType;
  }

  private CollectionType buildCollectionType(SessionFactory sessionFactory, Class<?> collectionClass,
      String role) {
    CollectionMetadata cm = sessionFactory.getCollectionMetadata(role);
    // FIXME buildCollectionType
    if (null == cm) { return null; }
    org.hibernate.type.Type type = cm.getElementType();
    EntityType elementType = null;
    if (type.isEntityType()) {
      elementType = (EntityType) entityTypes.get(type.getName());
      if (null == elementType) {
        elementType = buildEntityType(sessionFactory, type.getName());
      }
    } else {
      elementType = new EntityType(type.getReturnedClass());
    }

    CollectionType collectionType = new CollectionType();
    collectionType.setElementType(elementType);
    collectionType.setArray(cm.isArray());
    collectionType.setCollectionClass(collectionClass);
    if (!collectionTypes.containsKey(collectionType.getName())) {
      collectionTypes.put(collectionType.getName(), collectionType);
    }
    return collectionType;
View Full Code Here

Examples of org.hibernate.metadata.CollectionMetadata

    return entityType;
  }

  private CollectionType buildCollectionType(SessionFactory sessionFactory,
      Class<?> collectionClass, String role) {
    CollectionMetadata cm = sessionFactory.getCollectionMetadata(role);
    org.hibernate.type.Type type = cm.getElementType();
    EntityType elementType = null;
    if (type.isEntityType()) {
      elementType = (EntityType) entityTypes.get(type.getName());
      if (null == elementType) {
        elementType = buildEntityType(sessionFactory, type.getName());
      }
    } else {
      elementType = new EntityType(type.getReturnedClass());
    }

    CollectionType collectionType = new CollectionType();
    collectionType.setElementType(elementType);
    collectionType.setArray(cm.isArray());
    collectionType.setCollectionClass(collectionClass);
    if (!collectionTypes.containsKey(collectionType.getName())) {
      collectionTypes.put(collectionType.getName(), collectionType);
    }
    return collectionType;
View Full Code Here

Examples of org.hibernate.metadata.CollectionMetadata

    return entityType;
  }

  private CollectionType buildCollectionType(SessionFactory sessionFactory, Class<?> collectionClass,
      String role) {
    CollectionMetadata cm = sessionFactory.getCollectionMetadata(role);
    // FIXME buildCollectionType
    if (null == cm) { return null; }
    org.hibernate.type.Type type = cm.getElementType();
    EntityType elementType = null;
    if (type.isEntityType()) {
      elementType = (EntityType) entityTypes.get(type.getName());
      if (null == elementType) {
        elementType = buildEntityType(sessionFactory, type.getName());
      }
    } else {
      elementType = new EntityType(type.getReturnedClass());
    }

    CollectionType collectionType = new CollectionType();
    collectionType.setElementType(elementType);
    collectionType.setArray(cm.isArray());
    collectionType.setCollectionClass(collectionClass);
    if (!collectionTypes.containsKey(collectionType.getName())) {
      collectionTypes.put(collectionType.getName(), collectionType);
    }
    return collectionType;
View Full Code Here

Examples of org.jboss.test.server.profileservice.persistence.support.CollectionMetaData

   {
      ManagedObject mo = initMO();
      PersistedManagedObject moElement = restore(mo);
      assertNotNull(moElement);
     
      ManagedObject restored = update(new CollectionMetaData(), moElement);
     
      assertNotNull(restored);

      assertNotNull(restored.getProperty("collection"));
     
View Full Code Here

Examples of org.jboss.test.server.profileservice.persistence.support.CollectionMetaData

   }

   protected CollectionMetaData createMetaData()
   {
      CollectionMetaData instance = new CollectionMetaData();
      instance.setCollection(initList());
      return instance;
   }
View Full Code Here

Examples of org.jpox.metadata.CollectionMetaData

                                elementTypeStr.append(collectionElementType.getName());
                            }
                        }
                    }

                    contmd = new CollectionMetaData(mmd, elementTypeStr.toString(),
                        embeddedElement, dependentElement, serializedElement);

                    // Add any embedded element mappings
                    if (embeddedElementMembers != null)
                    {
View Full Code Here

Examples of org.jpox.metadata.CollectionMetaData

            {
                elementType = ClassUtils.getCollectionElementType(field.getType(),field.getGenericType());
            }
            // No annotation for collections so cant specify the element type, dependent, embedded, serialized

            contmd = new CollectionMetaData(fmd, elementType, null, null, null);
        }
        else if (field.getType().isArray())
        {
            contmd = new ArrayMetaData(fmd, null, null, null, null);
        }
View Full Code Here

Examples of org.jpox.metadata.CollectionMetaData

            }
            // New collection container for this field
            else if (localName.equals("collection"))
            {
                AbstractMemberMetaData fmd = (AbstractMemberMetaData)getStack();
                CollectionMetaData colmd = new CollectionMetaData(fmd,
                                getAttr(attrs,"element-type"),
                                getAttr(attrs,"embedded-element"),
                                getAttr(attrs,"dependent-element"),
                                getAttr(attrs,"serialized-element"));
                fmd.setContainer(colmd);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.