facebook

tableToClassName

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #271846 Reply

    jhbowling
    Member

    I 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?

    #271877 Reply

    Brian Fernandes
    Moderator

    I’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.

    #271899 Reply

    jhbowling
    Member

    Even 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?

    #271902 Reply

    Brian Fernandes
    Moderator

    Just 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.

    #271914 Reply

    jhbowling
    Member

    Actually, 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.

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: tableToClassName

You must be logged in to post in the forum log in