- This topic has 4 replies, 3 voices, and was last updated 20 years, 2 months ago by ylukekim.
-
AuthorPosts
-
ylukekimMemberHi,
After enabling the Hibernate Capabilites for my web project and creating Hibernate mappings into the project by using the MyEclipse Database Explorer, I wanted to change the datatypes of some columns in my database tables. So I properly made changes for them in Oracle SQL*PLUS. After that, I realized I also had to change the Hibernate mappings/settings/codes as well. So I took actions listed below:
1. Deleted the related Hibernate Java and hbm.xml files generated by MyEclipse
2. Remove all the respective <mapping> Elements from hibernate.cfg.xml
3. Opened the MyEclipse Database Explorer, displayed the target tables whose (column) datatypes were modified, and created Hibernate mappings again for the targets (BUT in a different package name from before)The unexpected thing happened was that in hibernate.cfg.xml, all the removed <mapping> elements in step 2 were resurrected along with the new <mapping> elements. So I removed the resurrected ones.
Should I remove some lines in the “.myhibernatedata” file to prevent the problem? The file has contents like following. Is MyEclipse storing such mapping information in other places (or files), too?
config.mappings[1]=my/package/name/OldTablename1.hbm.xml
config.mappings[2]=my/package/name/OldTablename2.hbm.xml
config.mappings[3]=my/package/name/NewTablename1.hbm.xml
config.mappings[4]=my/package/name/NewTablename2.hbm.xml
…Thank you for your time.
Riyad KallaMemberI have asked the developer to look at this.
support-jeffMemberYeah, this is a known issue. I will be adding the ability to manage this list to the properties view for Hib-capable projects in the next release. For now, yes, you can modify the .myhibernatedata file to remove the old table mappings. Just be sure to re-index the new ones to 1, 2, etc.
support-jeffMemberActually, I recall the indexing is 0-based, so ensure you have config.mappings[0] and so on.
ylukekimMemberI got it. Thank you!
-
AuthorPosts