private ClassInfo GetClassInfo(string fullClassName
                                       )
        {
            if (ODBType.GetFromName(fullClassName).IsNative())
            {
                return(null);
            }
            ISession  session   = storageEngine.GetSession(true);
            MetaModel metaModel = session.GetMetaModel();

            if (metaModel.ExistClass(fullClassName))
            {
                return(metaModel.GetClassInfo(fullClassName, true));
            }
            ClassInfo     ci     = null;
            ClassInfoList ciList = null;

            ciList = classIntrospector.Introspect(fullClassName, true);
            // to enable junit tests
            if (storageEngine != null)
            {
                storageEngine.AddClasses(ciList);
                // For client Server : reset meta model
                if (!storageEngine.IsLocal())
                {
                    metaModel = session.GetMetaModel();
                }
            }
            else
            {
                metaModel.AddClasses(ciList);
            }
            ci = metaModel.GetClassInfo(fullClassName, true);
            return(ci);
        }
Exemple #2
0
        /// <summary>Builds an instance of an array</summary>
        public virtual object BuildArrayInstance(ArrayObjectInfo aoi)
        {
            // first check if array element type is native (int,short, for example)
            ODBType type = ODBType.GetFromName(aoi.GetRealArrayComponentClassName());

            System.Type arrayClazz = type.GetNativeClass();
            object      array      = System.Array.CreateInstance(arrayClazz, aoi.GetArray().Length);

            object             o    = null;
            AbstractObjectInfo aboi = null;

            for (int i = 0; i < aoi.GetArrayLength(); i++)
            {
                aboi = (AbstractObjectInfo)aoi.GetArray()[i];
                if (aboi != null && !aboi.IsDeletedObject() && !aboi.IsNull())
                {
                    o = BuildOneInstance(aboi);
                    ((Array)array).SetValue(o, i);
                }
            }
            return(array);
        }
 public ClassAttributeInfo(int attributeId, string name, System.Type nativeClass,
                           string fullClassName, ClassInfo info) : base
         ()
 {
     //private transient static int nb=0;
     this.id          = attributeId;
     this.name        = name;
     this.nativeClass = nativeClass;
     SetFullClassName(fullClassName);
     if (nativeClass != null)
     {
         attributeType = ODBType.GetFromClass(nativeClass
                                              );
     }
     else
     {
         if (fullClassName != null)
         {
             attributeType = ODBType.GetFromName(fullClassName);
         }
     }
     classInfo = info;
     isIndex   = false;
 }