开发者

Hibernate bug, how to workaround?

开发者 https://www.devze.com 2023-01-05 04:36 出处:网络
I use Hibernate 3.5.3, and Oracle 10g database I have bean with following relation @OneToMany @JoinTable(name=\"dispenser_accounts\",

I use Hibernate 3.5.3, and Oracle 10g database

I have bean with following relation

@OneToMany
@JoinTable(name="dispenser_accounts",
        joinColumns=@JoinColumn(name="terminal_id"), 
        inverseJoinColumns=@JoinColumn(name="dispenser_section_id"))
@MapKey(name="dispenserNumber")
private Map<Integer, DispenserAccount> activeDispensers = new HashMap<Integer, DispenserAccount>();

When I tr开发者_运维问答ying to fetch data from activeDispensers hibernate generate sql with wrong syntax

SQL Error: 907, SQLState: 42000
ORA-00907: missing right parenthesis

How to workaround this bug?

Thanks!


The answer is probably to overwrite a particular method in the Oracle dialect and fix the problem (hard to say without seeing the SQL).

You could try switching to a different Oracle dialect that may not have the same bug. e.g. Oracle9Dialect.

0

精彩评论

暂无评论...
验证码 换一张
取 消