Hello,
I have not been able to generate working ORM code, so I created small test case.
My environment is as follows:
VP-UML Professional Version 6.0 (Build sp2_20070526)
OS: Mac OS X Version 10.4.9 - 2 GB Ram
Attachments:
IDemo.vpp
VP-UML.log
Below is a detailed list of steps I have taken and the results produced.
1. Create Entity Relationship Diagram
- Create ORM package in Eclipse e.g. com.arkadias.idemo.orm
- Place odbc driver file in ~orm.lib
- Create new ER diagram in VP-UML
- Assign tables, columns and data types on ERD
2. Create Class diagram from ER diagram
- Create Class diagram from ER diagram
- Tools/Object-Relational Mapping (ORM)/Synchronize to Class Diagram
- Assign <<ORM Persistable>> stereotype as needed
===============================================
== First attempt
===============================================
3. Create database and persistable objects (ORM) from ERD
- Create database manually (if needed)
- Generate Code and Database from ERD
- Tools/Object-Relational Mapping (ORM)/Wizards
- Welcome page
- Language: Java
- Wizards: Generate Code and Database from ERD
- Class Details Configuration page
- Package: ORM package name (e.g. idemo.orm)
- Database Configuration page
- Driver file select from ~orm/lib
- Generate Code page
- Error Handling: Throw PesistentException
- Exception Handling: Print to log4j
- Default Lazy Collection Initialization: Lazy for small data set, Extra for large
- Mapping Type: Annotation
- Output Path: ~orm
- Deploy to: (as appropriate for target system) e.g. Standalone Application
- Association Handling: Smart (handles both side of 1 - many updates)
- Persistent API: Factory Class
- Generate Criteria: Check (generates criteria (query) objects
- Serializable: Not Check
- Cache Options: EHCache
- Select Optional Jar: (default)
- Advance Settings:
- Samples: As desired (generates ORM usage sample code)
- Scripts: None (Script execution not supported until VP-Suite 3.1 ~06.2007)
4. Correct ORM code errors
Compile time errors
- Rename (refactor) ~orm package to match package name in source e.g.
- com.arkadias.idemo.orm.src.com.arkadias.idemo.orm > com.arkadias.idemo.orm
- com.arkadias.idemo.orm.src.ormsamples > com.arkadias.idemo.orm.samples
- Add ~orm.lib jars to project java build path
Runtime errors
- HibernateException: /ormmapping/IDemo.cfg.xml not found
- Rename com.arkadias.idemo.orm.src.ormmapping -> ormmapping
- Hibernate cache errors
- WARN EhCacheProvider:86 - Could not find configuration [hibernate.test.org.hibernate.cache.UpdateTimestampsCache]; using defaults.
- WARN EhCacheProvider:86 - Could not find configuration [hibernate.test.org.hibernate.cache.StandardQueryCache]; using defaults.
===============================================
=== Second attempt
===============================================
3. Create database and persistable objects (ORM) from Class Diagram
- Create database manually (if needed)
- Generate Code and Database from Class Diagram
- Tools/Object-Relational Mapping (ORM)/Wizards
- Welcome page
- Language: Java
- Wizards: Generate Code and Database from Class Diagram
- Selecting Classes page
- Confirm default settings
- Table Details Configuration
- Confirm default settings
- Database Configuration page
- Export to Database: Check if desired
- Generate DDL: Check if desired
- Quote SQL Identifier: Auto
- Table Character set: UTF8
- Connection: JDBC
- JDBC
- Use connection pooling: Check
- Driver MySQL (Connector/J Driver)
- Driver file select from ~orm/lib
- Connection URL & User: as appropriate
- Engine: Default
- Set as default: Check
- Test Connection: Confirm connection
- Generate Code page
- Generate Code: Check
- Error Handling: Throw PesistentException
- Exception Handling: Print to log4j
- Default Lazy Collection Initialization: Lazy for small data set, Extra for large
- Mapping Type: Annotation
- Output Path: ~orm
- Deploy to: Standalone Application (as appropriate for target system)
- Association Handling: Smart (handles both side of 1 - many updates)
- Persistent API: Factory Class
- Generate Criteria: Check (generates criteria (query) objects
- Serializable: Not Check
- Cache Options: EHCache
- Default Settings ok
- Classes Cache Configuration
- Enable cache for appropriate classes (Set Read-Only)
- Select Optional Jar: (default)
- Advance Settings: Default values Ok
- Samples: As desired (generates ORM usage sample code)
- Scripts: None (Script execution not supported until VP-Suite 3.1 ~06.2007)
- Generate Filter and Web Application Descriptor: Not Checked
4. Correct ORM code errors
=== Failed /tmp/orm43978/src/com/arkadias/idemo/orm/IDemoName.java (No such file or directory)
ORM Message:
[14:16:59] [Message] Generating code...
[14:16:59] [Message] Copying libraries...
[14:17:03] [Message] Generating configuration file...
[14:50:32] [Message] Generating code...
[14:50:32] [Message] Copying libraries...
[14:50:37] [Message] Generating configuration file...
[14:50:37] [Error] java.io.FileNotFoundException: /tmp/orm43978/src/com/arkadias/idemo/orm/IDemoName.java (No such file or directory)
[14:54:22] [Message] Generate code finish...
=== BUT: The path mentioned in the [Error] above does exist, in fact, the entire structure exists...
The annotations.jar and orm.jar are missing from the Eclipse workspace.
These files were generated and exist in /tmp/orm43978
Copy /tmp/orm43978/lib/* -> {project}/src/com/arkadias/idemo/orm/lib/
seems to get us to the state after Code Generation in ==First Attempt above
Compile time errors
- Rename (refactor) ~orm package to match package name in source e.g.
- com.arkadias.idemo.orm.src.com.arkadias.idemo.orm > com.arkadias.idemo.orm
- com.arkadias.idemo.orm.src.ormsamples > com.arkadias.idemo.orm.samples
- Add ~orm.lib jars to project java build path
Runtime errors
- HibernateException: /ormmapping/IDemo.cfg.xml not found
- Rename com.arkadias.idemo.orm.src.ormmapping > ormmapping
- No ormmapping files were generated
I’m stuck at this point, any insight, suggestions, etc would be greatly appreciated.
Best regards,
-Glen Ihrig
VP-UML.log
IDemo.vpp