My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 9: Wrong error on derived class
1 person starred this issue and may be notified of changes. Back to list
Status:  Started
Owner:  ----


Sign in to add a comment
 
Reported by paterlin...@gmail.com, Jul 1, 2008
What steps will reproduce the problem?
1. Entity
    public class BaseEntity {

        int _id;

        public int Id {
            get { return _id; }
        }
    }
    public class DerivedEntity : BaseEntity {

        public string AnsiField { get; set; }

    }
2. Map
  <class name="NHibernatePlugin.Tests.TestMiei.DerivedEntity,
NHibernatePlugin.Tests" table="Example" >

    <id name="Id" access="nosetter.camelcase-underscore" column="ID"
type="Int32" unsaved-value="0">
      <generator class="native" />
    </id>

    <property name="AnsiField" column="Name" type="AnsiString"
access="property" />
    
  </class>


What is the expected output? What do you see instead?
- name="Id" is underlined as an error: getter for property Id not found in
class DerivedEntity
- type="AnsiString" is underlined as an error: Type AnsiString could not be
resolved.


What version of the product are you using? On what operating system?
Revision 12 from repository

Please provide any additional information below.
Using resharper 4 and vs2008 sp1

 
Jul 1, 2008
Project Member #1 stefan.l...@googlemail.com
>> - type="AnsiString" is underlined as an error: Type AnsiString could not be
resolved.

To which type should "AnsiString" be resolved? "String" works as expected.

I'm working on the Getter/Setter problem. There was a typo, but I have to change a
bit more to get it working correct.
Status: Started
Jul 1, 2008
#2 paterlin...@gmail.com
Probably AnsiString must be mapped to NHibernate.Type.AnsiStringType

Using type="string" works, but executing this query:
  from DerivedEntity where AnsiField='Hi'
NHibernate generate this query:
  ... from Example where Name=@p0 declare @p0 nvarchar(4000) @p0='Hi'
SQLServer generate this execution plan:
  ... from Example where cast(Name as nvarchar)='Hi'

If I have an index on Name, the index is not used.
Sign in to add a comment

Powered by Google Project Hosting