Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
10 | 3 | 4 | 0.966 | class_member_declaration |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 11 | 345 | src/NHibernate/Event/Default/AbstractSaveEventListener.cs |
2 | 11 | 364 | src/NHibernate/Event/Default/AbstractSaveEventListener.cs |
3 | 10 | 393 | src/NHibernate/Event/Default/DefaultMergeEventListener.cs |
| ||||
/// <summary> Handles the calls needed to perform pre-save cascades for the given entity. </summary> /// <param name="source">The session from which the save event originated.</param> /// <param name="persister">The entity's persister instance. </param> /// <param name="entity">The entity to be saved. </param> /// <param name="anything">Generally cascade-specific data </param> protected virtual void CascadeBeforeSave(IEventSource source, IEntityPersister persister, object entity, object anything) { // cascade-save to many-to-one BEFORE the parent is saved source.PersistenceContext.IncrementCascadeLevel(); try { new Cascade(CascadeAction, CascadePoint.BeforeInsertAfterDelete, source).CascadeOn(persister, entity, anything); } finally { source.PersistenceContext.DecrementCascadeLevel(); } } |
| ||||
/// <summary> Handles to calls needed to perform post-save cascades. </summary> /// <param name="source">The session from which the event originated. </param> /// <param name="persister">The entity's persister instance. </param> /// <param name="entity">The entity being saved. </param> /// <param name="anything">Generally cascade-specific data </param> protected virtual void CascadeAfterSave(IEventSource source, IEntityPersister persister, object entity, object anything) { // cascade-save to collections AFTER the collection owner was saved source.PersistenceContext.IncrementCascadeLevel(); try { new Cascade(CascadeAction, CascadePoint.AfterInsertBeforeDelete, source).CascadeOn(persister, entity, anything); } finally { source.PersistenceContext.DecrementCascadeLevel(); } } |
| ||||
/// <summary> /// Perform any cascades needed as part of this copy event. /// </summary> /// <param name="source">The merge event being processed. </param> /// <param name="persister">The persister of the entity being copied. </param> /// <param name="entity">The entity being copied. </param> /// <param name="copyCache">A cache of already copied instance. </param> protected virtual void CascadeOnMerge(IEventSource source, IEntityPersister persister, object entity, IDictionary copyCache) { source.PersistenceContext.IncrementCascadeLevel(); try { new Cascade(CascadeAction, CascadePoint.BeforeMerge, source).CascadeOn(persister, entity, copyCache); } finally { source.PersistenceContext.DecrementCascadeLevel(); } } |
| |||
/// <summary> /// Perform any cascades needed as part of this copy event. /// </summary> /// <param name="source">The merge event being processed. </param> /// <param name="persister">The persister of the entity being copied. </param> /// <param name="entity">The entity being copied. </param> /// <param name="copyCache">A cache of already copied instance. </param> /// <summary> Handles the calls needed to perform pre-save cascades for the given entity. </summary> /// <param name="source">The session from which the save event originated.</param> /// <summary> Handles to calls needed to perform post-save cascades. </summary> /// <param name="source">The session from which the event originated. </param> /// <param name="persister">The entity's persister instance. </param> /// <param name="entity">The entity to be saved. </param> /// <param name="entity">The entity being saved. </param> /// <param name="anything">Generally cascade-specific data </param> protected virtual void [[#variable6e3e8220]](IEventSource source, IEntityPersister persister, object entity, [[#variable6e3e81c0]] [[#variable6e3e8160]]) { // cascade-save to many-to-one BEFORE the parent is saved // cascade-save to collections AFTER the collection owner was saved source.PersistenceContext.IncrementCascadeLevel(); try { new Cascade(CascadeAction, CascadePoint. [[#variable6e3e80c0]], source).CascadeOn(persister, entity, [[#variable6e3e8160]]); } finally { source.PersistenceContext.DecrementCascadeLevel(); } } |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#6e3e8220]] | CascadeOnMerge |
1 | 2 | [[#6e3e8220]] | CascadeBeforeSave |
1 | 3 | [[#6e3e8220]] | CascadeAfterSave |
2 | 1 | [[#6e3e81c0]] | IDictionary |
2 | 2 | [[#6e3e81c0]] | object |
2 | 3 | [[#6e3e81c0]] | object |
3 | 1 | [[#6e3e8160]] | copyCache |
3 | 2 | [[#6e3e8160]] | anything |
3 | 3 | [[#6e3e8160]] | anything |
4 | 1 | [[#6e3e80c0]] | BeforeMerge |
4 | 2 | [[#6e3e80c0]] | BeforeInsertAfterDelete |
4 | 3 | [[#6e3e80c0]] | AfterInsertBeforeDelete |