Hi Matt, On 11/7/07, Matt Raible <[EMAIL PROTECTED]> wrote: > On Nov 7, 2007, at 8:20 AM, Josef Cacek wrote: > > It's really my own file used. When I've tried to use the default one, > > oracle tried to get tables from all schemes (so the schema-selection > > element is necessary) and didn't excluded AppFuse own tables (e.g. > > APP_USER) because oracle has table names in upper case and in the > > default file the names are in lower-case. > > > >> The comments on the following issue may help you solve this problem: > >> http://issues.appfuse.org/browse/APF-902 > > > > I've already read this issue and it helped me to start with > > hibernate.reveng.xml file. But the type-mapping doesn't work for me. > > > > Now, I've tried to test it with MySql. It generates 'short' members > > with the default hibernate.reveng. If I use my own hibernate.reveng > > it generates 'java.lang.Short', so the problem is somehow linked with > > Oracle. (I don't like bugs like this one. :( ) > > My guess is it might be the datatype in Oracle. You might want to > verify the type is what you think it is in Oracle.
I didn't find the source of problem, I don't know how to simply debug hibernate-tools, but I guess the problem is somewhere there (maybe OverrideBinder or OverrideRepository class). But anyway, I've found a workaround. I've placed following line to src/main/resources/jdbc.properties: hibernatetool.metadatadialect=org.hibernate.cfg.reveng.dialect.OracleMetaDataDialect Then it generates object types for my number columns. Interesting is, the columns which were originally short(s) are now java.lang.Long(s) even if in the mapping is the line <sql-type jdbc-type="SMALLINT" hibernate-type="java.lang.Short" /> If you look into JDBC 3.0 specification Appendix B, you'll see the only JDBC type for which is "short" used is the "SMALLINT". So it seems the OracleMetaDataDialect class returns another type for table column than default JDBCMetaDataDialect class. > Matt -- Josef Cacek P.S. Could you please implement this info and how-to for hibernate.reveng.xml file to AppFuse documentation, so the other oracle users can simply find it? --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
