public SqlDbLoader(PersistentStorage ps, Type entityType, SqlConnection connection) { _entityType = entityType; _connection = connection; _mapper = new Mapper(_entityType); _ps = ps; }
public EntityFieldsMapper(Type entityType, PersistentStorage ps) { _ps = ps; ObjectDescription od = ClassFactory.GetObjectDescription(entityType, ps); foreach (PropertyDescription prop in od.Properties) { string dbPropName = ""; FieldNameAttribute attr = prop.GetAttribute <FieldNameAttribute>(); if (attr == null) { dbPropName = prop.Name; } else if (prop.ReflectedObject.GetAttribute <IdFieldNameAttribute>() != null && prop.ReflectedObject.GetAttribute <IdFieldNameAttribute>().Name == prop.Name) { dbPropName = prop.ReflectedObject.GetAttribute <IdFieldNameAttribute>().Name; } else { dbPropName = attr.FieldName; } _entityFieldsMapping.Add(prop.Name, dbPropName); _entityFieldsMappingInverse.Add(dbPropName, prop.Name); } }
public static void DeletePersistentStorage(string key) { lock (_ps) { PersistentStorage ps = _ps[key]; ps.Dispose(); _ps.Remove(key); } }
public static ObjectDescription GetObjectDescription(Type type, PersistentStorage ps) { lock (_metaObjects) { if (!_metaObjects.ContainsKey(type.ToString())) { _metaObjects.Add(type.ToString(), new ObjectDescription(type, ps)); } return(_metaObjects[type.ToString()]); } }
public static object CreateObject(Type type, PersistentStorage ps, params object[] args) { lock (_metaObjects) { if (!_metaObjects.ContainsKey(type.ToString())) { _metaObjects.Add(type.ToString(), new ObjectDescription(type, ps)); } return(_metaObjects[type.ToString()].CreateObject(args)); } }
public static T CreateObject <T>(PersistentStorage ps, params object[] args) { lock (_metaObjects) { if (!_metaObjects.ContainsKey(typeof(T).ToString())) { _metaObjects.Add(typeof(T).ToString(), new ObjectDescription(typeof(T), ps)); } T o = (T)_metaObjects[typeof(T).ToString()].CreateObject(args); (o as EntityBase).CreatorPs = ps; return(o); } }
public Mapper(Type entityType, PersistentStorage ps) { _ps = ps; _entityType = entityType; _entityFieldsMapper = new EntityFieldsMapper(EntityType, _ps); TableAttribute attr = ClassFactory.GetObjectDescription(_entityType, ps).DbTableAttribute; if (attr == null) { _tableName = entityType.Name; } else { _tableName = attr.TableName; } DbSchemaAttribute attr2 = ClassFactory.GetObjectDescription(_entityType, ps).GetAttribute <DbSchemaAttribute>(); if (attr2 != null) { _schemaName = attr2.SchemaName; } }
public MsSqlStorageAccessMediator(PersistentStorage ps, SqlConnection connection) { _connection = connection; _mediatorType = StorageAccessMediatorType.MsSql; _ps = ps; }
public static FacadeBuilder GetFacadeBuilder(Type entityType, PersistentStorage ps) { return(ps.GetFacadeBuilder(entityType)); }
public CachesContainer(PersistentStorage ps) { _ps = ps; }
public FacadeBuilder(Type entityType, PersistentStorage ps, string outputFileName) { _ps = ps; _facadeType = entityType; Build(outputFileName); }
public FacadeBuilder(Type entityType, PersistentStorage ps) { _ps = ps; _facadeType = entityType; Build(null); }