我與Hibernate和Oracle等價從雙在PostgreSQL
工作的我用這個代碼:
if (null != sessionFactory) {
Session s = currentSession.get();
if ((null == s) || !s.isOpen()) {
s = sessionFactory.openSession();
currentSession.set(s);
} else {
try {
HibernateWork hibernateWork = new HibernateWork("SELECT 1 FROM DUAL");
s.doWork(hibernateWork);
} catch (Exception e) {
s = sessionFactory.openSession();
currentSession.set(s);
}
}
return s;
}
我想要做同樣的事情在PostgreSQL
但PostgreSQL不支持'FROM dual'語法
我想知道在PostgreSQL中雙重的等價性