-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: specifying the hibernate.reveng.xml file for ant<hbm2hbmx
PostPosted: Tue Feb 06, 2007 10:39 am 
Newbie

Joined: Mon Jan 22, 2007 12:41 pm
Posts: 5
Hi,

I guess this is covered by a RTFM but I am having trouble getting this to bite when using a ant job to reverse engineer my hbms from jdbc.

I have a large database of which I only want 3 tables reversed engineered, so I have a hibernate.reveng.xml file with the following entries;
<table-filter match-catalog="operations" match-name="Hosted"/>
<table-filter match-catalog="operations" match-name="vcResult"/>
<table-filter match-catalog="operations" match-name="DevApplications"/>

I've set the reveng.xml in the jdbcconfiguration element;
<hibernatetool destdir="test/generated/src/java">
<classpath>
<path location="test/generated/src/java"/>
</classpath>
<jdbcconfiguration revengfile="hibernate.reveng.xml"
configurationfile="src/hibernate.cfg.xml">
<fileset dir="test/hibernate">
<include name="**/*.hbm.xml"/>
</fileset>
</jdbcconfiguration>
<hbm2hbmxml destdir="test">
</hbm2hbmxml>
<hbm2java >
</hbm2java>
<!-- <hbm2ddl export="false" outputfilename="filename.ddl"/>-->
</hibernatetool>

However, nothing is being output in terms of hbm files or java.

