MergeJoinFilter MergeJoinFilter MergeJoinFilter Class

정의

병합 아티클 간의 조인 필터 또는 논리적 레코드 관계를 나타냅니다. Represents a join filter or logical record relationship between to merge articles.

public ref class MergeJoinFilter sealed
public sealed class MergeJoinFilter
Public NotInheritable Class MergeJoinFilter
상속
MergeJoinFilterMergeJoinFilterMergeJoinFilter

예제

// Define the Publisher and publication names.
string publisherName = publisherInstance;
string publicationName = "AdvWorksSalesOrdersMerge";
string publicationDbName = "AdventureWorks2012";

// Specify article names.
string articleName1 = "Employee";
string articleName2 = "SalesOrderHeader";
string articleName3 = "SalesOrderDetail";

// Specify join filter information.
string filterName12 = "SalesOrderHeader_Employee";
string filterClause12 = "Employee.EmployeeID = " +
	"SalesOrderHeader.SalesPersonID";
string filterName23 = "SalesOrderDetail_SalesOrderHeader";
string filterClause23 = "SalesOrderHeader.SalesOrderID = " +
	"SalesOrderDetail.SalesOrderID";

string salesSchema = "Sales";
string hrSchema = "HumanResources";

MergeArticle article1 = new MergeArticle();
MergeArticle article2 = new MergeArticle();
MergeArticle article3 = new MergeArticle();
MergeJoinFilter filter12 = new MergeJoinFilter();
MergeJoinFilter filter23 = new MergeJoinFilter();

// Create a connection to the Publisher.
ServerConnection conn = new ServerConnection(publisherName);

// Create three merge articles that are horizontally partitioned
// using a parameterized row filter on Employee.EmployeeID, which is 
// extended to the two other articles using join filters. 
try
{
	// Connect to the Publisher.
	conn.Connect();

	// Create each article. 
	// For clarity, each article is defined separately. 
	// In practice, iterative structures and arrays should 
	// be used to efficiently create multiple articles.

	// Set the required properties for the Employee article.
	article1.ConnectionContext = conn;
	article1.Name = articleName1;
	article1.DatabaseName = publicationDbName;
	article1.SourceObjectName = articleName1;
	article1.SourceObjectOwner = hrSchema;
	article1.PublicationName = publicationName;
	article1.Type = ArticleOptions.TableBased;

	// Define the parameterized filter clause based on Hostname.
	article1.FilterClause = "Employee.LoginID = HOST_NAME()";

	// Set the required properties for the SalesOrderHeader article.
	article2.ConnectionContext = conn;
	article2.Name = articleName2;
	article2.DatabaseName = publicationDbName;
	article2.SourceObjectName = articleName2;
	article2.SourceObjectOwner = salesSchema;
	article2.PublicationName = publicationName;
	article2.Type = ArticleOptions.TableBased;

	// Set the required properties for the SalesOrderDetail article.
	article3.ConnectionContext = conn;
	article3.Name = articleName3;
	article3.DatabaseName = publicationDbName;
	article3.SourceObjectName = articleName3;
	article3.SourceObjectOwner = salesSchema;
	article3.PublicationName = publicationName;
	article3.Type = ArticleOptions.TableBased;

	if (!article1.IsExistingObject) article1.Create();
	if (!article2.IsExistingObject) article2.Create();
	if (!article3.IsExistingObject) article3.Create();

	// Select published columns for SalesOrderHeader.
	// Create an array of column names to vertically filter out.
	// In this example, only one column is removed.
	String[] columns = new String[1];

	columns[0] = "CreditCardApprovalCode";

	// Remove the column.
	article2.RemoveReplicatedColumns(columns);

	// Define a merge filter clauses that filter 
	// SalesOrderHeader based on Employee and 
	// SalesOrderDetail based on SalesOrderHeader. 

	// Parent article.
	filter12.JoinArticleName = articleName1;
	// Child article.
	filter12.ArticleName = articleName2;
	filter12.FilterName = filterName12;
	filter12.JoinUniqueKey = true;
	filter12.FilterTypes = FilterTypes.JoinFilter;
	filter12.JoinFilterClause = filterClause12;

	// Add the join filter to the child article.
	article2.AddMergeJoinFilter(filter12);

	// Parent article.
	filter23.JoinArticleName = articleName2;
	// Child article.
	filter23.ArticleName = articleName3;
	filter23.FilterName = filterName23;
	filter23.JoinUniqueKey = true;
	filter23.FilterTypes = FilterTypes.JoinFilter;
	filter23.JoinFilterClause = filterClause23;

	// Add the join filter to the child article.
	article3.AddMergeJoinFilter(filter23);
}
catch (Exception ex)
{
	// Do error handling here and rollback the transaction.
	throw new ApplicationException(
		"The filtered articles could not be created", ex);
}
finally
{
	conn.Disconnect();
}
' Define the Publisher and publication names.
Dim publisherName As String = publisherInstance
Dim publicationName As String = "AdvWorksSalesOrdersMerge"
Dim publicationDbName As String = "AdventureWorks2012"

