History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: APF-1045
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Matt Raible
Reporter: JC Oosthuizen
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
AppFuse

appfuse:gen not generating for entities with similar names

Created: 08/Apr/08 06:52 AM   Updated: 03/May/08 10:00 AM
Component/s: Tools - AMP
Affects Version/s: 2.0.1
Fix Version/s: 2.0.2

File Attachments: 1. Text File amp_diff.txt (3 kb)
2. Text File diff.txt (1 kb)

Environment: Windows XP Professional, Maven version: 2.0.8, Java version: 1.5.0_04, Appfuse version 2.0.1


 Description  « Hide
I have a entity called MeterLocation which is already properly generated and installed. When I try to add a new entity called Meter appfuse:gen will wrongly think that it is already generated and when it tries to install it, it complains about the sample data being missing as this was not generated.

The problem is in src\main\java\org\appfuse\mojo\exporter\AppFuseGeneratorMojo.java:
Line 289: if (!hibernateCfgXml.contains(pojoName)) {
Line 332: if (entity.contains(pojoName)) {

I tried to fix the problem and fixed (fix attached) it for my case, but this causes some of the test cases to fail. The reason is that I used Regular Expressions which match greedily and will not always work correctly. I would suggest the use of a proper XML parser. This will be easiest to implement and will not cause the current tests to fail.

 All   Comments   Change History   FishEye      Sort Order:
JC Oosthuizen - 10/Apr/08 06:16 AM
I have a proposed solution using a SAX parser to check if the pojo is already registered in die hibernate config file.

see amp_diff.txt.

JC Oosthuizen - 10/Apr/08 06:17 AM
SAX parser implementation to solve the issue.

Matt Raible - 10/Apr/08 10:27 AM
Thanks for the patch!