Class RelationalSqlWrapper<TOptions>
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Mars.Core.Data.Wrapper.Relational
Assembly: Mars.Core.dll
Syntax
public abstract class RelationalSqlWrapper<TOptions> : AbstractWrapper<TOptions>, IWrapper, IDisposable where TOptions : RelationalEndpointOptions
Type Parameters
| Name | Description |
|---|---|
| TOptions |
Constructors
| Improve this Doc View SourceRelationalSqlWrapper(IConfigLoader, ISerializerManager, TOptions)
Creates a new instance of ths AbstractWrapper<TOptions>, implementing
the IWrapper contract.
Declaration
protected RelationalSqlWrapper(IConfigLoader config, ISerializerManager serializer, TOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| IConfigLoader | config | The result adapter root inputConfiguration object. |
| ISerializerManager | serializer | The serializer endpoint to access the model without any reflection. |
| TOptions | options | The options object to access the PostgreSQL database. |
Properties
| Improve this Doc View SourceBuilder
Gets or sets the connection string
Declaration
public DbConnectionStringBuilder Builder { get; }
Property Value
| Type | Description |
|---|---|
| System.Data.Common.DbConnectionStringBuilder |
Connection
Gets the connection to be used when accessing the relational database.
Declaration
public abstract IDbConnection Connection { get; }
Property Value
| Type | Description |
|---|---|
| System.Data.IDbConnection |
Remarks
Needs to be implemented with the custom provider System.Data.IDbConnection implementation.
Use the Options to get access to the connection string.
|
Improve this Doc
View Source
MigrationProvider
Gets or sets the schema migration provider, when this mapper is need to prepare a database model.
Declaration
public abstract ISchemaMigrationProvider MigrationProvider { get; }
Property Value
| Type | Description |
|---|---|
| ISchemaMigrationProvider |
Methods
| Improve this Doc View SourceCreateBuilder()
Creates and gets the custom connection builder with custom connection infos.
Declaration
protected abstract DbConnectionStringBuilder CreateBuilder()
Returns
| Type | Description |
|---|---|
| System.Data.Common.DbConnectionStringBuilder | Returns a new connection string builder. |
GetEntityName(IOutputLogger)
Declaration
protected virtual object GetEntityName(IOutputLogger proxy)
Parameters
| Type | Name | Description |
|---|---|---|
| IOutputLogger | proxy |
Returns
| Type | Description |
|---|---|
| System.Object |
GetInsertStatement(IGeneratedTypeLogger)
Declaration
protected string GetInsertStatement(IGeneratedTypeLogger proxy)
Parameters
| Type | Name | Description |
|---|---|---|
| IGeneratedTypeLogger | proxy |
Returns
| Type | Description |
|---|---|
| System.String |
GetRelation(IGeneratedTypeLogger)
Gets the relation schema for the specified type in form of
(ID, X, Y, Tick, Step, DateTime (when exist), ... output properties ordered by their name)
Declaration
protected string GetRelation(IGeneratedTypeLogger proxy)
Parameters
| Type | Name | Description |
|---|---|---|
| IGeneratedTypeLogger | proxy | The type manager proxy. |
Returns
| Type | Description |
|---|---|
| System.String | Returns the relation schema as a string. |
MigrateSchema(IGeneratedLayerLogger)
Applies a schema migration when the mapper requires that.
Declaration
public override void MigrateSchema(IGeneratedLayerLogger logger)
Parameters
| Type | Name | Description |
|---|---|---|
| IGeneratedLayerLogger | logger | The encapsulated layer. |
Overrides
| Improve this Doc View SourceMigrateSchema(IGeneratedTypeLogger)
Applies a schema migration when the mapper requires that.
Declaration
public override void MigrateSchema(IGeneratedTypeLogger logger)
Parameters
| Type | Name | Description |
|---|---|---|
| IGeneratedTypeLogger | logger | The encapsulated entity manager for each entity. |
Overrides
| Improve this Doc View SourceSaveSnapshot(Int64, IGeneratedLayerLogger)
This method applies the write operation of the specified
for the
associated to the
.
Declaration
public override void SaveSnapshot(long currentTick, IGeneratedLayerLogger layerProxy)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int64 | currentTick | The current simulation tick |
| IGeneratedLayerLogger | layerProxy | The considered layer instance to write a snapshot for |
Overrides
Exceptions
| Type | Condition |
|---|---|
| System.ApplicationException | No implementation |
SaveSnapshot(Int64, IGeneratedTypeLogger)
This method applies the write operation on each entity associated to the
and
or can be override to keep control of the entity serialization.
In contrast to SaveSnapshotByType(Int64, IGeneratedTypeLogger) this method has already been checked,
whether the
type
shall be serialized.
Declaration
public override void SaveSnapshot(long currentTick, IGeneratedTypeLogger typeLogger)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int64 | currentTick | The current simulation tick |
| IGeneratedTypeLogger | typeLogger | The considered entity type to write a snapshot for |
Overrides
| Improve this Doc View SourceSetup()
Indicates that the application is now starting and the model was initialized.
Resource and connections can be acquired.
Declaration
public override void Setup()
Overrides
Mars.Core.Data.Wrapper.AbstractWrapper<TOptions>.Setup()
Implements
System.IDisposable