Exemple #1
0
        public virtual object GetNextSequence()
        {
            object id = null;

            if (Profile.IsIdentity && !PersistenceHelper.GeneratesIdentity(UnitOfWork.DBMS))
            {
                string sql = AdoNetHelper.GetSequenceSql(UnitOfWork.DBMS, this.GetType().Name);
                id = Session.CreateSQLQuery(sql).UniqueResult <object>();
            }

            return(id);
        }
Exemple #2
0
        public virtual object GetNextSequence()
        {
            object id = null;

            if (Profile.IsIdentity && !PersistenceHelper.GeneratesIdentity(UnitOfWork.DBMS))
            {
                string sql = AdoNetHelper.GetSequenceSql(UnitOfWork.DBMS, this.GetType().Name);
                if (!String.IsNullOrEmpty(sql))
                {
                    id = Context.Database.SqlQuery <object>(sql);
                }
            }

            return(id);
        }
Exemple #3
0
        public virtual object GetNextSequence()
        {
            object id = null;

            if (Profile.IsIdentity && !PersistenceHelper.GeneratesIdentity(UnitOfWork.DBMS))
            {
                string sql = AdoNetHelper.GetSequenceSql(UnitOfWork.DBMS, this.GetType().Name);
                Connection.Command.CommandType = CommandType.Text;
                Connection.Command.CommandText = sql;

                id = Connection.Command.ExecuteScalar();
            }

            return(id);
        }