hibernate-mapping auto-import="false"
来源:互联网 发布:c语言长整型范围比实型 编辑:程序博客网 时间:2024/05/26 09:56
当项目中出先2个User 类时虽然,在不同的包,如下那么系统不知道是哪个
User u = (User) this.getSession().createQuery(
"select u from User u where u.username = ? and u.password = ?")
.setParameter(0, username).setParameter(1, password)
.uniqueResult();
解决办法是
将其中之一的User User.hbm.xml 中添加auto-import="false"
password)并将相应查询语句该为 全称 com.bjsxt.oa.model.User
< hibernate-mapping auto-import="false"">
<class table="T_User" name="com.bjsxt.oa.model.User">
<id access="field" name="id">
<generator class="native"/>
</id>
<property name="username" not-null="true" access="field" unique="true"/>
<property name="password" not-null="true" access="field" unique="true"/>
<property name="createtime" access="field" update="false"/>
<property name="expiretime" access="field"/>
<many-to-one unique="true" access="field" name="person"/>
</class>
</hibernate-mapping >
- hibernate-mapping auto-import="false"
- Hibernate的auto-import属性详解
- Hibernate的auto-import属性详解
- Hibernate的auto-import属性详解
- Auto-mapping
- Hibernate auto-import属性 解决有同名实体的时候
- hibernate.hbm2ddl.auto=validate
- hibernate.hbm2ddl.auto=update
- Repeated column in mapping for entity: .... should be mapped with insert="false" update="false"
- Repeated column in mapping for entity:(should be mapped with insert="false" update="false")
- Repeated column in mapping for entity:should be mapped with insert="false" update="false"
- Repeated column in mapping for entity:should be mapped with insert="false" update="false"
- Repeated column in mapping for entity:(should be mapped with insert="false" update="false")
- Repeated column in mapping for entity:(should be mapped with insert="false" update="false")
- hibernate-mapping
- Hibernate mapping
- hibernate MappingException (insert="false" update="false")
- The content of element type "hibernate-mapping" must match "(meta*,typedef*,import*,(class|subclass|
- jbpm
- LINUX命令行输出重定向至文本文件
- 宏// const // sizeof // static // volatile 等关键词的用法
- Web Service学习笔记
- 手动创建数据,修改PFILE,STARTUP后提示ORA-00449/ORA-07446
- hibernate-mapping auto-import="false"
- EVC调用 Windows Media Player 控件
- poj3517
- [学习与分享]find命令和xargs命令详解
- 验证码破解的方法,简单验证码破解演示
- c++中对const的总结
- Windows 编程用SDK建立工具栏
- Java 设置窗口系统关闭按钮的事件响应
- [Python Challenge] - Q0