views:

147

answers:

1

I have a database containing approx. 200 tables. I use jboss-ide to automatically generate hibernate classes from the database using the File->New->Other->Hibernate->Hibernate Mapping file wizard of jboss-ide 1.6.

the problem i'm facing is that the .hbm.xml file generated does not contain all the propertiese it's supposed to. what's also surprising is that other hibernate files generated contain all the properties they're supposed to.

as an example, here is the layout of a table :


create table NOYPS_CANAL ( CODE_CANAL VARCHAR2(25) not null, LBL_CANAL VARCHAR2(100), AUTRE_COMPAGNIE VARCHAR2(1), CODE_UTI VARCHAR2(25), DTE_UTI DATE, DTE_UTI_MODIF DATE, CODE_UTI_MODIF VARCHAR2(25), constraint PK_NOYPS_CANAL primary key (CODE_CANAL) );

and here is the .hbm.xml file generated :


<class
 name="NoypsCanal"
 table="NOYPS_CANAL"
            >
 <meta attribute="sync-DAO">false</meta>

 <meta attribute="sync-DAO">false</meta>

</class>


as you can see, not all the columns present in the table are represented as properties inside the .hbm.xml file.

+1  A: 

JBoss IDE 1.6 is about 2.5 years old - may I suggest you upgrade to something more recent ?

btw. The Hibernate Mapping file wizard have never claimed to be able to generate properties, it just creates the skeleton file.

In the latest dev releases of JBoss Tools 3.1.x we do though add support for this.

btw. the sync-DAO is not something we ever added, so not sure where you are getting that from ?

Max Rydahl Andersen
hi Max,but it does work for other tables, it can generate all properties for all their columns.
Attilah
So may I still suggest you upgrade to something more recent ? i.e. both hibernate tools, the database or the jdbc driver can be the culprit here.
Max Rydahl Andersen