facebook

Hibernate Annontations reverse engineering

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

    gerbdla
    Member

    I reversed engineered a mysql table with annontations but it is not working with the session factory created when I created the the project. Can anyone recommend what changes I need to make to make the annontations sessionfactory work?

    #288983 Reply

    Loyal Water
    Member

    You said “Its not working with the session factory”. Are you getting some error or is the wizard not moving forward ? What exactly is happening.

    Can you go to MyEclipse > Installation Summary > Installation Details and paste the information here for me.

    #288997 Reply

    gerbdla
    Member

    Here is my istallation summary
    *** Date:
    Thursday, September 11, 2008 8:42:38 PM PDT

    ** System properties:
    OS=WindowsVista
    OS version=6.0
    Java version=1.5.0_11

    *** MyEclipse details:
    MyEclipse Enterprise Workbench
    Version: 6.5.1 GA
    Build id: 6.5.1-GA-20080715

    *** Eclipse details:
    MyEclipse Enterprise Workbench

    Version: 6.5.1 GA
    Build id: 6.5.1-GA-20080715

    Eclipse Platform

    Version: 3.3.3.r33x_r20080129-_19UEl7Ezk_gXF1kouft
    Build id: M20080221-1800

    Eclipse RCP

    Version: 3.3.3.r33x_r20080129-8y8eE9UEUWI6qujeED0xT7bc
    Build id: M20080221-1800

    Eclipse Java Development Tools

    Version: 3.3.2.r33x_r20080129-7o7jE7_EDhYDiyVEnjb1pFd7ZGD7
    Build id: M20080221-1800

    Eclipse Plug-in Development Environment

    Version: 3.3.3.r33x_r20080129-7N7M5DQVIA_6oJsEFkEL
    Build id: M20080221-1800

    Eclipse Project SDK

    Version: 3.3.3.r33x_r20080129-7M7J7LB-u3aphGW6o3_VmiVfGXWO
    Build id: M20080221-1800

    Eclipse Graphical Editing Framework

    Version: 3.3.2.v20080129
    Build id: 20080221-1602

    Eclipse startup command=-data
    C:\MyEclipseWorkspaces
    -os
    win32
    -ws
    win32
    -arch
    x86
    -showsplash
    -launcher
    C:\MyEclipse 6.0\eclipse\eclipse.exe
    -name
    Eclipse
    –launcher.library
    C:\MyEclipse 6.0\eclipse\plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.3.R33x_v20080118\eclipse_1023.dll
    -startup
    C:\MyEclipse 6.0\eclipse\plugins\org.eclipse.equinox.launcher_1.0.1.R33x_v20080118.jar
    -exitdata
    1644_64
    -vm
    C:\MyEclipse 6.0\jre\bin\javaw.exe

    I tried to run this simple script and I got an error
    EventsDAO events = new EventsDAO();
    List test = events.findAll();
    Iterator pairs = test.iterator();
    while ( pairs.hasNext()){
    Object[] pair = (Object[]) pairs.next();
    Events event = (Events) pair[0];

    This is the error I received
    log4j:WARN No appenders could be found for logger (com.gerberdata.hibernate.EventsDAO).
    log4j:WARN Please initialize the log4j system properly.
    Exception in thread “main” java.lang.ClassCastException: com.gerberdata.hibernate.Events
    at com.gerberdata.hibernate.testhibernate.main(testhibernate.java:19)

    }

    #289032 Reply

    Brian Fernandes
    Moderator

    The “pears” iterator will return a list of Events; pairs.next() will return an Events object but you are casting it to Object[], hence the ClassCastException.

    Hope this helps.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Hibernate Annontations reverse engineering

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