Guest User

Untitled

a guest
Aug 20th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. Calling Stored Procedure using NHibernate as a Named Query with Input Parameters
  2. <hibernate-mapping default-cascade="none" xmlns="urn:nhibernate-mapping-2.2"
  3. assembly="StudentVoiceGroups.Entities" namespace="StudentVoiceGroups.Entities" >
  4. <sql-query name="CASCADE_POSITIONTEMPLATE_PERMISSIONS" cacheable="false">
  5. <return class="PositionTemplateUpdateCascadeResult" alias="result">
  6. <return-property name="UpdatedPositionsCount">
  7. <return-column name="UpdatedPositionsCount" />
  8. </return-property>
  9. </return>
  10. exec CASCADE_POSITIONTEMPLATE_PERMISSIONS :PositionTemplateId
  11. </sql-query>
  12. </hibernate-mapping>
  13.  
  14. public class PositionTemplateUpdateCascadeResult
  15. {
  16. public int UpdatedPositionsCount { get; set; }
  17. }
  18.  
  19. EXEC [CASCADE_POSITIONTEMPLATE_PERMISSIONS] 15
  20.  
  21. <hibernate-mapping default-cascade="none" xmlns="urn:nhibernate-mapping-2.2"
  22. assembly="StudentVoiceGroups.Entities" namespace="StudentVoiceGroups.Entities" >
  23. <sql-query name="CASCADE_POSITIONTEMPLATE_PERMISSIONS" cacheable="false">
  24. exec CASCADE_POSITIONTEMPLATE_PERMISSIONS :PositionTemplateId
  25. </sql-query>
  26. </hibernate-mapping>
  27.  
  28. <hibernate-mapping default-cascade="none" xmlns="urn:nhibernate-mapping-2.2"
  29. assembly="StudentVoiceGroups.Entities" namespace="StudentVoiceGroups.Entities" >
  30. <sql-query name="CASCADE_POSITIONTEMPLATE_PERMISSIONS" cacheable="false">
  31. <return alias="result" class="YourNamespace.PositionTemplateUpdateCascadeResult, YourNamspaceAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
  32. <return-property name="UpdatedPositionsCount" column="UpdatedPositionsCount" />
  33. </return>
  34. exec CASCADE_POSITIONTEMPLATE_PERMISSIONS @PositionTemplateId=?
  35. </sql-query>
  36. </hibernate-mapping>
Add Comment
Please, Sign In to add comment