' Specify article names.
Dim articleName1 As String = "Employee"
Dim articleName2 As String = "SalesOrderHeader"
Dim articleName3 As String = "SalesOrderDetail"

' Specify join filter information.
Dim filterName12 As String = "SalesOrderHeader_Employee"
Dim filterClause12 As String = "Employee.EmployeeID = " + _
    "SalesOrderHeader.SalesPersonID"
Dim filterName23 As String = "SalesOrderDetail_SalesOrderHeader"
Dim filterClause23 As String = "SalesOrderHeader.SalesOrderID = " + _
    "SalesOrderDetail.SalesOrderID"

Dim salesSchema As String = "Sales"
Dim hrSchema As String = "HumanResources"

Dim article1 As MergeArticle = New MergeArticle()
Dim article2 As MergeArticle = New MergeArticle()
Dim article3 As MergeArticle = New MergeArticle()
Dim filter12 As MergeJoinFilter = New MergeJoinFilter()
Dim filter23 As MergeJoinFilter = New MergeJoinFilter()

' Create a connection to the Publisher.
Dim conn As ServerConnection = New ServerConnection(publisherName)

' Create three merge articles that are horizontally partitioned
' using a parameterized row filter on Employee.EmployeeID, which is 
' extended to the two other articles using join filters. 
Try
    ' Connect to the Publisher.
    conn.Connect()

    ' Create each article. 
    ' For clarity, each article is defined separately. 
    ' In practice, iterative structures and arrays should 
    ' be used to efficiently create multiple articles.

    ' Set the required properties for the Employee article.
    article1.ConnectionContext = conn
    article1.Name = articleName1
    article1.DatabaseName = publicationDbName
    article1.SourceObjectName = articleName1
    article1.SourceObjectOwner = hrSchema
    article1.PublicationName = publicationName
    article1.Type = ArticleOptions.TableBased

    ' Define the parameterized filter clause based on Hostname.
    article1.FilterClause = "Employee.LoginID = HOST_NAME()"

    ' Set the required properties for the SalesOrderHeader article.
    article2.ConnectionContext = conn
    article2.Name = articleName2
    article2.DatabaseName = publicationDbName
    article2.SourceObjectName = articleName2
    article2.SourceObjectOwner = salesSchema
    article2.PublicationName = publicationName
    article2.Type = ArticleOptions.TableBased

    ' Set the required properties for the SalesOrderDetail article.
    article3.ConnectionContext = conn
    article3.Name = articleName3
    article3.DatabaseName = publicationDbName
    article3.SourceObjectName = articleName3
    article3.SourceObjectOwner = salesSchema
    article3.PublicationName = publicationName
    article3.Type = ArticleOptions.TableBased

    ' Create the articles, if they do not already exist.
    If article1.IsExistingObject = False Then
        article1.Create()
    End If
    If article2.IsExistingObject = False Then
        article2.Create()
    End If
    If article3.IsExistingObject = False Then
        article3.Create()
    End If

    ' Select published columns for SalesOrderHeader.
    ' Create an array of column names to vertically filter out.
    ' In this example, only one column is removed.
    Dim columns() As String = New String(0) {}

    columns(0) = "CreditCardApprovalCode"

    ' Remove the column.
    article2.RemoveReplicatedColumns(columns)

    ' Define a merge filter clauses that filter 
    ' SalesOrderHeader based on Employee and 
    ' SalesOrderDetail based on SalesOrderHeader. 

    ' Parent article.
    filter12.JoinArticleName = articleName1
    ' Child article.
    filter12.ArticleName = articleName2
    filter12.FilterName = filterName12
    filter12.JoinUniqueKey = True
    filter12.FilterTypes = FilterTypes.JoinFilter
    filter12.JoinFilterClause = filterClause12

    ' Add the join filter to the child article.
    article2.AddMergeJoinFilter(filter12)

    ' Parent article.
    filter23.JoinArticleName = articleName2
    ' Child article.
    filter23.ArticleName = articleName3
    filter23.FilterName = filterName23
    filter23.JoinUniqueKey = True
    filter23.FilterTypes = FilterTypes.JoinFilter
    filter23.JoinFilterClause = filterClause23

    ' Add the join filter to the child article.
    article3.AddMergeJoinFilter(filter23)

