SchemaUpdate 如何让它正确找schema?

DB:oracle 9i
在同一个数据库实例里面有两个用户:CS 和TEST ,为了测试两个用户下面建了很多同名的表,比如cs.card和test.card表。
我用test用户连接db调用SchemaUpdate 发现竟然去找的cs下面的表,然后更新表结构就更是不知道更新到哪个schema去了。后面发现可以设置hibernate.default_schema=test,但是去匹配的表还是 cs下面的表,而去更新的确实test下面的表,真晕。
ant结果如下:
[quote]
[schemaupdate] 信息: table found: CS.CARD
[schemaupdate] 2007-3-30 13:32:12 org.hibernate.tool.hbm2ddl.TableMetadata <init>
[schemaupdate] 信息: columns: [times_y, distrustful_times, card_limit, owe_amount, id, card_number, monthly_pay, id_type, customer_id, correct_percent_hy, limit_use_pecent_y, last_adjust_date, record_date, amount_y, daily_balance_y, open_date, card_class, distrustful_amount, owe_times, correct_amount_y, correct_percent_y, times_hy, customr_limit, amount_hy, correct_amount_hy, limit_use_pecent_hy, state, daily_balance_hy]
...
[schemaupdate] alter table TEST.CARD add ACCOUNT_LIMIT double precision default 0 not null
[/quote]
事实上TEST.CARD 表里面ACCOUNT_LIMIT 已经存在,CS.CARD里面确实还没有ACCOUNT_LIMIT

问题参考:http://forum.hibernate.org/viewtopic.php?t=972447&sid=a5e67497d46c525eaf1e766f64062fbb
[quote]

I'm trying to create a schema upgrade script via HBM2DDL and I'm running into an anomaly. When the tool looks up a table in the Oracle catalog, it doesn't specify the "owner" or "schema" name (the user id that I specified in the JDBC connection parms). It finds the first table with a matching name and creates SQL Alter Table stmts accordingly. Unfortunately, the table names as specified in my HBM files occur many times within my Oracle instance, under many different User IDs. Sometimes it finds the correct table but most times it encounters the wrong table.

Is there a parameter I can specify that would limit the tool to finding only tables owned by a specific User ?

I'm using the tool from within an ANT target on Widows XP.
[/quote]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值