facebook

Empty POJO / Abstract class created by Hibernate RE.

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

    Database explorer creates class as listed below for DB2 using Type 2 or Type 4 driver. It appears that it does not detect column types correct. Not surprisingly, it works just fine for MySQL. Any idea what might be going on? Table Information tab of Database Explorer shows table structure correct.

    package com.anydb.myuserdb.data.model;

    /**
    * AbstractMyUserdb generated by MyEclipse – Hibernate Tools
    */

    public abstract class AbstractMyUserdb implements java.io.Serializable {

    // Fields

    private MyUserdbId id;

    // Constructors

    /** default constructor */
    public AbstractMyUserdb() {
    }

    // Property accessors

    public MyUserdbId getId() {
    return this.id;
    }

    public void setId(MyUserdbId id) {
    this.id = id;
    }

    }

    #250738 Reply

    If it helps, my hibernate.reveng.xml contains this:

    <?xml version=”1.0″ encoding=”UTF-8″?>
    <!DOCTYPE hibernate-reverse-engineering PUBLIC “-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN” “http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd&#8221; >

    <hibernate-reverse-engineering>
    </hibernate-reverse-engineering>

    If I understand it right, this file should contain the mapping of JDBC data types to hibernate data types. Why is this file blank? Does MyEclipseIDE ships with some default mapping? If not, is there a way, I can obtain these default mappings so my POJO and Abstract classes are generated correct?

    #250790 Reply

    Haris Peco
    Member

    mnamdeo ,

    Please, can you send your ddl (create table) script and i will try reproduce your case
    it is always good that you send you eclipse, myeclipse, os ana database versions

    <hibernate-reverse-engineering>
    </hibernate-reverse-engineering>

    If I understand it right, this file should contain the mapping of JDBC data types to hibernate data types. Why is this file blank? Does MyEclipseIDE ships with some default mapping? If not, is there a way, I can obtain these default mappings so my POJO and Abstract classes are generated correct?

    You populate this file when you choose tables, jdbc – to – hibernate type mapping and other infos from wizard
    pages
    You have jdbc to hibernate mapping on page 2 of ‘Create Hibernate mapping’ wizard

    Thanks

    #250801 Reply

    I figured it out. Table has a “varchar (12)” as primary key. ME generated an ID class representing data structure of the table (and I was expecting it in the Abstract class).

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Empty POJO / Abstract class created by Hibernate RE.

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