[hibernatetool] 1. task: hbm2hbmxml (Generates a set of hbm.xml files)
[hibernatetool] 06-Feb-2007 14:47:18 org.hibernate.cfg.Environment <clinit>
[hibernatetool] INFO: Hibernate 3.2.1
[hibernatetool] 06-Feb-2007 14:47:18 org.hibernate.cfg.Environment <clinit>
[hibernatetool] INFO: hibernate.properties not found
[hibernatetool] 06-Feb-2007 14:47:18 org.hibernate.cfg.Environment buildBytecodeProvider
[hibernatetool] INFO: Bytecode provider name : cglib
[hibernatetool] 06-Feb-2007 14:47:18 org.hibernate.cfg.Environment <clinit>
[hibernatetool] INFO: using JDK 1.4 java.sql.Timestamp handling
[hibernatetool] 06-Feb-2007 14:47:18 org.hibernate.cfg.Configuration configure
[hibernatetool] INFO: configuring from file: hibernate.cfg.xml
[hibernatetool] 06-Feb-2007 14:47:19 org.hibernate.cfg.JDBCMetaDataConfiguration parseMappingElement
[hibernatetool] INFO: Ignoring SessionFactory mapping
[hibernatetool] 06-Feb-2007 14:47:19 org.hibernate.cfg.JDBCMetaDataConfiguration parseMappingElement
[hibernatetool] INFO: Ignoring SessionFactory mapping
[hibernatetool] 06-Feb-2007 14:47:19 org.hibernate.cfg.JDBCMetaDataConfiguration parseMappingElement
[hibernatetool] INFO: Ignoring SessionFactory mapping
[hibernatetool] 06-Feb-2007 14:47:19 org.hibernate.cfg.JDBCMetaDataConfiguration parseMappingElement
[hibernatetool] INFO: Ignoring SessionFactory mapping
[hibernatetool] 06-Feb-2007 14:47:19 org.hibernate.cfg.JDBCMetaDataConfiguration parseMappingElement
[hibernatetool] INFO: Ignoring SessionFactory mapping
[hibernatetool] 06-Feb-2007 14:47:19 org.hibernate.cfg.Configuration doConfigure
[hibernatetool] INFO: Configured SessionFactory: SessionFactory
[hibernatetool] 06-Feb-2007 14:47:20 org.hibernate.cfg.reveng.OverrideRepository addFile
[hibernatetool] INFO: Override file: G:\Projects\eclipse_projects\versioning\hibernate.reveng.xml
[hibernatetool] 06-Feb-2007 14:47:20 org.hibernate.connection.C3P0ConnectionProvider configure
[hibernatetool] INFO: C3P0 using driver: org.gjt.mm.mysql.Driver at URL: jdbc:mysql://ops-server/operations
[hibernatetool] 06-Feb-2007 14:47:20 org.hibernate.connection.C3P0ConnectionProvider configure
[hibernatetool] INFO: Connection properties: {user=ops, password=****}
[hibernatetool] 06-Feb-2007 14:47:20 org.hibernate.connection.C3P0ConnectionProvider configure
[hibernatetool] INFO: autocommit mode: false
[hibernatetool] 06-Feb-2007 14:47:21 com.mchange.v2.log.MLog <clinit>
[hibernatetool] INFO: MLog clients using java 1.4+ standard logging.
[hibernatetool] 06-Feb-2007 14:47:21 com.mchange.v2.c3p0.C3P0Registry banner
[hibernatetool] INFO: Initializing c3p0-0.9.0 [built 11-July-2005 00:43:29 -0400; debug? true; trace: 10]
[hibernatetool] 06-Feb-2007 14:47:26 com.mchange.v2.c3p0.PoolBackedDataSource getPoolManager
[hibernatetool] INFO: Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@78bc3b [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@5bb966 [ acquireIncrement -> 1, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 5bb966, idleConnectionTestPeriod -> 0, initialPoolSize -> 5, maxIdleTime -> 1800, maxPoolSize -> 20, maxStatements -> 50, maxStatementsPerConnection -> 0, minPoolSize -> 5, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@18352d8 [ description -> null, driverClass -> null, factoryClassLocation -> null, identityToken -> 18352d8, jdbcUrl -> jdbc:mysql://ops-server/operations, properties -> {user=******, password=******} ], preferredTestQuery -> null, propertyCycle -> 300, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, usesTraditionalReflectiveProxies -> false ], factoryClassLocation -> null, identityToken -> 78bc3b, numHelperThreads -> 3 ]
[hibernatetool] 06-Feb-2007 14:47:27 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: RDBMS: MySQL, version: 5.0.20-nt
[hibernatetool] 06-Feb-2007 14:47:27 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-3.1.12 ( $Date: 2005-11-17 15:53:48 +0100 (Thu, 17 Nov 2005) $, $Revision$ )
[hibernatetool] 06-Feb-2007 14:47:27 org.hibernate.dialect.Dialect <init>
[hibernatetool] INFO: Using dialect: org.hibernate.dialect.MySQLDialect
[hibernatetool] 06-Feb-2007 14:47:27 org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory
[hibernatetool] INFO: Using default transaction strategy (direct JDBC transactions)
[hibernatetool] 06-Feb-2007 14:47:27 org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
[hibernatetool] INFO: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
[hibernatetool] 06-Feb-2007 14:47:27 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Automatic flush during beforeCompletion(): disabled
[hibernatetool] 06-Feb-2007 14:47:27 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Automatic session close at end of transaction: disabled
[hibernatetool] 06-Feb-2007 14:47:27 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: JDBC batch size: 15
[hibernatetool] 06-Feb-2007 14:47:27 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: JDBC batch updates for versioned data: disabled
[hibernatetool] 06-Feb-2007 14:47:27 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Scrollable result sets: enabled
[hibernatetool] 06-Feb-2007 14:47:27 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: JDBC3 getGeneratedKeys(): enabled
[hibernatetool] 06-Feb-2007 14:47:27 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Connection release mode: auto
[hibernatetool] 06-Feb-2007 14:47:27 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Maximum outer join fetch depth: 2
[hibernatetool] 06-Feb-2007 14:47:27 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Default batch fetch size: 1
[hibernatetool] 06-Feb-2007 14:47:27 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Generate SQL with comments: disabled
[hibernatetool] 06-Feb-2007 14:47:27 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Order SQL updates by primary key: disabled
[hibernatetool] 06-Feb-2007 14:47:27 org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory
[hibernatetool] INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
[hibernatetool] 06-Feb-2007 14:47:27 org.hibernate.hql.ast.ASTQueryTranslatorFactory <init>
[hibernatetool] INFO: Using ASTQueryTranslatorFactory
[hibernatetool] 06-Feb-2007 14:47:27 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Query language substitutions: {}
[hibernatetool] 06-Feb-2007 14:47:27 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: JPA-QL strict compliance: disabled
[hibernatetool] 06-Feb-2007 14:47:27 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Second-level cache: enabled
[hibernatetool] 06-Feb-2007 14:47:27 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Query cache: disabled
[hibernatetool] 06-Feb-2007 14:47:27 org.hibernate.cfg.SettingsFactory createCacheProvider
[hibernatetool] INFO: Cache provider: org.hibernate.cache.NoCacheProvider
[hibernatetool] 06-Feb-2007 14:47:27 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Optimize cache for minimal puts: disabled
[hibernatetool] 06-Feb-2007 14:47:27 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Structured second-level cache entries: disabled
[hibernatetool] 06-Feb-2007 14:47:27 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Statistics: disabled
[hibernatetool] 06-Feb-2007 14:47:27 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Deleted entity synthetic identifier rollback: disabled
[hibernatetool] 06-Feb-2007 14:47:27 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Default entity-mode: pojo
[hibernatetool] 06-Feb-2007 14:47:29 org.hibernate.tool.Version <clinit>
[hibernatetool] INFO: Hibernate Tools 3.2.0.beta8

Any ideas?

Thanks,

T


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 06, 2007 11:01 am 
Newbie

Joined: Mon Jan 22, 2007 12:41 pm
Posts: 5
Gah! I had configured MySQL to change the case of the table names, and the reveng.xml file was no-longer case-correct. So was ignoring the tables.

And the double Gah! is that I have read that before, but I was having a different problem at the time....

T


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 06, 2007 11:16 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
any chance you could try out b9 on the exact same setup ?

b9 has/should have better automatic handling of casing so it should work even though the table/column casing does not match....

would be helpfull if you could check if it works for you (do remember to use an uptodate driver since we depend on it telling us what kind of casing the db supports)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 06, 2007 2:51 pm 
Newbie

Joined: Mon Jan 22, 2007 12:41 pm
Posts: 5
It's not matching...

with the correct case table name as for example in my reveng.xml;
<table-filter match-catalog="operations" match-name="vc_result"/>

matches my table
mysql> show create table vc_version;
---------------------------------------------------+
| vc_version | CREATE TABLE `vc_version` (
`versionId` int(11) NOT NULL auto_increment,
`applicationId` int(11) default NULL,
`checksum` varchar(32) default NULL,
`version` varchar(12) default NULL,
PRIMARY KEY USING BTREE (`versionId`),
KEY `FK_VersionApplicationId` (`applicationId`),
CONSTRAINT `FK_VersionApplicationId` FOREIGN KEY (`applicationId`) REFERENCES
`application` (`applicationId`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+------------+------------------------------------------------------------------

however, if I change the line in the reveng.xml file to;
<table-filter match-catalog="operations" match-name="Vc_result"/>
This fails to generate the hbm.xml for that table.

I've installed the hibernate-tools version C:\eclipse\plugins\org.hibernate.eclipse_3.2.0.beta9a
and removed the old plugins

hibernate app is configured with;
Hibernate-Version: 3.2.1.ga
mysql-connector-java-5.0.4-bin.jar

server is win2003;
| lower_case_file_system | OFF
| lower_case_table_names | 1
Server version 5.0.20-nt
Protocol version 10


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 08, 2007 5:48 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
post to jira with a ref to this forum

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.