public MyContext(CustomClassRepository repository, IObjectContainer metadata, IObjectContainer
				 data)
			{
				this.repository = repository;
				this.metadata = metadata;
				this.data = data;
			}
Ejemplo n.º 2
0
 public MyContext(CustomClassRepository repository, IObjectContainer metadata, IObjectContainer
                  data)
 {
     this.repository = repository;
     this.metadata   = metadata;
     this.data       = data;
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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;
 }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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;
 }
Ejemplo n.º 11
0
 public CustomUidField(CustomClassRepository repository)
 {
     _repository = repository;
 }
Ejemplo n.º 12
0
 public CustomUidField(CustomClassRepository repository)
 {
     _repository = repository;
 }
Ejemplo n.º 13
0
		public CustomReflector(CustomClassRepository classRepository)
		{
			classRepository.Initialize(this);
			_classRepository = classRepository;
		}
Ejemplo n.º 14
0
 public CustomReflector(CustomClassRepository classRepository)
 {
     classRepository.Initialize(this);
     _classRepository = classRepository;
 }