public MyContext(CustomClassRepository repository, IObjectContainer metadata, IObjectContainer data) { this.repository = repository; this.metadata = metadata; this.data = data; }
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); }
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); }
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); } }
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; }
public CustomUidField(CustomClassRepository repository) { _repository = repository; }
public CustomReflector(CustomClassRepository classRepository) { classRepository.Initialize(this); _classRepository = classRepository; }