max wrote:
don't know maxdb, do they also not generate unique foreignkeys ?
With MaxDB situation is even worse, it generates POJO and mappings without any warnings and exeptions.
By the way, in MaxDB schema all forein keys are named.
Here is ant task:
Code:
<target name="reverseToJavaHbmXml">
<hibernatetool>
<jdbcconfiguration packagename="test" configurationfile="hibernate_4SapDB.cfg.xml" revengfile="hibernate.reveng.xml"/>
<hbm2hbmxml destdir="src/"/>
<hbm2java destdir="src/"/>
<hbm2cfgxml destdir="" ejb3="false"/>
</hibernatetool>
</target>
A part of hibernate log:
Code:
[hibernatetool] Executing Hibernate Tool with a JDBC Configuration (for reverse engineering)
[hibernatetool] 1. task: hbm2hbmxml (Generates a set of hbm.xml files)
[hibernatetool] 10:27:59,326 INFO Environment:500 - Hibernate 3.2 cr3
[hibernatetool] 10:27:59,341 INFO Environment:533 - hibernate.properties not found
[hibernatetool] 10:27:59,341 INFO Environment:667 - Bytecode provider name : cglib
[hibernatetool] 10:27:59,357 INFO Environment:584 - using JDK 1.4 java.sql.Timestamp handling
[hibernatetool] 10:27:59,482 INFO Configuration:1384 - configuring from file: hibernate_4SapDB.cfg.xml
[hibernatetool] 10:27:59,576 INFO Configuration:1465 - Configured SessionFactory: GenericSessionFc
[hibernatetool] 10:27:59,685 INFO OverrideRepository:100 - Override file: C:\usr\projects\TestDiploma\hibernate.reveng.xml
[hibernatetool] 10:27:59,763 INFO DriverManagerConnectionProvider:41 - Using Hibernate built-in connection pool (not for production use!)
[hibernatetool] 10:27:59,763 INFO DriverManagerConnectionProvider:42 - Hibernate connection pool size: 20
[hibernatetool] 10:27:59,763 INFO DriverManagerConnectionProvider:45 - autocommit mode: false
[hibernatetool] 10:27:59,794 INFO DriverManagerConnectionProvider:80 - using driver: com.sap.dbtech.jdbc.DriverSapDB at URL: jdbc:sapdb://localhost/MAXDB1
[hibernatetool] 10:27:59,794 INFO DriverManagerConnectionProvider:86 - connection properties: {user=mona, password=****}
[hibernatetool] 10:28:00,123 INFO SettingsFactory:81 - RDBMS: SAP DB, version: KERNEL 7.6.00 BUILD 032-123-130-190
[hibernatetool] 10:28:00,123 INFO SettingsFactory:82 - JDBC driver: SAP DB, version: package com.sap.dbtech.jdbc, MaxDB JDBC Driver, MySQL MaxDB, 7.6.0 Build 030-000-005-567
[hibernatetool] 10:28:00,154 INFO Dialect:141 - Using dialect: org.hibernate.dialect.SAPDBDialect
[hibernatetool] 10:28:00,232 INFO TransactionFactoryFactory:31 - Using default transaction strategy (direct JDBC transactions)
[hibernatetool] 10:28:00,279 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
[hibernatetool] 10:28:00,279 INFO SettingsFactory:134 - Automatic flush during beforeCompletion(): disabled
[hibernatetool] 10:28:00,279 INFO SettingsFactory:138 - Automatic session close at end of transaction: disabled
[hibernatetool] 10:28:00,279 INFO SettingsFactory:145 - JDBC batch size: 15
[hibernatetool] 10:28:00,279 INFO SettingsFactory:148 - JDBC batch updates for versioned data: disabled
[hibernatetool] 10:28:00,279 INFO SettingsFactory:153 - Scrollable result sets: enabled
[hibernatetool] 10:28:00,279 INFO SettingsFactory:161 - JDBC3 getGeneratedKeys(): disabled
[hibernatetool] 10:28:00,279 INFO SettingsFactory:169 - Connection release mode: auto
[hibernatetool] 10:28:00,279 INFO SettingsFactory:196 - Default batch fetch size: 1
[hibernatetool] 10:28:00,294 INFO SettingsFactory:200 - Generate SQL with comments: disabled
[hibernatetool] 10:28:00,294 INFO SettingsFactory:204 - Order SQL updates by primary key: disabled
[hibernatetool] 10:28:00,294 INFO SettingsFactory:369 - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
[hibernatetool] 10:28:00,294 INFO ASTQueryTranslatorFactory:24 - Using ASTQueryTranslatorFactory
[hibernatetool] 10:28:00,294 INFO SettingsFactory:212 - Query language substitutions: {}
[hibernatetool] 10:28:00,294 INFO SettingsFactory:217 - JPA-QL strict compliance: disabled
[hibernatetool] 10:28:00,294 INFO SettingsFactory:222 - Second-level cache: enabled
[hibernatetool] 10:28:00,310 INFO SettingsFactory:226 - Query cache: disabled
[hibernatetool] 10:28:00,310 INFO SettingsFactory:356 - Cache provider: org.hibernate.cache.NoCacheProvider
[hibernatetool] 10:28:00,310 INFO SettingsFactory:241 - Optimize cache for minimal puts: disabled
[hibernatetool] 10:28:00,310 INFO SettingsFactory:250 - Structured second-level cache entries: disabled
[hibernatetool] 10:28:00,326 INFO SettingsFactory:277 - Statistics: disabled
[hibernatetool] 10:28:00,326 INFO SettingsFactory:281 - Deleted entity synthetic identifier rollback: disabled
[hibernatetool] 10:28:00,326 INFO SettingsFactory:296 - Default entity-mode: pojo
[hibernatetool] 10:28:01,060 INFO DriverManagerConnectionProvider:147 - cleaning up connection pool: jdbc:sapdb://localhost/MAXDB1
[hibernatetool] 10:28:01,201 INFO Version:15 - Hibernate Tools 3.2.0.beta7
10:28:01,810 INFO DriverManagerConnectionProvider:147 - cleaning up connection pool: jdbc:sapdb://localhost/MAXDB1
...............................................
[hibernatetool] 3. task: cfg2cfgxml (Generates hibernate.cfg.xml)
BUILD SUCCESSFUL