facebook

howto Hibernate2 -> Hibernate3 project update

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

    I have already replaced the jars and fixed all the compilation errors etc (and the app actually works).
    Bbut Project->Properties -> MyEclipse-Hibernate still shows
    “Hibernate Version: 2.1”

    3 Questions:
    – Will this affect the functionality of MyEclipse in further development or is it benign?
    – How do I fix it ?
    – Is there an easier way to move a project from Hibernate2 to Hibernate3

    Any help is very much appreciated.
    Thank you.

    #232693 Reply

    Riyad Kalla
    Member

    1) I know we made 3.0 specific changes, so it may until you follow step #2
    2) Switch to your navigator view, open your .myhibernatedata file, and change the version value to “3.0”
    3) No, we don’t offer migration wizards as project-to-project details are too differential to try and migrate for now.

    #232851 Reply

    I don’t see a version value in .myhibernatedata:

    
    #
    #Tue Mar 01 11:30:27 GMT-03:00 2005
    config.password=
    config.name=Hypersonic In-Memory
    config.mappings[0]=br/com/econsulting/excelencia/legislacao/bo/Diplomalegal.hbm.xml
    config.username=sa
    config.dialect=HypersonicSQL
    config.className=org.hsqldb.jdbcDriver
    config.configFilepath=/excelencia_reloaded/conf
    libInstallFolder=/src/webapp/WEB-INF/lib
    addLibs2Project=true
    config.url=jdbc\:hsqldb\:db/excelencia
    config.configFilename=hibernate.cfg.xml
    config.useDriver=true
    configFile=/excelencia_reloaded/conf/hibernate.cfg.xml
    createConfigFile=true
    addLibs2Classpath=true
    config.basePersistenceClass=
    config.keyGenerator=uuid.hex
    config.copyJarFiles=true
    
    #232852 Reply

    Brian Fernandes
    Moderator

    That’s becuase there wasn’t a version property until we started supporting both Hibernate 2 and 3 🙂

    Add this line to the config file and you should be all set.

    
    version=3.0
    

    Best,
    Brian

    #232910 Reply

    Ok, I did that, and the mapping file validation errors are gone.
    But I still have a lot of validation errors in my hibernate.cfg.xml, like:

      Element type “hibernate-configuration” must be declared.
      Element type “session-factory” must be declared.
      The content of element type “property” must match “(meta*,(column|formula)*,type?)”.

    Looks like it’s trying to validate it against the wrong DTD.
    My DOCTYPE declaration is like this:

    <?xml version="1.0" encoding="iso-8859-1"?>
    <!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
        "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

    Am I doing something wrong, or is it a bug? I’m using Eclipse 3.1 final and MyEclipse 4.0M2.

    #232926 Reply

    Riyad Kalla
    Member

    I would encourage you to start a new project, and then use our Hibernate guide here: http://www.myeclipseide.com/ContentExpress-display-ceid-67.html

    and go step by step. I feel like solving each and every strange problem that you are having is just eating up your time *not* getting anything done with Hibernate and I think something flaky is going on with this project as none of this should have been happening in the first place.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: howto Hibernate2 -> Hibernate3 project update

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