异常处理
异常**org.hibernate.QueryException: could not resolve property: Name of: com.vrv.cems.log.domain.LogServerArea [ SELECT COUNT() FROM com.vrv.cems.log.domain.LogServerSoftState this WHERE this.logServer.logServerArea.Name = ?]
*.hbm.xml内容
hibernate的xml 代码块
代码块语法遵循标准markdown代码,例如:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.vrv.cems.log.domain">
<class name="LogServer" table="cems_server">
<id name="id" type="java.lang.String">
<column name="id" />
<generator class="assigned" />
</id>
<property name="name" type="string" not-null="false" length="50"/>
<property name="useful" type="string" not-null="false" length="50"/>
<property name="hostname" type="string" not-null="false" length="50"/>
<property name="description" type="string" not-null="false" length="300"/>
<property name="ip" type="string" not-null="true" length="50"/>
<property name="mac" type="string" not-null="false" length="512"/>
<property name="os" type="string" not-null="false" length="30"/>
<property name="arch" type="string" not-null="false" length="20"/>
<property name="version" type="string" not-null="false" length="50"/>
<property name="register" type="string" not-null="false" length="32"/>
<property name="registTime" type="timestamp" not-null="true" />
<property name="maintainer" type="string" not-null="false" length="15"/>
<property name="maintainerPhone" type="string" not-null="false" length="15"/>
<property name="maintainerTel" type="string" not-null="false" length="15"/>
<property name="maintainerEmail" type="string" not-null="false" length="30"/>
<property name="memorySize" type="int" not-null="false" />
<property name="diskSize" type="int" not-null="false" />
<property name="cpuHz" type="double" not-null="false"/>
<property name="cpuCoreCount" type="int" not-null="false" />
<property name="serverAreaId" type="string" not-null="false" length="32"/>
<!-- 关联cems_server -->
<many-to-one name="logServerArea" class="com.vrv.cems.log.domain.LogServerArea" column="serverAreaId" insert="false" update="false"/>
</class>
</hibernate-mapping>