facebook

hibernate not generating Sets to represent FK relations

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

    jamicide
    Member

    Recently my hibernate mapping generator stopped working as I expect it to. I don’t remember making any settings changes.

    Now, if I attempt to generate a hibernate mapping from a InnoDB table, the generated Java classes don’t use Sets and/or Java objects to represent FK relationships. The sets have simply disappeared, and the Java objects are instead integers representing the ID of the object in the other table (as I am used to seeing when generating classes from MyISAM tables).

    I have tried this across multiple projects, all with the same result.

    Any advice on how to get this working properly again? I am using MyEclipse v4.1.1-GA

    Thanks in advance.

    #284809 Reply

    Loyal Water
    Member

    Can you switch to a new workspace (File > Switch Workspace > Temp) and test this again. Does the problem persist ?

    #284811 Reply

    jamicide
    Member

    If I try and generate a class from another workspace, an error pops up:

    An internal error occurred during: “Generating Artifacts”.

    In this new workspace I had to re-setup the driver connection details, but I’m fairly certain I did that correctly.

    #284821 Reply

    jamicide
    Member

    A slight update. I fixed the generating artifacts problem and was able to correctly generate the Java classes from the InnoDB tables.

    What might be wrong with my original workspace to cause the error?

    #284843 Reply

    Loyal Water
    Member

    I guess you old workspace might have gone corrupt. You can try switch back to your old workspace and using the -clean command to try and fix it:-
    https://www.genuitec.com/forums/topic/troubleshoot-using-the-clean-command-line-argument/

    #285020 Reply

    jamicide
    Member

    A bit of an update. Switching to the new workspace did not fix my problem. Not quite sure what I saw that first time around.

    Also, running clean seems to have no effect on my problem.

    Any more suggestions? 🙂

    #285030 Reply

    Loyal Water
    Member

    I would suggest you grab the latest version of MyEclipse (6.0.1 GA), setup MyEclipse to a brand new location and test this out again,

    #285805 Reply

    jamicide
    Member

    Another update.

    I can correctly generate the Hibernate classes when I connect to other databases – it seems to be that only when trying to generate the classes from my local database is there an error. Can you think of any database settings that could account for this?

    Thanks

    #285840 Reply

    Loyal Water
    Member

    Did you upgrade to 6.0.1? Your working with the MySQL database?

Viewing 9 posts - 1 through 9 (of 9 total)
Reply To: hibernate not generating Sets to represent FK relations

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