0 Replies Latest reply on Jan 15, 2020 12:48 PM by bucpatr

    Controlling Class Names and Packages of Generated POJO Classes

    bucpatr Newbie

      I have an existing project with an established JPA annotated model. I want to use hibernate tools to generate a set of POJO classes that correspond to my existing model classes. I followed the instructions here: Hibernate Tools Reference Guide and was able to generate my classes. The problem I'm having now is that the generated classes have identical class names and packages to the existing model classes. If I try to include the generated classes anywhere in my project they will end up conflicting with the existing model classes. There are too many files to go through and refactor them one at a time. I need a more automated solution.

       

      I looked at using the generated-class attribute of the <meta> tag. It looks like exactly what I want, but I don't see any way of using it with <jpaconfiguration>. Even if I could somehow get it to use both persistence.xml and hbm.xml I would still be left with the issue of creating and maintaining hbm files for all of my model classes. Is there any way to do this or am I just going beyond what hibernate tools is capable of?