Пример #1
0
        /// <summary>
        /// Returns database bundle instance
        /// </summary>
        /// <param name="packageName">Name of the package</param>
        /// <returns>DatabaseBundle Instance of database bundle</returns>
        private DatabaseBundle GetDatabaseBundle(String packageName)
        {
            IDatabaseImpl    database        = (IDatabaseImpl)ClassUtils.CreateClassInstance(packageName + "." + DATABASE_CLASS_NAME);
            IQueryBuilder    queryBuilder    = (IQueryBuilder)ClassUtils.CreateClassInstance(packageName + "." + DATABASE_QUERY_BUILDER);
            IDataTypeHandler dataTypeHandler = (IDataTypeHandler)ClassUtils.CreateClassInstance(packageName + "." + DATABASE_DATA_TYPE_HANDLER);

            DatabaseBundle databaseBundle = new DatabaseBundle();

            databaseBundle.SetDatabase(database);
            databaseBundle.SetQueryBuilder(queryBuilder);
            databaseBundle.SetDataTypeHandler(dataTypeHandler);

            return(databaseBundle);
        }
Пример #2
0
        /// <summary>
        /// Get IDatabase Instance
        /// </summary>
        /// <param name="databaseDescriptor">DatabaseDescriptor Object</param>
        /// <returns>IDatabase Object</returns>
        /// <exception cref="Siminov.Core.Exception.DatabaseException">If not able to create IDatabase instance</exception>
        public DatabaseBundle GetDatabaseBundle(DatabaseDescriptor databaseDescriptor)
        {
            if (databaseBundles.ContainsKey(databaseDescriptor.GetDatabaseName()))
            {
                return(databaseBundles[databaseDescriptor.GetDatabaseName()]);
            }

            String type        = databaseDescriptor.GetType();
            String packageName = DATABASE_PACKAGE_NAME + "." + type;

            DatabaseBundle databaseBundle = GetDatabaseBundle(packageName);

            databaseBundles.Add(databaseDescriptor.GetDatabaseName(), databaseBundle);

            return(databaseBundle);
        }
Пример #3
0
        /// <summary>
        /// Returns database bundle instance
        /// </summary>
        /// <param name="packageName">Name of the package</param>
        /// <returns>DatabaseBundle Instance of database bundle</returns>
        private DatabaseBundle GetDatabaseBundle(String packageName)
        {
            IDatabaseImpl database = (IDatabaseImpl)ClassUtils.CreateClassInstance(packageName + "." + DATABASE_CLASS_NAME);
            IQueryBuilder queryBuilder = (IQueryBuilder)ClassUtils.CreateClassInstance(packageName + "." + DATABASE_QUERY_BUILDER);
            IDataTypeHandler dataTypeHandler = (IDataTypeHandler)ClassUtils.CreateClassInstance(packageName + "." + DATABASE_DATA_TYPE_HANDLER);

            DatabaseBundle databaseBundle = new DatabaseBundle();
            databaseBundle.SetDatabase(database);
            databaseBundle.SetQueryBuilder(queryBuilder);
            databaseBundle.SetDataTypeHandler(dataTypeHandler);

            return databaseBundle;
        }