public MyContext(CustomClassRepository repository, IObjectContainer metadata, IObjectContainer
				 data)
			{
				this.repository = repository;
				this.metadata = metadata;
				this.data = data;
			}
示例#2
0
 public MyContext(CustomClassRepository repository, IObjectContainer metadata, IObjectContainer
                  data)
 {
     this.repository = repository;
     this.metadata   = metadata;
     this.data       = data;
 }
示例#3
0
 public CustomClass(CustomClassRepository repository, string name, string[] fieldNames
     , Type[] fieldTypes)
 {
     // fields must be public so test works on less capable runtimes
     _repository = repository;
     _name = name;
     _fields = CreateFields(fieldNames, fieldTypes);
 }
示例#4
0
 public CustomClass(CustomClassRepository repository, string name, string[] fieldNames
                    , Type[] fieldTypes)
 {
     // fields must be public so test works on less capable runtimes
     _repository = repository;
     _name       = name;
     _fields     = CreateFields(fieldNames, fieldTypes);
 }
示例#5
0
		public CustomField(CustomClassRepository repository, int index, string name, Type
			 type)
		{
			// fields must be public so test works on less capable runtimes
			_repository = repository;
			_index = index;
			_name = name;
			_type = type;
		}
        public virtual void CreateEntryClass(PersistenceContext context, string className
                                             , string[] fieldNames, string[] fieldTypes)
        {
            LogMethodCall("createEntryClass", context, className);
            CustomClassRepository repository = Repository(context);

            repository.DefineClass(className, fieldNames, fieldTypes);
            UpdateMetadata(context, repository);
        }
示例#7
0
 public CustomField(CustomClassRepository repository, int index, string name, Type
                    type)
 {
     // fields must be public so test works on less capable runtimes
     _repository = repository;
     _index      = index;
     _name       = name;
     _type       = type;
 }
示例#8
0
        private CustomClassRepository InitializeClassRepository(IObjectContainer container
                                                                )
        {
            var repository = QueryClassRepository(container);

            if (repository == null)
            {
                Log("Initializing new class repository.");
                repository = new CustomClassRepository();
                Store(container, repository);
            }
            else
            {
                Log("Found existing class repository: " + repository);
            }
            return(repository);
        }
        // TODO Auto-generated method stub
        public virtual void InitContext(PersistenceContext context)
        {
            LogMethodCall("initContext", context);
            IObjectContainer metadata = OpenMetadata(context.Url());

            try
            {
                CustomClassRepository repository = InitializeClassRepository(metadata);
                CustomReflector       reflector  = new CustomReflector(repository);
                IObjectContainer      data       = OpenData(reflector, context.Url());
                context.SetProviderContext(new Db4oPersistenceProvider.MyContext(repository, metadata
                                                                                 , data));
            }
            catch (Exception e)
            {
                Sharpen.Runtime.PrintStackTrace(e);
                // make sure metadata container is not left open
                // in case something goes wrong with the setup
                CloseIgnoringExceptions(metadata);
                // cant use exception chaining here because the
                // test must run in jdk 1.1
                throw new Db4oException(e);
            }
        }
示例#10
0
 private CustomClassRepository InitializeClassRepository(IObjectContainer container
     )
 {
     var repository = QueryClassRepository(container);
     if (repository == null)
     {
         Log("Initializing new class repository.");
         repository = new CustomClassRepository();
         Store(container, repository);
     }
     else
     {
         Log("Found existing class repository: " + repository);
     }
     return repository;
 }
示例#11
0
 public CustomUidField(CustomClassRepository repository)
 {
     _repository = repository;
 }
示例#12
0
 public CustomUidField(CustomClassRepository repository)
 {
     _repository = repository;
 }
示例#13
0
		public CustomReflector(CustomClassRepository classRepository)
		{
			classRepository.Initialize(this);
			_classRepository = classRepository;
		}
示例#14
0
 public CustomReflector(CustomClassRepository classRepository)
 {
     classRepository.Initialize(this);
     _classRepository = classRepository;
 }