facebook

Modificaiton after enabling Hibernate Capabilities [Closed]

  1. MyEclipse Archived
  2.  > 
  3. Bugs
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #214494 Reply

    ylukekim
    Member

    Hi,

    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.

    #214501 Reply

    Riyad Kalla
    Member

    I have asked the developer to look at this.

    #214507 Reply

    support-jeff
    Member

    Yeah, 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.

    #214508 Reply

    support-jeff
    Member

    Actually, I recall the indexing is 0-based, so ensure you have config.mappings[0] and so on.

    #214523 Reply

    ylukekim
    Member

    I got it. Thank you!

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: Modificaiton after enabling Hibernate Capabilities [Closed]

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