Skip to content

Commit

Permalink
Replaced all calls to IsSpecified in the xml writers with HasValue
Browse files Browse the repository at this point in the history
Signed-off-by: James Gregory <[email protected]>
  • Loading branch information
paulbatum authored and jagregory committed Jul 14, 2009
1 parent 463f57d commit a90ec86
Show file tree
Hide file tree
Showing 27 changed files with 131 additions and 131 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ protected XmlDocument WriteComponent(string element, ComponentMappingBase mappin
var doc = new XmlDocument();
var componentElement = doc.AddElement(element);

if (mapping.IsSpecified(x => x.Name))
if (mapping.HasValue(x => x.Name))
componentElement.WithAtt("name", mapping.Name);

if (mapping.IsSpecified(x => x.Insert))
if (mapping.HasValue(x => x.Insert))
componentElement.WithAtt("insert", mapping.Insert);

if (mapping.IsSpecified(x => x.Update))
if (mapping.HasValue(x => x.Update))
componentElement.WithAtt("update", mapping.Update);

if (mapping.IsSpecified(x => x.Access))
if (mapping.HasValue(x => x.Access))
componentElement.WithAtt("access", mapping.Access);

return doc;
Expand Down
14 changes: 7 additions & 7 deletions src/FluentNHibernate/MappingModel/Output/XmlAnyWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,25 @@ public override void ProcessAny(AnyMapping mapping)

var element = document.AddElement("any");

if (mapping.IsSpecified(x => x.Access))
if (mapping.HasValue(x => x.Access))
element.WithAtt("access", mapping.Access);

if (mapping.IsSpecified(x => x.Cascade))
if (mapping.HasValue(x => x.Cascade))
element.WithAtt("cascade", mapping.Cascade);

if (mapping.IsSpecified(x => x.IdType))
if (mapping.HasValue(x => x.IdType))
element.WithAtt("id-type", mapping.IdType);

if (mapping.IsSpecified(x => x.Insert))
if (mapping.HasValue(x => x.Insert))
element.WithAtt("insert", mapping.Insert);

if (mapping.IsSpecified(x => x.MetaType))
if (mapping.HasValue(x => x.MetaType))
element.WithAtt("meta-type", mapping.MetaType);

if (mapping.IsSpecified(x => x.Name))
if (mapping.HasValue(x => x.Name))
element.WithAtt("name", mapping.Name);

if (mapping.IsSpecified(x => x.Update))
if (mapping.HasValue(x => x.Update))
element.WithAtt("update", mapping.Update);
}

Expand Down
2 changes: 1 addition & 1 deletion src/FluentNHibernate/MappingModel/Output/XmlBagWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public override void ProcessBag(BagMapping mapping)

WriteBaseCollectionAttributes(element, mapping);

if (mapping.IsSpecified(x => x.OrderBy))
if (mapping.HasValue(x => x.OrderBy))
element.WithAtt("order-by", mapping.OrderBy);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/FluentNHibernate/MappingModel/Output/XmlCacheWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ public override void ProcessCache(CacheMapping mapping)

var element = document.AddElement("cache");

if (mapping.IsSpecified(x => x.Region))
if (mapping.HasValue(x => x.Region))
element.WithAtt("region", mapping.Region);

if (mapping.IsSpecified(x => x.Usage))
if (mapping.HasValue(x => x.Usage))
element.WithAtt("usage", mapping.Usage);
}
}
Expand Down
34 changes: 17 additions & 17 deletions src/FluentNHibernate/MappingModel/Output/XmlClassWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,55 +32,55 @@ public override void ProcessClass(ClassMapping classMapping)
var classElement = document.AddElement("class")
.WithAtt("xmlns", "urn:nhibernate-mapping-2.2");

if (classMapping.IsSpecified(x => x.BatchSize))
if (classMapping.HasValue(x => x.BatchSize))
classElement.WithAtt("batch-size", classMapping.BatchSize);

if (classMapping.IsSpecified(x => x.DiscriminatorValue))
if (classMapping.HasValue(x => x.DiscriminatorValue))
classElement.WithAtt("discriminator-value", classMapping.DiscriminatorValue.ToString());

if (classMapping.IsSpecified(x => x.DynamicInsert))
if (classMapping.HasValue(x => x.DynamicInsert))
classElement.WithAtt("dynamic-insert", classMapping.DynamicInsert);

