- This topic has 4 replies, 2 voices, and was last updated 17 years, 6 months ago by jhbowling.
-
AuthorPosts
-
jhbowlingMemberI created a subclass of DelegatingReverseEngineeringStrategy to map the plural table names to singular for my DTO’s, which worked, but I would like to keep the plural name for the DAO’s. Is there a way to do this?
Brian FernandesModeratorI’m sorry, but that level of granularity is not available at this time, if the class name is customized (either on page 3 of the RE wizard) or via the strategy, both DAOs and POJOs will use the same name.
jhbowlingMemberEven if I use page 3 and map the class names, they aren’t being handled properly in the set relationships. For example, if I change the name ratings to rating the relationship comes out as ratingses. It is using the un-mapped name and then trying to make it plural. It seems like your implementation pretty much makes it impossible to use plural table names and get anything reasonable. Can you recommend anything?
Brian FernandesModeratorJust to clarify, I did not suggest page 3 as a solution, but mentioned that it would have the same outcome.
Using the DelegatingReverseEngineeringStrategy will give you the same effect, and more control – unfortunately it is not possible to have one strategy class used for the POJOs and some other strategy class for DAOs.
The final option would involve using your existing strategy for the POJOs but modifying the DAO velocity template (daohome.vm) to be smarter (would take a good amount of hard coding). You can find details on template modification in section 5.6 of the Hibernate Development quickstart in the integrated help system.
jhbowlingMemberActually, I have given up on wanting the DAO’s singular and the DAO’s plural, I was just trying to have everything properly mapped from plural table names to singular across the board. This means singular DTO’s, DAO’s, and then plural relationship methods that return a set. Any other suggestions? The current implementation (using page 3) seems to not be using the mapped names for relationship attributes and therefore relationship methods.
-
AuthorPosts