File tree Expand file tree Collapse file tree 5 files changed +89
-1
lines changed Expand file tree Collapse file tree 5 files changed +89
-1
lines changed Original file line number Diff line number Diff line change
1
+
2
+
3
+ namespace NHibernate . Test . NHSpecificTest . NH2044
4
+ {
5
+ public class DomainClass
6
+ {
7
+ private char symbol ;
8
+ private int id ;
9
+
10
+ public int Id
11
+ {
12
+ get { return id ; }
13
+ set { id = value ; }
14
+ }
15
+
16
+ public char Symbol
17
+ {
18
+ get { return symbol ; }
19
+ set { symbol = value ; }
20
+ }
21
+ }
22
+ }
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" utf-8" ?>
2
+ <hibernate-mapping xmlns =" urn:nhibernate-mapping-2.2" assembly =" NHibernate.Test"
3
+ namespace =" NHibernate.Test.NHSpecificTest.NH2044" default-access =" field.camelcase"
4
+ default-lazy =" false" >
5
+ <class name =" DomainClass" >
6
+ <id name =" Id" >
7
+ <generator class =" assigned" />
8
+ </id >
9
+ <property name =" Symbol" type =" Char" />
10
+ </class >
11
+ </hibernate-mapping >
Original file line number Diff line number Diff line change
1
+ using System ;
2
+ using System . Collections ;
3
+ using System . Collections . Generic ;
4
+ using System . Text ;
5
+ using NHibernate . Dialect ;
6
+ using NUnit . Framework ;
7
+
8
+ namespace NHibernate . Test . NHSpecificTest . NH2044
9
+ {
10
+ [ TestFixture ]
11
+ public class SampleTest : BugTestCase
12
+ {
13
+ protected override void OnSetUp ( )
14
+ {
15
+ base . OnSetUp ( ) ;
16
+ using ( ISession session = this . OpenSession ( ) )
17
+ {
18
+ DomainClass entity = new DomainClass ( ) ;
19
+ entity . Id = 1 ;
20
+ entity . Symbol = 'S' ;
21
+ session . Save ( entity ) ;
22
+ session . Flush ( ) ;
23
+ }
24
+ }
25
+
26
+ protected override void OnTearDown ( )
27
+ {
28
+ base . OnTearDown ( ) ;
29
+ using ( ISession session = this . OpenSession ( ) )
30
+ {
31
+ string hql = "from DomainClass" ;
32
+ session . Delete ( hql ) ;
33
+ session . Flush ( ) ;
34
+ }
35
+ }
36
+
37
+
38
+ [ Test ]
39
+ public void IgnoreCaseShouldWorkWithCharCorrectly ( )
40
+ {
41
+ using ( ISession session = this . OpenSession ( ) )
42
+ {
43
+ ICriteria criteria = session . CreateCriteria ( typeof ( DomainClass ) , "domain" ) ;
44
+ criteria . Add ( NHibernate . Criterion . Expression . Eq ( "Symbol" , 's' ) . IgnoreCase ( ) ) ;
45
+ IList < DomainClass > list = criteria . List < DomainClass > ( ) ;
46
+
47
+ Assert . AreEqual ( 1 , list . Count ) ;
48
+
49
+ }
50
+ }
51
+ }
52
+ }
Original file line number Diff line number Diff line change 658
658
<Compile Include =" NHSpecificTest\NH1938\Model.cs" />
659
659
<Compile Include =" NHSpecificTest\NH1939\AuxType.cs" />
660
660
<Compile Include =" NHSpecificTest\NH1939\Fixture.cs" />
661
+ <Compile Include =" NHSpecificTest\NH2044\DomainClass.cs" />
662
+ <Compile Include =" NHSpecificTest\NH2044\SampleTest.cs" />
661
663
<Compile Include =" NHSpecificTest\NH2055\AuxType.cs" />
662
664
<Compile Include =" NHSpecificTest\NH2055\Fixture.cs" />
663
665
<Compile Include =" NHSpecificTest\NH2057\Fixture.cs" />
2098
2100
<EmbeddedResource Include =" CfgTest\Loquacious\EntityToCache.hbm.xml" />
2099
2101
<EmbeddedResource Include =" DriverTest\SqlServerCeEntity.hbm.xml" />
2100
2102
<Content Include =" DynamicEntity\package.html" />
2103
+ <EmbeddedResource Include =" NHSpecificTest\NH2044\Mappings.hbm.xml" />
2101
2104
<EmbeddedResource Include =" NHSpecificTest\NH2030\Mappings.hbm.xml" />
2102
2105
<EmbeddedResource Include =" Linq\Mappings\Patient.hbm.xml" />
2103
2106
<EmbeddedResource Include =" NHSpecificTest\NH2055\Mappings.hbm.xml" />
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ public override System.Type ReturnedClass
48
48
49
49
public override void Set ( IDbCommand cmd , object value , int index )
50
50
{
51
- ( ( IDataParameter ) cmd . Parameters [ index ] ) . Value = ( char ) value ;
51
+ ( ( IDataParameter ) cmd . Parameters [ index ] ) . Value = Convert . ToChar ( value ) ;
52
52
}
53
53
54
54
public override string ObjectToSQLString ( object value , Dialect . Dialect dialect )
You can’t perform that action at this time.
0 commit comments