if (classMapping.IsSpecified(x => x.DynamicUpdate))
if (classMapping.HasValue(x => x.DynamicUpdate))
classElement.WithAtt("dynamic-update", classMapping.DynamicUpdate);

if (classMapping.IsSpecified(x => x.Lazy))
if (classMapping.HasValue(x => x.Lazy))
classElement.WithAtt("lazy", classMapping.Lazy);

if (classMapping.IsSpecified(x => x.Schema))
if (classMapping.HasValue(x => x.Schema))
classElement.WithAtt("schema", classMapping.Schema);

if (classMapping.IsSpecified(x => x.Mutable))
if (classMapping.HasValue(x => x.Mutable))
classElement.WithAtt("mutable", classMapping.Mutable);

if (classMapping.IsSpecified(x => x.Polymorphism))
if (classMapping.HasValue(x => x.Polymorphism))
classElement.WithAtt("polymorphism", classMapping.Polymorphism);

if (classMapping.IsSpecified(x => x.Persister))
if (classMapping.HasValue(x => x.Persister))
classElement.WithAtt("persister", classMapping.Persister);

if (classMapping.IsSpecified(x => x.Where))
if (classMapping.HasValue(x => x.Where))
classElement.WithAtt("where", classMapping.Where);

if (classMapping.IsSpecified(x => x.OptimisticLock))
if (classMapping.HasValue(x => x.OptimisticLock))
classElement.WithAtt("optimistic-lock", classMapping.OptimisticLock);

if (classMapping.IsSpecified(x => x.Check))
if (classMapping.HasValue(x => x.Check))
classElement.WithAtt("check", classMapping.Check);

if (classMapping.IsSpecified(x => x.Name))
if (classMapping.HasValue(x => x.Name))
classElement.WithAtt("name", classMapping.Name);

if (classMapping.IsSpecified(x => x.TableName))
if (classMapping.HasValue(x => x.TableName))
classElement.WithAtt("table", classMapping.TableName);

if (classMapping.IsSpecified(x => x.Proxy))
if (classMapping.HasValue(x => x.Proxy))
classElement.WithAtt("proxy", classMapping.Proxy);

if (classMapping.IsSpecified(x => x.SelectBeforeUpdate))
if (classMapping.HasValue(x => x.SelectBeforeUpdate))
classElement.WithAtt("select-before-update", classMapping.SelectBeforeUpdate);

if (classMapping.IsSpecified(x => x.Abstract))
if (classMapping.HasValue(x => x.Abstract))
classElement.WithAtt("abstract", classMapping.Abstract);
}

Expand Down
16 changes: 8 additions & 8 deletions src/FluentNHibernate/MappingModel/Output/XmlColumnWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,28 @@ public override void ProcessColumn(ColumnMapping columnMapping)

var element = document.CreateElement("column");

if (columnMapping.IsSpecified(x => x.Name))
if (columnMapping.HasValue(x => x.Name))
element.WithAtt("name", columnMapping.Name);

if (columnMapping.IsSpecified(x => x.Check))
if (columnMapping.HasValue(x => x.Check))
element.WithAtt("check", columnMapping.Check);

if (columnMapping.IsSpecified(x => x.Length))
if (columnMapping.HasValue(x => x.Length))
element.WithAtt("length", columnMapping.Length);

if (columnMapping.IsSpecified(x => x.Index))
if (columnMapping.HasValue(x => x.Index))
element.WithAtt("index", columnMapping.Index);

if (columnMapping.IsSpecified(x => x.NotNull))
if (columnMapping.HasValue(x => x.NotNull))
element.WithAtt("not-null", columnMapping.NotNull);

if (columnMapping.IsSpecified(x => x.SqlType))
if (columnMapping.HasValue(x => x.SqlType))
element.WithAtt("sql-type", columnMapping.SqlType);

if (columnMapping.IsSpecified(x => x.Unique))
if (columnMapping.HasValue(x => x.Unique))
element.WithAtt("unique", columnMapping.Unique);

if (columnMapping.IsSpecified(x => x.UniqueKey))
if (columnMapping.HasValue(x => x.UniqueKey))
element.WithAtt("unique-key", columnMapping.UniqueKey);

