上創建的標準功能打印問號我寫休眠個createCriteria功能在我的項目是這樣休眠控制檯
Hibernatesession.createCriteria(Salesman.class).add(Restrictions.ilike("email", email)).list();
電子郵件這裏是一個變量,而我在DAO頁面得到這個正確。 但在控制檯這裏得到的查詢是
select this_.id as id28_0_, this_.city_id as city2_28_0_, this_.state_id as state3_28_0_, this_.firstname as firstname28_0_, this_.lastname as lastname28_0_, this_.address as address28_0_, this_.zip as zip28_0_, this_.phone as phone28_0_, this_.suit as suit28_0_, this_.username as username28_0_, this_.password as password28_0_, this_.email as email28_0_, this_.status as status28_0_, this_.created_at as created14_28_0_ from test_mydrdirect.salesman this_ where lower(this_.email) like ?
它instaed應該在控制檯打印這樣
select this_.id as id28_0_, this_.city_id as city2_28_0_, this_.state_id as state3_28_0_, this_.firstname as firstname28_0_, this_.lastname as lastname28_0_, this_.address as address28_0_, this_.zip as zip28_0_, this_.phone as phone28_0_, this_.suit as suit28_0_, this_.username as username28_0_, this_.password as password28_0_, this_.email as email28_0_, this_.status as status28_0_, this_.created_at as created14_28_0_ from test_mydrdirect.salesman this_ where lower(this_.email) like '[email protected]'
,而不是[email protected]
休眠打印只是一個「?」在控制檯。有人知道爲什麼這個打印是這樣的。
這是因爲hibernate使用準備好的語句 – 2012-02-22 13:57:43