- This topic has 10 replies, 3 voices, and was last updated 19 years, 11 months ago by
Riyad Kalla.
-
AuthorPosts
-
Aaron DigullaMemberHello,
I’ve just installed Eclipse 3.1 with MyEclipse 4.0m2. I’ve successfully created a hibernate mapping (except that no “id” element was created; I guess ME couldn’t figure out the PKs).
Now, I’ve added the missing elements and renamed a couple of fields. How do I generate the abstract class again? Just saving the XML doesn’t work 😕
Thanks.
June 30, 2005 at 9:00 am #232005
Riyad KallaMemberGo back to the DB explorer, right click on your table and “Generate Hibernate Mapping”, keep in mind that it will overwrite the Abstract class as well as the mapping file, so backup your changes inthe mapping file if you made them.
July 1, 2005 at 6:50 am #232076
Aaron DigullaMemberI don’t want to overwrite the mapping file after I just fixed it.
How do I create the abstract class from the mapping file?
July 1, 2005 at 9:03 am #232099
Aaron DigullaMemberSpecifically, I guess that ME first generates the mapping file and then runs some Java code to convert the XML into Java classes. Is there a way to run this second step manually?
For example, by creating a Launch config in Eclipse in which I add lots of external JARs from the MQ install. In which class is this code?
I could then do this myself and post the results.
July 1, 2005 at 9:40 am #232103
Riyad KallaMemberAaron,
I’m sorry at this time we don’t support this level of control over the mapping generation process.July 4, 2005 at 5:27 am #232240
Aaron DigullaMemberRiyad,
Will this be in ME 4.0? I think this is a must-have because the generation process works so unreliably when it comes to primary keys and pk generators.
Regards.
July 4, 2005 at 11:48 am #232259
Riyad KallaMemberAaron,
We made some improvements to the automaic mappings, but the big “fix” is going to come in the form of a visual mapping editor where you can visually drag and drop the relationships between tables before the mappings are generated. That didn’t make the 4.0 cut becasue our users demanded Hibernate 3 support instead, so the visual editor will make a later release, but it should help you with the situation you are having.I’m sorry for the trouble in the mean time.
July 6, 2005 at 9:51 am #232386
Aaron DigullaMemberRiyad,
This editor sounds great but I think that a “regenerate file” button in the MyEclipse menu for all *.hbm.xml files would just take a couple of hours to implement and ease the situation until the editor becomes available.
As it is, the whole hibernate functionality of ME is useless for me, so I would like to ask you to file a bug on my behalf that needs to be fixed for 4.0 final.
Thanks,
July 6, 2005 at 9:59 am #232391
Riyad KallaMemberAaron, I think that is a good idea, I’ll file that enhancement request.
July 13, 2005 at 6:45 am #232867
FinchMemberI have a different but “similar” question: (ME 4.0 M2)
1) What’s an easy way of updating (checking) all hbm.xml and my classes after changes to the database? I mean… of course I can “create hibernate mapping” again, but it doesn’t even remember where I put the files/classes last time. Doesn’t really seem very practical for a large number of tables!!
2) (How) can I define relations which are not defined in the database and have them survive an update?Thanks 🙂
July 13, 2005 at 9:06 am #232880
Riyad KallaMemberFinch,
These more advanced issues are to be addressed in a future release with our visual relationship editor, it won’t make the 4.0 release as Hibernate 3 support (by user demand) was more important, but it is comming. -
AuthorPosts