facebook

New hibernate mappings end up in default package

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

    Thomas Trostel
    Participant

    I’ve been using MyEclipse for about a year and a half now. One thing I really like is the Hibernate mapping feature. Unfortunately with the latest version there seems to be a problem. No matter what I do with the latest version it seems to want to add the new POJO items to the default package. I have specified the package carefuly as before in the past but it stubbornly does not want to put them there.

    Is this a new bug? Can you generate POJOs in specified packages correctly? Is there a patch somewhere for this bug?

    Thanks

    Tom

    #250586 Reply

    Thomas Trostel
    Participant

    Found the answer to my own question. There was a bad reverse engineering file left in the directory. The program won’t change the directory for generation once it has been set.

    #250595 Reply

    Brian Fernandes
    Moderator

    Tom,

    Glad you’re back on track, but I’d like to find out what went wrong in the first place.
    You should be able to set the source folder and package each time you invoke the RE process (if you want to).

    When you said “bad reverse engineering file” what file were you referring to? Also, were there any errors in your log?

    I’m assuming you’re using MyEclipse 4.1.1 – are you also using any other Hibernate tools?

    Best,
    Brian.

    #251062 Reply

    jroberts
    Member

    If I may jump in….

    Looks like if you set the package, then change the class names for the tables without specifing the complete class it will put everything in the default package.

    Example:

    I set the package to hibernate.pojo

    I have the tables prefixed with a T_, so I set the class name for the table T_Checks to the class name: Check
    Click finish and it will put the generated classes and mappings in the default package.

    To work around this, put the full class name, so hibernate.pojo.Check instead of just Check.
    The reverse engineering file I believe he is refering to is the hibernate.reveng.xml

    At least with using the linux version of 4.1.1

    #258651 Reply

    qnob
    Member

    Iv’got the same problem with ME 5.0.1. In addition, there was as strange behavior when I entered the src path and package name. The Assistent didn’t want to accept it. It said that the given package wouldn’t exist.

    After a few attemps to get my mapping correctly, the assistant accepted my package. However, the sources were still generated to the default behavior. Finally, I’ve found the workaround above.

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: New hibernate mappings end up in default package

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