请问:hibernate如何才能映射视图?

06-03-31 wkj83823
如题,我自己写了个xml文件来映射视图, 映射完了它给我个警告说找不到类

xml 内容:

<?xml version="1.0"?>

<!DOCTYPE hibernate-mapping PUBLIC

"-//Hibernate/Hibernate Mapping DTD 3.0//EN"

"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >

<hibernate-mapping package="creaway.cartrace.dbclass">

<class name="CarInfo" table="CAR.CARINFO" mutable="false">

<subselect>

SELECT CAR_ID, ALARM_TEL1,

ALARM_TEL2, COMM_ALWAYSTRACK,

COMM_INTERVAL, COMM_STARTTIME,

COMM_STARTTYPE, COMM_STOPTIME,

DEVICE_CODE, DEVICE_ENABLED,

DEVICE_ID, DEVICE_PHONE

FROM CAR_CARINFO INNER JOIN CAR_DEVICE

ON ( CAR_CARINFO.DEVICE_ID = CAR_DEVICE.DEVICE_ID

)

</subselect>

<synchronize table="CAR_CARINFO" />

<synchronize table="CAR_DEVICE"/>

<composite-id>

<key-property name="carID" column="CAR_ID" type="int" />

</composite-id>

<property name="deviceCode" column="Device_Code" type="string" not-null="true" />

<property name="deviceID" column="Device_ID" type="int" not-null="true"/>

<property name="commAlwaysTrack" column="Comm_AlwaysTrack" type="string" not-null="true"/>

<property name="commStartTime" column="Comm_StartTime" type="calendar" not-null="true"/>

<property name="commStopTime" column="Comm_StopTime" type="calendar" not-null="true"/>

<property name="commInterval" column="Comm_Interval" type="int" not-null="true"/>

<property name="commStartType" column="Comm_StartType" type="int" not-null="true"/>

<property name="devicePhone" column="Device_Phone" type="string" not-null="true"/>

<property name="alarmTel1" column="ALARM_TEL1" type="string" not-null="true"/>

<property name="alarmTel2" column="ALARM_TEL2" type="string" not-null="true"/>

<property name="deviceEnabled" column="DEVICE_ENABLED" type="string" not-null="true"/>

</class>

</hibernate-mapping>

异常内容:

2006-03-31 16:20:03,121 INFO - Mapping class: creaway.cartrace.dbclass.CarInfo -> CAR.CARINFO

2006-03-31 16:20:03,161 WARN - Could not perform validation checks for component as the class creaway.cartrace.dbclass.CarInfo was not found

请问这是为什么?

猜你喜欢