Ejemplo n.º 1
0
 //7 SQL PC constructor
 ////Create a custom command with multiple custom criterias. Collection and IPersistable support 
 public SqlServerRetrieveCommand(Map map, string cmdType, SqlCommand command, Type type, ConcurrencySupportType concurrency, bool returnCollection, IList<object> criterias)
     : base(map, cmdType, command, concurrency, returnCollection)
 {
     _criterias = new List<object>();
     _criterias = criterias;
     _type = type;
 }
Ejemplo n.º 2
0
 public PersistenceServer(string connectionString, string connectionName, ConcurrencySupportType concurrency)
 {
     _concurrency = concurrency;
     _connectionString = connectionString;
     _providerConnection = MakeProviderConnection();
     if(connectionName != string.Empty)
         StoreConnectionString(_connectionString, connectionName);
 }
Ejemplo n.º 3
0
 //used for Retrieve and Delete with an OID, a custom command type and concurrency support
 public SqlServerPersistenceCommand(Map map, ObjectIdentifier oid, SqlCommand command, string cmdType, ConcurrencySupportType concurrency)
     : base(map, oid, command, cmdType, concurrency)
 {
 }
Ejemplo n.º 4
0
 //Used for Updates and Deletes with a persistent object, a custom command and concurrency suppport
 public SqlServerPersistenceCommand(Map map, IPersistable objectForProcess, SqlCommand command, string cmdType, ConcurrencySupportType concurrency)
     : base(map, objectForProcess, command, cmdType, concurrency)
 {
 }
Ejemplo n.º 5
0
 public PersistenceServer(string connectionName, ConcurrencySupportType concurrency)
 {
     if(connectionName == string.Empty)
         return;
     _concurrency = concurrency;
     _connectionName = connectionName;
     _connectionString = GetConnectionStringByName(connectionName);
     _providerConnection = MakeProviderConnection();
 }
Ejemplo n.º 6
0
 public PersistenceServer(object providerConnection, ConcurrencySupportType concurrency)
 {
     _providerConnection = providerConnection;
     _concurrency = concurrency;
 }
Ejemplo n.º 7
0
 //Retrieve all with a custom command
 public SqlServerRetrieveCommand(Map map, string cmdType, SqlCommand command, Type type, ConcurrencySupportType concurrency, bool returnCollection)
     : base(map, cmdType, command, concurrency, returnCollection)
 {
     _type = type;
 }
Ejemplo n.º 8
0
        /// <summary>
        /// PersistentObject for CRUD (Update and delete) operations, custom command and concurrency support.
        /// </summary>
        /// <param name="map"></param>
        /// <param name="objectForProcess"></param>
        /// <param name="providerCommand"></param>
        /// <param name="cmdType"></param>
        /// <param name="concurrency"></param>
        public PersistenceCommand(Map map, IPersistable objectForProcess, object providerCommand, string cmdType, ConcurrencySupportType concurrency)
        {
            _providerCommand = providerCommand;

            _cmdMap = map.GetCommandMap(cmdType); //must get the proper command instruction from the map
            _pObj = objectForProcess;

            SetConcurrencySupport(concurrency);
        }
Ejemplo n.º 9
0
 public SqlServerPersistenceServer(SqlConnection connection, ConcurrencySupportType concurrency)
     : base(connection, concurrency)
 {
 }
Ejemplo n.º 10
0
 public SqlServerPersistenceServer(string connectionName, ConcurrencySupportType concurrency)
     : base(connectionName, concurrency)
 {
 }
Ejemplo n.º 11
0
 protected void SetConcurrencySupport(ConcurrencySupportType concurrency)
 {
     if (concurrency == ConcurrencySupportType.None)
     {
         _optimisticField = string.Empty;
         _pessimisticField = string.Empty;
     }
     else if (concurrency == ConcurrencySupportType.Optimistic)
     {
         _optimisticField = PersistenceServiceConfiguration.Default.optimisticFieldName;
         _pessimisticField = string.Empty;
     }
     else if ((concurrency == ConcurrencySupportType.PessimisticUniqueIdentifier) || (concurrency == ConcurrencySupportType.PessimisticUserName))
     {
         _optimisticField = string.Empty;
         _pessimisticField = PersistenceServiceConfiguration.Default.pessimisticFieldName;
     }
 }
Ejemplo n.º 12
0
        /// <summary>
        /// PersistentCommand for custom commands, concurrency, collection and multiple processed objects support
        /// </summary>
        /// <param name="map"></param>
        /// <param name="cmdTypeIdentifier"></param>
        /// <param name="providerCommand"></param>
        /// <param name="concurrency"></param>
        /// <param name="returnCollection"></param>
        /// <param name="objectsForProcess"></param>
        public PersistenceCommand(Map map, string cmdTypeIdentifier, object providerCommand, ConcurrencySupportType concurrency, bool returnCollection, IDictionary<string,object> objectsForProcess)
        {
            _providerCommand = providerCommand;
            _cmdMap = map.GetCommandMap(cmdTypeIdentifier);   //get the custom command instruction from the map

            if(!returnCollection)
                _pObj = MakePersistable();
            _appObjs = objectsForProcess;
            SetConcurrencySupport(concurrency);
        }
Ejemplo n.º 13
0
        /// <summary>
        /// PersistentObject for retrieve operations, custom command and concurrency support.
        /// </summary>
        /// <param name="map"></param>
        /// <param name="oid"></param>
        /// <param name="providerCommand"></param>
        /// <param name="cmdType"></param>
        /// <param name="concurrency"></param>
        public PersistenceCommand(Map map, ObjectIdentifier oid, object providerCommand, string cmdType, ConcurrencySupportType concurrency)
        {
            _providerCommand = providerCommand;
            _pObj = MakePersistable(null, oid);// Retrieve operations need only the OID
            _cmdMap = map.GetCommandMap(cmdType);   //must get the proper command instruction from the map

            SetConcurrencySupport(concurrency);
        }
Ejemplo n.º 14
0
 //Used for Retrieve custom commands that return collections.
 public SqlServerPersistenceCommand(Map map, string cmdType, SqlCommand command, ConcurrencySupportType concurrency, bool returnCollection)
     : base(map, cmdType, command, concurrency, returnCollection)
 {
 }
Ejemplo n.º 15
0
 //Create a custom command with an OID
 public SqlServerRetrieveCommand(Map map, ObjectIdentifier oid, SqlCommand command, Type type, string cmdType, ConcurrencySupportType concurrency)
     : base(map, oid, command, cmdType, concurrency)
 {
     _type = type;
 }
Ejemplo n.º 16
0
 public SqlServerPersistenceCommand(Map map, string cmdTypeIdentifier, SqlCommand command, ConcurrencySupportType concurrency, bool returnCollection, IDictionary<string,object> objectsForProcess)
     : base(map, cmdTypeIdentifier, command, concurrency, returnCollection, objectsForProcess)
 {
 }
Ejemplo n.º 17
0
 //Needed for concurrency support with multiple objects and custom command
 public SqlServerTransactionCommand(Map map, SqlCommand command, string cmdType, ConcurrencySupportType concurrency, bool returnCollection, IDictionary<string,object> objectsForProcess)
     : base(map, cmdType, command, concurrency, returnCollection, objectsForProcess)
 {
 }