当调用saveDepartment()
时,我会在标题中提到异常。在搜索解决方案一段时间之后,我在stackoverflow上提出了另一个类似的帖子,这与我面临的问题场景不符。
@Repository
public class DepartmentDaoImpl implements DepartmentDao {
@Autowired
private SessionFactory sessionFactory;
@Override
@Transactional
public void saveDepartment(Department department) {
Session session = sessionFactory.getCurrentSession();
session.save(department);
}
}
用于休眠的Bean配置部分:
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="packagesToScan" value="net.therap.domain.tmp"/>
<property name="dataSource" ref="dataSource" />
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect"> org.hibernate.dialect.HSQLDialect</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
</bean>
<bean id="transactionManager"
class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
对此问题的任何建议或解决方案表示赞赏。
答案 0 :(得分:3)
SELECT Membri.Nume, Membri.Prenum,
(Select Count(*) FROM Adunari
WHERE [Nume Prenume]
LIKE '*' & Membri.Nume & ' ' & Membri.Prenum & '*') As MatchSubCount,
DCount("*", "Adunari", "[Nume Prenume]
LIKE ""*" & Membri.Nume & " " & Membri.Prenum & "*""") As MatchDCount
FROM Membri
错误代码和ORA-06576
标记表明您正在使用Oracle 11g数据库。
Hibernate的oracle11g
与该版本兼容,因此您应该使用以下方言配置:
Oracle10gDialect