Permalink
Browse files

Remove unused code from UnionSubclassEntityPersister

  • Loading branch information...
1 parent 897117a commit 16f53edc4bcb6676aec070b4692ebd744d09fa54 @hazzik hazzik committed Oct 13, 2012
Showing with 12 additions and 49 deletions.
  1. +1 −0 releasenotes.txt
  2. +11 −49 src/NHibernate/Persister/Entity/UnionSubclassEntityPersister.cs
View
@@ -7,6 +7,7 @@ Build vNext
* IDeleteEventListener, IEventSource: Use generic ISet<> instead of non-generic in method signatures.
* SqlString.Parts removed. Use SqlString.Count and SqlString.GetEnumerator().
* IPersistentCollection.GetSnapshot() now returns object instead of ICollection. The snapshot should be opaque to outside code.
+ * Removed IsDiscriminatorFormula, DiscriminatorFormula and GenerateSelectString from UnionSubclassEntityPersister class.
Build 3.3.1.GA
=============================
@@ -37,7 +37,7 @@ public class UnionSubclassEntityPersister : AbstractEntityPersister
tableName =
persistentClass.Table.GetQualifiedName(factory.Dialect, factory.Settings.DefaultCatalogName,
- factory.Settings.DefaultSchemaName);
+ factory.Settings.DefaultSchemaName);
#region Custom SQL
@@ -48,29 +48,29 @@ public class UnionSubclassEntityPersister : AbstractEntityPersister
sql = persistentClass.CustomSQLInsert;
callable = sql != null && persistentClass.IsCustomInsertCallable;
checkStyle = sql == null
- ? ExecuteUpdateResultCheckStyle.Count
- : (persistentClass.CustomSQLInsertCheckStyle
- ?? ExecuteUpdateResultCheckStyle.DetermineDefault(sql, callable));
+ ? ExecuteUpdateResultCheckStyle.Count
+ : (persistentClass.CustomSQLInsertCheckStyle
+ ?? ExecuteUpdateResultCheckStyle.DetermineDefault(sql, callable));
customSQLInsert = new SqlString[] { sql };
insertCallable = new bool[] { callable };
insertResultCheckStyles = new ExecuteUpdateResultCheckStyle[] { checkStyle };
sql = persistentClass.CustomSQLUpdate;
callable = sql != null && persistentClass.IsCustomUpdateCallable;
checkStyle = sql == null
- ? ExecuteUpdateResultCheckStyle.Count
- : (persistentClass.CustomSQLUpdateCheckStyle
- ?? ExecuteUpdateResultCheckStyle.DetermineDefault(sql, callable));
+ ? ExecuteUpdateResultCheckStyle.Count
+ : (persistentClass.CustomSQLUpdateCheckStyle
+ ?? ExecuteUpdateResultCheckStyle.DetermineDefault(sql, callable));
customSQLUpdate = new SqlString[] { sql };
updateCallable = new bool[] { callable };
updateResultCheckStyles = new ExecuteUpdateResultCheckStyle[] { checkStyle };
sql = persistentClass.CustomSQLDelete;
callable = sql != null && persistentClass.IsCustomDeleteCallable;
checkStyle = sql == null
- ? ExecuteUpdateResultCheckStyle.Count
- : (persistentClass.CustomSQLDeleteCheckStyle
- ?? ExecuteUpdateResultCheckStyle.DetermineDefault(sql, callable));
+ ? ExecuteUpdateResultCheckStyle.Count
+ : (persistentClass.CustomSQLDeleteCheckStyle
+ ?? ExecuteUpdateResultCheckStyle.DetermineDefault(sql, callable));
customSQLDelete = new SqlString[] { sql };
deleteCallable = new bool[] { callable };
deleteResultCheckStyles = new ExecuteUpdateResultCheckStyle[] { checkStyle };
@@ -247,44 +247,6 @@ public override string GetSubclassForDiscriminatorValue(object value)
return result;
}
- protected internal virtual bool IsDiscriminatorFormula
- {
- get { return false; }
- }
-
- /// <summary> Generate the SQL that selects a row by id</summary>
- protected internal virtual SqlString GenerateSelectString(LockMode lockMode)
- {
- SqlSimpleSelectBuilder select = new SqlSimpleSelectBuilder(Factory.Dialect, Factory)
- .SetLockMode(lockMode)
- .SetTableName(TableName)
- .AddColumns(IdentifierColumnNames)
- .AddColumns(SubclassColumnClosure, SubclassColumnAliasClosure, SubclassColumnLaziness)
- .AddColumns(SubclassFormulaClosure, SubclassFormulaAliasClosure, SubclassFormulaLaziness);
- //TODO: include the rowids!!!!
- if (HasSubclasses)
- {
- if (IsDiscriminatorFormula)
- {
- select.AddColumn(DiscriminatorFormula, DiscriminatorAlias);
- }
- else
- {
- select.AddColumn(DiscriminatorColumnName, DiscriminatorAlias);
- }
- }
- if (Factory.Settings.IsCommentsEnabled)
- {
- select.SetComment("load " + EntityName);
- }
- return select.AddWhereFragment(IdentifierColumnNames, IdentifierType, "=").ToSqlString();
- }
-
- protected internal string DiscriminatorFormula
- {
- get { return null; } // NH : what this mean ? (see GenerateSelectString)
- }
-
protected override string GetTableName(int table)
{
return tableName;
@@ -363,7 +325,7 @@ protected string GenerateSubquery(PersistentClass model, IMapping mapping)
StringBuilder buf = new StringBuilder().Append("( ");
IEnumerable<PersistentClass> siter =
new JoinedEnumerable<PersistentClass>(new SingletonEnumerable<PersistentClass>(model),
- new SafetyEnumerable<PersistentClass>(model.SubclassIterator));
+ new SafetyEnumerable<PersistentClass>(model.SubclassIterator));
foreach (PersistentClass clazz in siter)
{

0 comments on commit 16f53ed

Please sign in to comment.