- This topic has 3 replies, 2 voices, and was last updated 19 years ago by
Manish Namdeo.
-
AuthorPosts
-
Manish NamdeoMemberDatabase 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;
}}
Manish NamdeoMemberIf 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” ><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?
Haris PecoMembermnamdeo ,
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’ wizardThanks
Manish NamdeoMemberI 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).
-
AuthorPosts