document.AppendChild(element);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public override void ProcessComponent(ComponentMapping componentMapping)
{
document = WriteComponent("component", componentMapping);

if (componentMapping.IsSpecified(x => x.Class))
if (componentMapping.HasValue(x => x.Class))
document.DocumentElement.WithAtt("class", componentMapping.Class);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public override void ProcessCompositeElement(CompositeElementMapping mapping)

var element = document.AddElement("composite-element");

if (mapping.IsSpecified(x => x.Class))
if (mapping.HasValue(x => x.Class))
element.WithAtt("class", mapping.Class);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ public override void ProcessCompositeId(CompositeIdMapping mapping)

var element = document.AddElement("composite-id");

if (mapping.Attributes.IsSpecified(x => x.Access))
if (mapping.Attributes.HasValue(x => x.Access))
element.WithAtt("access", mapping.Access);

if (mapping.Attributes.IsSpecified(x => x.Name))
if (mapping.Attributes.HasValue(x => x.Name))
element.WithAtt("name", mapping.Name);

if (mapping.Attributes.IsSpecified(x => x.Class))
if (mapping.Attributes.HasValue(x => x.Class))
element.WithAtt("class", mapping.Class);

if (mapping.Attributes.IsSpecified(x => x.UnsavedValue))
if (mapping.Attributes.HasValue(x => x.UnsavedValue))
element.WithAtt("unsaved-value", mapping.UnsavedValue);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ public override void ProcessDiscriminator(DiscriminatorMapping discriminatorMapp
.WithAtt("column", discriminatorMapping.ColumnName)
.WithAtt("type", typeString);

if (discriminatorMapping.IsSpecified(x => x.Force))
if (discriminatorMapping.HasValue(x => x.Force))
discriminatorElement.WithAtt("force", discriminatorMapping.Force);

if (discriminatorMapping.IsSpecified(x => x.Formula))
if (discriminatorMapping.HasValue(x => x.Formula))
discriminatorElement.WithAtt("formula", discriminatorMapping.Formula);

if (discriminatorMapping.IsSpecified(x => x.Insert))
if (discriminatorMapping.HasValue(x => x.Insert))
discriminatorElement.WithAtt("insert", discriminatorMapping.Insert);

if (discriminatorMapping.IsSpecified(x => x.Length))
if (discriminatorMapping.HasValue(x => x.Length))
discriminatorElement.WithAtt("length", discriminatorMapping.Length);

if (discriminatorMapping.IsSpecified(x => x.NotNull))
if (discriminatorMapping.HasValue(x => x.NotNull))
discriminatorElement.WithAtt("not-null", discriminatorMapping.NotNull);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public override void ProcessElement(ElementMapping mapping)

var element = document.AddElement("element");

if (mapping.IsSpecified(x => x.Type))
if (mapping.HasValue(x => x.Type))
element.WithAtt("type", mapping.Type);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public override void ProcessGenerator(GeneratorMapping mapping)

var element = document.AddElement("generator");

if (mapping.Attributes.IsSpecified(x => x.Class))
if (mapping.Attributes.HasValue(x => x.Class))
element.WithAtt("class", mapping.Class);

foreach (var param in mapping.Params)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ public override void ProcessHibernateMapping(HibernateMapping mapping)

element.WithAtt("xmlns", "urn:nhibernate-mapping-2.2");

if (mapping.IsSpecified(x => x.DefaultAccess))
if (mapping.HasValue(x => x.DefaultAccess))
element.WithAtt("default-access", mapping.DefaultAccess);

if (mapping.IsSpecified(x => x.AutoImport))
if (mapping.HasValue(x => x.AutoImport))
element.WithAtt("auto-import", mapping.AutoImport);

if (mapping.IsSpecified(x => x.Schema))
if (mapping.HasValue(x => x.Schema))
element.WithAtt("schema", mapping.Schema);

if (mapping.IsSpecified(x => x.DefaultCascade))
if (mapping.HasValue(x => x.DefaultCascade))
element.WithAtt("default-cascade", mapping.DefaultCascade);

if (mapping.IsSpecified(x => x.DefaultLazy))
if (mapping.HasValue(x => x.DefaultLazy))
element.WithAtt("default-lazy", mapping.DefaultLazy);
}

Expand Down
8 changes: 4 additions & 4 deletions src/FluentNHibernate/MappingModel/Output/XmlIdWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ public override void ProcessId(IdMapping mapping)

var element = document.AddElement("id");

if (mapping.Attributes.IsSpecified(x => x.Access))
if (mapping.Attributes.HasValue(x => x.Access))
element.WithAtt("access", mapping.Access);

if (mapping.Attributes.IsSpecified(x => x.Name))
if (mapping.Attributes.HasValue(x => x.Name))
element.WithAtt("name", mapping.Name);

if (mapping.Attributes.IsSpecified(x => x.Type))
if (mapping.Attributes.HasValue(x => x.Type))
element.WithAtt("type", mapping.Type);

if (mapping.Attributes.IsSpecified(x => x.UnsavedValue))
if (mapping.Attributes.HasValue(x => x.UnsavedValue))
element.WithAtt("unsaved-value", mapping.UnsavedValue);
}

