NHibernate “login: method get_Upwd should be virtual”错误解答!
来源:互联网 发布:e-mobile软件 编辑:程序博客网 时间:2024/05/15 12:09
错误如下!!
The following types may not be used as proxies:
Entitys.login: method get_Upwd should be virtual
Entitys.login: method get_id should be virtual
Entitys.login: method get_Uname should be virtual
Entitys.login: method set_Uname should be virtual
Entitys.login: method get_LastTime should be virtual
Entitys.login: method set_Upwd should be virtual
Entitys.login: method set_id should be virtual
Entitys.login: method set_LastTime should be virtual
----------------------------------------------------------------------------
引起问题的原因:
NHibernate 1.2 默认为类启用了延迟加载功能
解决方法:
方法1.在映射文件 class 标签中添加 Lazy="false" 属性
例:<class name="Entitys.login, Entitys" table="login" lazy="false">
方法2.为每个实体类的属性成员 添加 “ virtual ” 修饰符;
例:
public virtual int id
{
get { return m_id; }
set { m_id = value; }
}
----------------------------------------------------------------------------
- NHibernate “login: method get_Upwd should be virtual”错误解答!
- When should your destructor be virtual?
- php错误:non-static method xxx()should not be called statically
- Public interfaces should be used to configure virtual
- A Static Method Should Be Accessed In A Static Way
- NHibernate "Unknown entity class: Entitys.login" 错误结决!
- unable to resolve virtual method 错误
- How can the 'pure virtual method called' error be reproduced
- Environment error: "JAVA_HOME" should not be defined. 错误解决方法
- mysql错误:marked as crashed and should be repaired
- mysql错误:is marked as crashed and should be repaired
- mysql错误is marked as crashed and should be repaired
- HUE 报错误:Filesystem root '/' should be owned by 'hdfs'
- 错误:No action instance for path /login could be created
- Strict standards: Non-static method cls_image::gd_version() should not be called statically in
- Non-static method cls_image::gd_version() should not be called statically in D:\X\www\ecshop\install
- ECMall报Strict Standards: Non-static method Conf::get() should not be called statically解决
- Java Warning:A Static Method Should Be Accessed In A Static Wa
- linux 下postgre 数据库建立
- 合并DataTable
- nutch入门学习
- 观察:二线网站怎样迎接并购浪潮
- COM的知识点小结
- NHibernate “login: method get_Upwd should be virtual”错误解答!
- 职场规划
- Flex应用启动背后的故事
- COM知识点小结(续一)
- Linux下定时器的示例代码
- 深入浅出之正则表达式(二)
- java中private, public,protected的区别
- J2ME---判断点是否在椭圆内
- net2.0缓存