public void Parse() { Assert.That(EntityCacheUsageParser.Parse("read-only"), Is.EqualTo(EntityCacheUsage.Readonly)); Assert.That(EntityCacheUsageParser.Parse("read-write"), Is.EqualTo(EntityCacheUsage.ReadWrite)); Assert.That(EntityCacheUsageParser.Parse("nonstrict-read-write"), Is.EqualTo(EntityCacheUsage.NonStrictReadWrite)); Assert.That(EntityCacheUsageParser.Parse("transactional"), Is.EqualTo(EntityCacheUsage.Transactional)); }
private void Parse(XPathNavigator collectionCacheElement) { if (collectionCacheElement.MoveToFirstAttribute()) { do { switch (collectionCacheElement.Name) { case "collection": if (string.IsNullOrWhiteSpace(collectionCacheElement.Value)) { throw new HibernateConfigException("Invalid collection-cache element; the attribute <collection> must be assigned with no empty value"); } collection = collectionCacheElement.Value; break; case "usage": usage = EntityCacheUsageParser.Parse(collectionCacheElement.Value); break; case "region": region = collectionCacheElement.Value; break; } }while (collectionCacheElement.MoveToNextAttribute()); } }
private void Parse(XPathNavigator classCacheElement) { if (classCacheElement.MoveToFirstAttribute()) { do { switch (classCacheElement.Name) { case "class": if (string.IsNullOrWhiteSpace(classCacheElement.Value)) { throw new HibernateConfigException("Invalid class-cache element; the attribute <class> must be assigned with no empty value"); } clazz = classCacheElement.Value; break; case "usage": usage = EntityCacheUsageParser.Parse(classCacheElement.Value); break; case "region": region = classCacheElement.Value; break; case "include": include = CfgXmlHelper.ClassCacheIncludeConvertFrom(classCacheElement.Value); break; } }while (classCacheElement.MoveToNextAttribute()); } }