Expand Down
4 changes: 2 additions & 2 deletions src/FluentNHibernate/MappingModel/Output/XmlImportWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ public override void ProcessImport(ImportMapping mapping)

var element = document.CreateElement("import");

if (mapping.IsSpecified(x => x.Class))
if (mapping.HasValue(x => x.Class))
element.WithAtt("class", mapping.Class);

if (mapping.IsSpecified(x => x.Rename))
if (mapping.HasValue(x => x.Rename))
element.WithAtt("rename", mapping.Rename);

document.AppendChild(element);
Expand Down
10 changes: 5 additions & 5 deletions src/FluentNHibernate/MappingModel/Output/XmlJoinWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ public override void ProcessJoin(JoinMapping mapping)

var element = document.AddElement("join");

if (mapping.IsSpecified(x => x.TableName))
if (mapping.HasValue(x => x.TableName))
element.WithAtt("table", mapping.TableName);

if (mapping.IsSpecified(x => x.Schema))
if (mapping.HasValue(x => x.Schema))
element.WithAtt("schema", mapping.Schema);

if (mapping.IsSpecified(x => x.Fetch))
if (mapping.HasValue(x => x.Fetch))
element.WithAtt("fetch", mapping.Fetch);

if (mapping.IsSpecified(x => x.Inverse))
if (mapping.HasValue(x => x.Inverse))
element.WithAtt("inverse", mapping.Inverse);

if (mapping.IsSpecified(x => x.Optional))
if (mapping.HasValue(x => x.Optional))
element.WithAtt("optional", mapping.Optional);
}

Expand Down
20 changes: 10 additions & 10 deletions src/FluentNHibernate/MappingModel/Output/XmlJoinedSubclassWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,34 +30,34 @@ public override void ProcessJoinedSubclass(JoinedSubclassMapping mapping)
var element = document.AddElement("joined-subclass")
.WithAtt("name", mapping.Name);

if (mapping.IsSpecified(x => x.TableName))
if (mapping.HasValue(x => x.TableName))
element.WithAtt("table", mapping.TableName);

if (mapping.IsSpecified(x => x.Schema))
if (mapping.HasValue(x => x.Schema))
element.WithAtt("schema", mapping.Schema);

if (mapping.IsSpecified(x => x.Extends))
if (mapping.HasValue(x => x.Extends))
element.WithAtt("extends", mapping.Extends);

if (mapping.IsSpecified(x => x.Check))
if (mapping.HasValue(x => x.Check))
element.WithAtt("check", mapping.Check);

if (mapping.IsSpecified(x => x.Proxy))
if (mapping.HasValue(x => x.Proxy))
element.WithAtt("proxy", mapping.Proxy);

if (mapping.IsSpecified(x => x.Lazy))
if (mapping.HasValue(x => x.Lazy))
element.WithAtt("lazy", mapping.Lazy);

if (mapping.IsSpecified(x => x.DynamicUpdate))
if (mapping.HasValue(x => x.DynamicUpdate))
element.WithAtt("dynamic-update", mapping.DynamicUpdate);

if (mapping.IsSpecified(x => x.DynamicInsert))
if (mapping.HasValue(x => x.DynamicInsert))
element.WithAtt("dynamic-insert", mapping.DynamicInsert);

if (mapping.IsSpecified(x => x.SelectBeforeUpdate))
if (mapping.HasValue(x => x.SelectBeforeUpdate))
element.WithAtt("select-before-update", mapping.SelectBeforeUpdate);

if (mapping.IsSpecified(x => x.Abstract))
if (mapping.HasValue(x => x.Abstract))
element.WithAtt("abstract", mapping.Abstract);
}

Expand Down
Loading

0 comments on commit a90ec86

Please sign in to comment.