在下面,我有时可以将#!/usr/bin/env python3
import threading
from sklearn import datasets
from sklearn import svm
from sklearn.ensemble import RandomForestClassifier
from sklearn.neural_network import MLPClassifier
X, y = datasets.load_iris(return_X_y=True)
# Some model. Might be any type, e.g.:
clf = svm.SVC()
clf = RandomForestClassifier(),
clf = MLPClassifier(solver='lbfgs')
clf.fit(X, y)
def use_model_for_predictions():
for _ in range(10000):
clf.predict(X[0:1])
# Is this safe?
thread_1 = threading.Thread(target=use_model_for_predictions)
thread_2 = threading.Thread(target=use_model_for_predictions)
thread_1.start()
thread_2.start()
设置为null。当时它抛出错误
“无法提取ResultSet; SQL [n / a];嵌套的异常是org.hibernate.exception.SQLGrammarException:无法提取ResultSet”
即使modifedDate
为空,如何获取数据。有时日期会到。
怎么办?
我希望下面的Query方法总是返回数据
我们可以通过构建动态查询并使用实体管理器来执行。但是我想要存储库。
modifiedDate
答案 0 :(得分:0)
尝试一下
@Repository
public interface AdminRepository extends JpaRepository<AdminEntity, Long> {
@Query(
value="SELECT * from admin_entity where status=:adminStatus
AND (modified_tsz>=:modifedDate OR :modifedDate is null)",
nativeQuery=true)
List<AdminEntity> getAdmins(String adminStatus, Date modifedDate)
}