hSession = HibernateUtilPlus.currentSession(); 打出 hSession 值看看
Query query = hSession.createQuery(hql); 如果确实是这句抛出异常,,有可能 hSession==null
Query query = hSession.createQuery(hql); 如果确实是这句抛出异常,,有可能 hSession==null
解决方案 »
- 巴巴运动网15集Spring2.5+JPA整合最后去掉DataSoruce配置还是出错!。在线等解决方案
- 公司工具
- 求解 JSF
- 散分了散分了
- 请问用Tomcat做Web Server如何能统计出一些静态资源的访问情况?
- 复杂逻辑的困惑。。。请帮忙看看!
- 关于xsl转换的问题(急!在线等!)
- 在jdom和jaxen时候xpath的问题?
- 请问,怎么改jboss-3.0.4_tomcat-4.1.12的启动端口,我的8080已被占用不能正常启动
- 有甚麼好的方法搜索xml文件?
- webservice java开发工具?
- 事务(进程 ID 68)与另一个进程已被死锁在 lock 资源上,且该事务已被选作死锁牺牲品。请重新运行该事务,这是什么原因?
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" ><hibernate-mapping>
<!--
Created by the Middlegen Hibernate plugin 2.1 http://boss.bekk.no/boss/middlegen/
http://www.hibernate.org/
--><class
name="com.monitorcc.system.db.table.TabUser"
table="TAB_USER"
>
<meta attribute="class-description" inherit="false">
@hibernate.class
table="TAB_USER"
</meta> <id
name="userId"
type="int"
column="USER_ID"
access="field"
>
<meta attribute="field-description">
@hibernate.id
generator-class="sequence"
type="int"
column="USER_ID"
access="field"
@hibernate.generator-param
name="sequence"
value="SEQ_USER"
</meta>
<meta attribute="use-in-equals">true</meta>
<generator class="sequence">
<param name="sequence">SEQ_USER</param>
</generator>
</id> <property
name="userName"
type="java.lang.String"
column="USER_NAME"
not-null="true"
length="10"
>
<meta attribute="field-description">
@hibernate.property
column="USER_NAME"
length="10"
not-null="true"
</meta>
</property>
<property
name="userLoginName"
type="java.lang.String"
column="USER_LOGIN_NAME"
length="20"
>
<meta attribute="field-description">
@hibernate.property
column="USER_LOGIN_NAME"
length="20"
</meta>
</property>
<property
name="userLoginPwd"
type="java.lang.String"
column="USER_LOGIN_PWD"
length="40"
>
<meta attribute="field-description">
@hibernate.property
column="USER_LOGIN_PWD"
length="40"
</meta>
</property>
<property
name="userPhoneNo"
type="java.lang.String"
column="USER_PHONE_NO"
length="15"
>
<meta attribute="field-description">
@hibernate.property
column="USER_PHONE_NO"
length="15"
</meta>
</property>
<property
name="userEmail"
type="java.lang.String"
column="USER_EMAIL"
length="50"
>
<meta attribute="field-description">
@hibernate.property
column="USER_EMAIL"
length="50"
</meta>
</property>
<property
name="userStatus"
type="int"
column="USER_STATUS"
length="1"
>
<meta attribute="field-description">
@hibernate.property
column="USER_STATUS"
length="1"
</meta>
</property> <!-- Associations --> <!-- bi-directional one-to-many association to TabPrivilege -->
<set
name="tabPrivileges"
lazy="true"
inverse="true"
cascade="none"
>
<meta attribute="field-description">
@hibernate.set
lazy="true"
inverse="true"
cascade="all" @hibernate.collection-key
column="USER_ID" @hibernate.collection-one-to-many
class="com.monitorcc.system.db.table.TabPrivilege"
</meta>
<key>
<column name="USER_ID" />
</key>
<one-to-many
class="com.monitorcc.system.db.table.TabPrivilege"
/>
</set></class>
</hibernate-mapping>
这是我表的映射文件,class属性的名字应该没写错啊
userId不是一张表吧?