<?
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★ 阅读(368)
评论(0) 编辑 收藏 所属分类:
Hibernate学习