Exemplo n.º 1
0
        public SqlStatement(SqlParameterClause sqlParameterClause, SqlSelectClause sqlSelectClause, Type type)
        {
            this.m_SqlParameterClause = sqlParameterClause;
            this.m_SqlSelectClause = sqlSelectClause;

            this.m_SqlFromClause = new SqlFromClause(type);
            this.m_SqlWhereClause = new SqlWhereClause(type);
            this.m_SqlForXMLClause = new SqlForXMLClause(type);
        }
Exemplo n.º 2
0
        public SqlStatement(SqlParameterClause sqlParameterClause, SqlSelectClause sqlSelectClause, Type type)
        {
            this.m_SqlParameterClause = sqlParameterClause;
            this.m_SqlSelectClause    = sqlSelectClause;

            this.m_SqlFromClause   = new SqlFromClause(type);
            this.m_SqlWhereClause  = new SqlWhereClause(type);
            this.m_SqlForXMLClause = new SqlForXMLClause(type);
        }
Exemplo n.º 3
0
        public SqlCommand Build()
        {
            SqlCommand cmd = new SqlCommand();
            PersistentClass persistentClassAttribute = (PersistentClass)this.m_Type.GetCustomAttributes(typeof(PersistentClass), false).Single();

            PropertyInfo primaryKeyPropertyInfo = this.m_Type.GetProperties().Where(prop => Attribute.IsDefined(prop, typeof(PersistentPrimaryKeyProperty))).Single();
            StringPropertyBridge primaryKeyPropertyBridge = new StringPropertyBridge(primaryKeyPropertyInfo, this.m_PrimaryKeyValue);
            primaryKeyPropertyBridge.SetSqlParameter(cmd);

            SqlSelectClause sqlSelect = new SqlSelectClause(this.m_Type);

            SqlParameterClause sqlParameterStatement = new SqlParameterClause(this.m_Type, this.m_PrimaryKeyValue);
            SqlStatement sqlStatement = new SqlStatement(sqlParameterStatement, sqlSelect, this.m_Type);

            cmd.CommandText = sqlStatement.ToString();
            return cmd;
        }
Exemplo n.º 4
0
        public SqlCommand Build()
        {
            SqlCommand      cmd = new SqlCommand();
            PersistentClass persistentClassAttribute = (PersistentClass)this.m_Type.GetCustomAttributes(typeof(PersistentClass), false).Single();

            PropertyInfo         primaryKeyPropertyInfo   = this.m_Type.GetProperties().Where(prop => Attribute.IsDefined(prop, typeof(PersistentPrimaryKeyProperty))).Single();
            StringPropertyBridge primaryKeyPropertyBridge = new StringPropertyBridge(primaryKeyPropertyInfo, this.m_PrimaryKeyValue);

            primaryKeyPropertyBridge.SetSqlParameter(cmd);

            SqlSelectClause sqlSelect = new SqlSelectClause(this.m_Type);

            SqlParameterClause sqlParameterStatement = new SqlParameterClause(this.m_Type, this.m_PrimaryKeyValue);
            SqlStatement       sqlStatement          = new SqlStatement(sqlParameterStatement, sqlSelect, this.m_Type);

            cmd.CommandText = sqlStatement.ToString();
            return(cmd);
        }