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); }
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); }
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); }