Пример #1
0
 /// <summary>
 /// The SQL required to create the database objects for a SequenceGenerator.
 /// </summary>
 /// <param name="dialect">The <see cref="Dialect.Dialect"/> to help with creating the sql.</param>
 /// <returns>
 /// An array of <see cref="String"/> objects that contain the Dialect specific sql to
 /// create the necessary database objects for the SequenceGenerator.
 /// </returns>
 public string[] SqlCreateStrings(Dialect.Dialect dialect)
 {
     return(new string[]
     {
         dialect.GetCreateSequenceString(sequenceName)
     });
 }
Пример #2
0
        /// <summary>
        /// The SQL required to create the database objects for a SequenceGenerator.
        /// </summary>
        /// <param name="dialect">The <see cref="Dialect.Dialect"/> to help with creating the sql.</param>
        /// <returns>
        /// An array of <see cref="String"/> objects that contain the Dialect specific sql to
        /// create the necessary database objects for the SequenceGenerator.
        /// </returns>
        public string[] SqlCreateStrings(Dialect.Dialect dialect)
        {
            string baseDDL   = dialect.GetCreateSequenceString(sequenceName);
            string paramsDDL = null;

            if (parameters != null)
            {
                paramsDDL = ' ' + parameters;
            }
            return(new string[] { string.Concat(baseDDL, paramsDDL) });
        }
Пример #3
0
        public string[] SqlCreateStrings(Dialect.Dialect dialect)
        {
            int sourceIncrementSize = _applyIncrementSizeToSourceValues ? _incrementSize : 1;

            // If pooled sequences aren't supported, but needed here, the dialect will throw, which is
            // ok, since the SequenceStyleGenerator is responsible for not using us in that case.

            if (_initialValue > 1 || sourceIncrementSize > 1)
            {
                return(dialect.GetCreateSequenceStrings(_sequenceName, _initialValue, sourceIncrementSize));
            }
            else
            {
                return new[] { dialect.GetCreateSequenceString(_sequenceName) }
            };
        }