hibernate search查不到結果

2021-09-01 07:20:32 字數 1360 閱讀 8738

用了spring+hibernate+hibernate search,照著文件上的配置,寫**,寫測試,可以成功執行,可就是查不到結果

jdbc.driverclassname=com.mysql.jdbc.driver

jdbc.url=jdbc:mysql://localhost:3306/security

jdbc.username=root

jdbc.password=meng

hibernate.dialect=org.hibernate.dialect.mysql5innodbdialect

hibernate.show_sql=true

hibernate.format_sql=true

hibernate.search.default.directory_provider=filesystem

hibernate.search.default.indexbase=/var/lucene/indexes

dbcp.maxidle=5

dbcp.maxactive=40

這個是spring配置檔案$$

$$$然後這個是userdaoimpl的部分**

public listsearch(string search)

資料庫裡有資料,也按文件上說的執行了那兩行**,執行完之後就是什麼結果都沒有,它還發了一條sql語句。

hibernate:

select

this_.id as id2_0_,

this_.name as name2_0_,

this_.password as password2_0_

from

user this_

where

(this_.id in (?)

)

我在debug時候發現他在執行到如下方法的時候,resulttransformer 為空, list = resulttransformer.transformlist( list );這句話就沒能執行,而在執行這句話之前就把之前那個sql語句發出來了,不知道是不是這個原因,又或是其他的原因。

public list list() throws hibernateexception

else

hsearchquery.gettimeoutmanager().stop();

return list;

}

請教各位大神,我實在是沒辦法了。

查不到opencv版本的問題

檢查opencv版本 前兩天解除安裝了opencv3.0,想重灌2.4版本。安裝是沒有問題,但現在查不到opencv版本,程式也編譯不通過。解除安裝過程 找到當初安裝 opencv3.0.0 的 build 目錄,進入 build 目錄 cd home opencv build sudo make ...

mysql like 查不到結果 中文 查詢優化

參考 mysql like keyword 不走索引替代方法 select locate xbar foobar 返回0 select locate bar foobarbar 返回4 select locate bar foobarbar 5 返回7 備註 返回 substr 在 str 中第一次...

解決pymysql查不到最新資料的辦法

最近用 flask 寫了幾個介面部署在伺服器上,然後用 pytest 來做測試,但遇到了問題,搞了大半天才把問題解決。問題大概是這樣的,我在本地環境用 pytest 寫 來對伺服器上 flask 的介面進行測試,在測試刪除介面的時候,第一步我在 pytest 中會通過sql插入資料到mysql資料庫...