Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- return session.Get<T>(id);
- <class name="Merchant" table="T__MERCHANT">
- <id name="MerchantId" column="MERCHANT_ID" type="string">
- <generator class="assigned" />
- </id>
- <property name="MerchantStatusId" column="MERCHANT_STATUS_ID" type="Char" not-null="true" length="1" />
- <property name="MerchantStatusName" column="MERCHANT_STATUS_NAME" type="string" length="50" />
- <property name="MerchantName" column="NAME" type="string" not-null="true" length="50" />
- </class>
- </hibernate-mapping>
- public Merchant GetMerchantById(string id)
- {
- return session.Get<Merchant>(id);
- }
- <joined-subclass name="JohnHarmanLtd.Web.FineArtCompany.Models.Book, App_Code.tqeub3fb, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
- Imports NHibernate.UserTypes
- Imports NHibernate.Type
- Imports NHibernate.SqlTypes
- Public Class CaseInsensitiveStringType
- Inherits AbstractStringType
- ' Methods
- Public Sub New()
- MyBase.New(New StringSqlType)
- End Sub
- Public Sub New(ByVal sqlType As StringSqlType)
- MyBase.New(sqlType)
- End Sub
- ' Properties
- Public Overrides ReadOnly Property Name As String
- Get
- Return "InsensitiveString"
- End Get
- End Property
- Public Overrides Function IsEqual(ByVal x As Object, ByVal y As Object) As Boolean
- Return MyBase.IsEqual(x, y) OrElse (x IsNot Nothing AndAlso y IsNot Nothing AndAlso String.Equals(x, y, StringComparison.InvariantCultureIgnoreCase))
- End Function
- Public Overrides Function GetHashCode(ByVal x As Object, ByVal entityMode As NHibernate.EntityMode, ByVal factory As NHibernate.Engine.ISessionFactoryImplementor) As Integer
- Return MyBase.GetHashCode(x.ToString().Trim().ToUpperInvariant(), entityMode, factory)
- End Function
- End Class
- Id(Function(x) x.Id).GeneratedBy.Assigned().CustomType(Of CaseInsensitiveStringType)()
- Example.create(parent).ignoreCase()
Add Comment
Please, Sign In to add comment