Ejemplo n.º 1
0
 private void getNames(
     ref string name,
     ref string owner
     )
 {
     Sql.Schema s = Sql.Schema.GetSnapshotSchema(m_ObjectTag.SnapshotId, m_ObjectTag.DatabaseId, m_ObjectTag.ObjectId);
     name  = m_ObjectTag.DatabaseName + "." + m_ObjectTag.ObjectName;
     owner = s.OwnerName;
 }
Ejemplo n.º 2
0
            public IList <Reference> Execute(IClass objectType, int count)
            {
                IObjectType exclusiveLeafClass = objectType.ExclusiveClass;

                Sql.Schema schema = this.Database.Schema;

                NpgsqlCommand command;

                if (!this.commandByObjectType.TryGetValue(exclusiveLeafClass, out command))
                {
                    command             = this.Session.CreateNpgsqlCommand(Sql.Schema.AllorsPrefix + "COS_" + exclusiveLeafClass.SingularName);
                    command.CommandType = CommandType.StoredProcedure;
                    this.AddInObject(command, schema.TypeId.Param, objectType.Id);
                    this.AddInObject(command, schema.CountParam, count);

                    this.commandByObjectType[exclusiveLeafClass] = command;
                }
                else
                {
                    this.SetInObject(command, schema.TypeId.Param, objectType.Id);
                    this.SetInObject(command, schema.CountParam, count);
                }

                var objectIds = new List <object>();

                using (DbDataReader reader = command.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        object id = long.Parse(reader[0].ToString());
                        objectIds.Add(id);
                    }
                }

                var strategies = new List <Reference>();

                foreach (object id in objectIds)
                {
                    long objectId    = long.Parse(id.ToString());
                    var  strategySql = this.Session.CreateAssociationForNewObject(objectType, objectId);
                    strategies.Add(strategySql);
                }

                return(strategies);
            }
Ejemplo n.º 3
0
 public SchemaParameter(Sql.Schema schema, string name, DbType type)
     : base(schema, name, type)
 {
 }