Beispiel #1
0
        protected internal void GetStoredProcNames()
        {
            var sqlNodes = _hbmXml.SelectNodes(CreateXpath(HbmXmlNames.HIBERNATE_MAPPING, HbmXmlNames.SQL_QUERY), _nsMgr);

            if (sqlNodes == null)
            {
                return;
            }
            foreach (
                var sp in
                sqlNodes.Cast <XmlElement>()
                .Where(
                    t =>
                    t != null && t.HasAttributes && t.Attributes[HbmXmlNames.NAME] != null &&
                    !string.IsNullOrWhiteSpace(t.Attributes[HbmXmlNames.NAME].Value)))
            {
                var spName      = sp.Attributes[HbmXmlNames.NAME].Value;
                var spSqlSyntax = sp.InnerText;
                if (string.IsNullOrWhiteSpace(spSqlSyntax))
                {
                    continue;
                }

                string   spDbName;
                string[] spParamNames;
                if (!StoredProcMetadata.TryParseToHbmSql(spSqlSyntax, out spDbName, out spParamNames))
                {
                    continue;
                }
                _spConstNames.Add(new HbmStoredProxNames
                {
                    CallableName = spName,
                    DbName       = spDbName,
                    ParamNames   = spParamNames
                });
            }
        }