示例#1
0
vector<pair<int, bool>> ERModel::reBuildPrimaryKey( Component* oldAttributeNode, int newEntityNodeID, int newAttributeNodeID )
{
	vector<pair<int, bool>> reBuildPrimaryKeySet;
	vector<int> primaryKey;
	NodeAttribute* tempOldAttributeNode = static_cast<NodeAttribute*>(oldAttributeNode);
	if (tempOldAttributeNode->getIsPrimaryKey())
	{
		primaryKey.push_back(newAttributeNodeID);
		setPrimaryKey(newEntityNodeID, primaryKey);
		reBuildPrimaryKeySet.push_back(make_pair(newAttributeNodeID, true));
		return reBuildPrimaryKeySet;
	}
	return reBuildPrimaryKeySet;
}
示例#2
0
bool ERModel::getTargetAttributeIsPrimaryKey( int targetNodeID )
{
	NodeAttribute* targetAttribute = static_cast<NodeAttribute*>(searchComponent(targetNodeID));

	return targetAttribute->getIsPrimaryKey();
}