<?
xml?version="1.0"
?>
<!
DOCTYPE?hibernate-mapping?PUBLIC
????"-//Hibernate/Hibernate?Mapping?DTD//EN"
????"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"?
>
<
hibernate-mapping?
package
="gov.cfte.object.hibernate.model"
>
????
<
class?
name
="ObjectLog"
?table
="OBJECT_LOG"
>
????????
<
id?
column
="ID"
?name
="Id"
?type
="string"
?length
="32"
>
????????????
<
generator?
class
="net.sf.hibernate.id.UUIDHexGenerator"
?
/>
????????
</
id
>
?
????????
<
property
????????????
column
="TYPE_ID"
????????????length
="32"
????????????name
="TypeId"
????????????not-null
="false"
????????????type
="string"
?????????
/>
????????
<
property
????????????
column
="OPTIME"
????????????length
="26"
????????????name
="Optime"
????????????not-null
="false"
????????????type
="timestamp"
?????????
/>
????????
<
property
????????????
column
="USER_ID"
????????????length
="32"
????????????name
="UserId"
????????????not-null
="false"
????????????type
="string"
?????????
/>
????????
<
property
????????????
column
="OPINFO"
????????????length
="32"
????????????name
="Opinfo"
????????????not-null
="false"
????????????type
="string"
?????????
/>
????????
<
property
????????????
column
="RECORDINFO"
????????????length
="1024"
????????????name
="Recordinfo"
????????????not-null
="false"
????????????type
="string"
?????????
/>
????????
<
property
????????????
column
="IP"
????????????length
="32"
????????????name
="Ip"
????????????not-null
="false"
????????????type
="string"
?????????
/>
????
</
class
>
</
hibernate-mapping
>
return
?
this
.getHibernateTemplate().find(
"
from?ObjectLog
"
);
return
?
this
.getHibernateTemplate().find(
"
from?ObjectLog?c?where?c.Opinfo?=??
"
,?queryCondition);
//
根據操作方式來精確查詢(已測試通過)
return
?
this
.getHibernateTemplate().find(
"
from?ObjectLog?c?where?c.Opinfo?like??
"
,?
"
%
"
+
queryCondition
+
"
%
"
);
//
根據操作方式來模糊查詢(已測試通過)
return
?
this
.getHibernateTemplate().find(
"
from?ObjectLog?c?where?c.TypeId=??and?c.Opinfo?like??
"
,
new
?Object[]{typeId,
"
%
"
+
queryCondition
+
"
%
"
});
posted on 2006-03-28 17:58
★yesjoy★ 閱讀(372)
評論(0) 編輯 收藏 所屬分類:
Hibernate學習