예제 #1
0
 /// <summary>
 /// Retrieve one or records collection with a custom command type.
 /// </summary>
 /// <param name="map"></param>
 /// <param name="type"></param>
 /// <param name="cmdType"></param>
 /// <param name="returnCollection"></param>
 /// <returns></returns>
 protected override PersistenceCommand MakeRetrieveCommand(Map map, Type type, string cmdType, bool returnCollection)
 {
     SqlServerPersistenceCommand pcmd = null;
     SqlCommand cmd = ((SqlConnection)ProviderConnection).CreateCommand();
     cmd.CommandType = CommandType.StoredProcedure;
     pcmd = new SqlServerRetrieveCommand(map, cmdType, cmd, type, ConcurrencySupport, returnCollection);
     return pcmd;
 }
예제 #2
0
        /// <summary>
        /// Factory method to return a retrieve command with concurrency support.
        /// </summary>
        /// <param name="connectionString"></param>
        /// <param name="map"></param>
        /// <param name="oid"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        protected override PersistenceCommand MakeRetrieveCommand(Map map, ObjectIdentifier oid, Type type)
        {
            SqlServerPersistenceCommand pcmd = null;
            SqlCommand cmd = ((SqlConnection)ProviderConnection).CreateCommand();
            cmd.CommandType = CommandType.StoredProcedure;

            if (ConcurrencySupport == ConcurrencySupportType.None)
                pcmd = new SqlServerRetrieveCommand(map, oid, cmd, type);
            else if (ConcurrencySupport == ConcurrencySupportType.Optimistic)
                pcmd = new SqlServerRetrieveCommand(map, oid, cmd, type, CRUD.RetrieveWithTimestamp);
            else if (ConcurrencySupport == ConcurrencySupportType.PessimisticUniqueIdentifier || ConcurrencySupport == ConcurrencySupportType.PessimisticUserName)
                pcmd = new SqlServerRetrieveCommand(map, oid, cmd, type, CRUD.RetrieveAndLock);
            return pcmd;
        }
예제 #3
0
 /// <summary>
 /// Retrieve all command, based on type.
 /// </summary>
 /// <param name="map"></param>
 /// <param name="type"></param>
 /// <returns></returns>
 protected override PersistenceCommand MakeRetrieveCommand(Map map, Type type)
 {
     SqlServerPersistenceCommand pcmd = null;
     SqlCommand cmd = ((SqlConnection)ProviderConnection).CreateCommand();
     cmd.CommandType = CommandType.StoredProcedure;
     pcmd = new SqlServerRetrieveCommand(map, type, cmd);
     return pcmd;
 }