Catch ex As Exception
    ' Do error handling here and rollback the transaction.
    Throw New ApplicationException( _
        "The filtered articles could not be created", ex)
Finally
    conn.Disconnect()
End Try

설명

이 네임 스페이스, 클래스 또는 멤버의 버전 2.0 에서만에서 지원 됩니다는 Microsoft .NET Framework입니다.This namespace, class, or member is supported only in version 2.0 of the Microsoft .NET Framework.

스레드 보안Thread Safety

모든 public static (Shared 에 Microsoft Visual Basic)이 형식의 멤버는 다중 스레드 작업에 안전 합니다.Any public static (Shared in Microsoft Visual Basic) members of this type are safe for multithreaded operations. 인스턴스 구성원은 스레드로부터의 안전성이 보장되지 않습니다.Any instance members are not guaranteed to be thread safe.

생성자

MergeJoinFilter() MergeJoinFilter() MergeJoinFilter()

MergeJoinFilter 클래스의 새 인스턴스를 만듭니다. Create a new instance of the MergeJoinFilter class.

속성

ArticleName ArticleName ArticleName

조인 필터로 필터링된 자식 아티클의 이름을 가져오거나 설정합니다. Gets or sets the name of the child article filtered by the join filter.

BaseTableName BaseTableName BaseTableName

아티클이 필터링되는 테이블 개체의 이름을 가져오거나 설정합니다. Gets or sets the name of the table object against which the article is filtered.

BaseTableOwner BaseTableOwner BaseTableOwner

아티클이 필터링되는 테이블 개체의 소유자를 가져오거나 설정합니다. Gets or sets the owner of the table object against which the article is filtered.

FilterName FilterName FilterName

병합 아티클 조인 필터의 이름을 가져오거나 설정합니다. Gets or sets the name of the merge article join filter.

FilterTypes FilterTypes FilterTypes

병합 조인 필터의 유형을 가져오거나 설정합니다. Gets or sets the type of merge join filter.

JoinArticleName JoinArticleName JoinArticleName

필터링된 아티클이 조인되는 부모 아티클의 이름을 가져오거나 설정합니다. Gets or sets the name of the parent article to which the filtered article is joined.

JoinFilterClause JoinFilterClause JoinFilterClause

ArticleName에 지정된 자식 아티클을 JoinArticleName에 지정된 부모 아티클에 조인하여 자식 아티클을 필터링하는 절을 가져오거나 설정합니다. Gets or sets the clause that joins the child article, specified by ArticleName, to the parent article, specified by JoinArticleName, to filter the child article.

JoinFilterId JoinFilterId JoinFilterId

조인 필터 또는 논리적 레코드 관계의 ID를 가져오거나 설정합니다. Gets or sets the ID of the join filter or logical record relationship.

JoinTableName JoinTableName JoinTableName

부모 아티클의 기본 테이블에 조인된 자식 아티클의 원본 테이블 이름을 가져오거나 설정합니다. Gets or sets the name of the source table for the child article that is joined to the base table for the parent article.

JoinTableOwner JoinTableOwner JoinTableOwner

부모 아티클의 기본 테이블에 조인된 자식 아티클의 원본 테이블 소유자를 가져오거나 설정합니다. Gets or sets the owner of the source table for the child article that is joined to the base table for the parent article.

JoinUniqueKey JoinUniqueKey JoinUniqueKey

ArticleName에 지정된 자식 아티클과 JoinArticleName에 지정된 부모 아티클 간의 조인이 일 대 다, 일 대 일, 다 대 일 또는 다 대 다 관계 중 무엇에 해당하는지 가져오거나 설정합니다. Gets or sets whether the join between the child article, specified by ArticleName, and the parent article, specified by JoinArticleName, is one-to-many, one-to-one, many-to-one, or many-to-many.

UserData UserData UserData

사용자가 자신의 고유 데이터를 이 개체에 연결할 수 있도록 하는 속성을 가져오거나 설정합니다. Gets or sets a property that allows users to attach their own data to this object.

적용 대상

추가 정보