MyEclipse: How to update abstract class after change to *.hbm.xml?
digulla - Jun 30, 2005 - 01:00 PM
Post subject: How to update abstract class after change to *.hbm.xml?
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 :?
support-rkalla - Jun 30, 2005 - 03:00 PM
Go 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.
digulla - Jul 01, 2005 - 12:50 PM
I don't want to overwrite the mapping file after I just fixed it.
How do I create the abstract class from the mapping file?
digulla - Jul 01, 2005 - 03:03 PM
Specifically, 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.
support-rkalla - Jul 01, 2005 - 03:40 PM
I'm sorry at this time we don't support this level of control over the mapping generation process.
digulla - Jul 04, 2005 - 11:27 AM
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.
support-rkalla - Jul 04, 2005 - 05:48 PM
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.
digulla - Jul 06, 2005 - 03:51 PM
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.
support-rkalla - Jul 06, 2005 - 03:59 PM
Aaron, I think that is a good idea, I'll file that enhancement request.
Finch - Jul 13, 2005 - 12:45 PM
I 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?
support-rkalla - Jul 13, 2005 - 03:06 PM
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.
All times are GMT - 6 Hours
Powered by PNphpBB2
© 2003-2004 The PNphpBB GroupCredits