default_schema should be the same as user name.
Unless, of course, you wish to log in to Oracle with one user name and access another user's tables (this is commonly done to enforce read/write constraints).
The wait is normal. Oracle is extremely slow when providing metadata, for whatever reasons.
Do you have a schema-selection clause in hibernate.reveng.xml? The Oracle dialect code needs that, the default doesn't work (one of the stumbling blocks that I hit).
Make sure to use a table-filter as well, a database with a few hundred tables requires ten minutes or so to produce the list of tables. I found this to be unbearably slow and have eventually resorted to explicitly listing each and every table that I want reverse engineered.
Here's the basic structure of my hibernate.reveng.xml file:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE
hibernate-reverse-engineering
PUBLIC
"-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd"
>
<hibernate-reverse-engineering>
<schema-selection match-schema="USERNAME" />
<type-mapping>
...
</type-mapping>
<table-filter match-name="SOME_TABLE_1" />
...
<table-filter match-name="SOME_TABLE_N" />
<table name="SOME_TABLE_1">
<column
name="FIELD_1"
type="com.my.company.lib.usertypes.YN_boolean">
<meta attribute="default-value">false</meta>
</column>
<column name="SOME_DATE_FIELD">
<meta attribute="default-value">new java.sql.Date (new java.util.GregorianCalendar (9999, 11, 31).getTimeInMillis ())</meta>
</column>
<column name="VERSION"
type="long" />
...
<foreign-key foreign-table="USER" constraint-name="fk_table1_user">
<column-ref local-column="T1USER" foreign-column="USID" />
<many-to-one />
<set exclude="true" />
</foreign-key>
...
</table>
...
</hibernate-reverse-engineering>
As you can see, I'm explicitly specifying default values. These need to be kept in sync with the database - it would be nicer if Hibernate Tools could reverse engineer defaults, but it's hard because at least Oracle returns column defaults as SQL expressions in String form.
I'm also explicitly specifying lots of user types.
This allows me to set things up so that I'll get a type error whenever the database schema changes in incompatible ways, but it also burdens me with specifying user types on roughly 50% of any table's columns. (I think it's worth the effort for the project I'm in, since setting up a unit test would be roughly the same or a little more effort, but that's just the way I work.)