private void HandleCustomSQL(ICollectionSqlsMapping collection, Mapping.Collection model)
		{
			var sqlInsert = collection.SqlInsert;
			if (sqlInsert != null)
			{
				bool callable = sqlInsert.callableSpecified && sqlInsert.callable;
				model.SetCustomSQLInsert(sqlInsert.Text.LinesToString(), callable, GetResultCheckStyle(sqlInsert));
			}

			var sqlDelete = collection.SqlDelete;
			if (sqlDelete != null)
			{
				bool callable = sqlDelete.callableSpecified && sqlDelete.callable;
				model.SetCustomSQLDelete(sqlDelete.Text.LinesToString(), callable, GetResultCheckStyle(sqlDelete));
			}

			var sqlUpdate = collection.SqlUpdate;
			if (sqlUpdate != null)
			{
				bool callable = sqlUpdate.callableSpecified && sqlUpdate.callable;
				model.SetCustomSQLUpdate(sqlUpdate.Text.LinesToString(), callable, GetResultCheckStyle(sqlUpdate));
			}

			var sqlDeleteAll = collection.SqlDeleteAll;
			if (sqlDeleteAll != null)
			{
				bool callable = sqlDeleteAll.callableSpecified && sqlDeleteAll.callable;
				model.SetCustomSQLDeleteAll(sqlDeleteAll.Text.LinesToString(), callable, GetResultCheckStyle(sqlDeleteAll));
			}
		}
示例#2
0
		private void HandleCustomSQL(XmlNode node, Mapping.Collection model)
		{
			XmlNode element = node.SelectSingleNode(HbmConstants.nsSqlInsert, namespaceManager);

			if (element != null)
			{
				bool callable = IsCallable(element);
				model.SetCustomSQLInsert(element.InnerText.Trim(), callable, GetResultCheckStyle(element, callable));
			}

			element = node.SelectSingleNode(HbmConstants.nsSqlDelete, namespaceManager);
			if (element != null)
			{
				bool callable = IsCallable(element);
				model.SetCustomSQLDelete(element.InnerText.Trim(), callable, GetResultCheckStyle(element, callable));
			}

			element = node.SelectSingleNode(HbmConstants.nsSqlUpdate, namespaceManager);
			if (element != null)
			{
				bool callable = IsCallable(element);
				model.SetCustomSQLUpdate(element.InnerText.Trim(), callable, GetResultCheckStyle(element, callable));
			}

			element = node.SelectSingleNode(HbmConstants.nsSqlDeleteAll, namespaceManager);
			if (element != null)
			{
				bool callable = IsCallable(element);
				model.SetCustomSQLDeleteAll(element.InnerText.Trim(), callable, GetResultCheckStyle(element, callable));
			}
		}