views:

383

answers:

1

Im just getting my head around java and eclipse. Im trying to use the hibernate plugin to generate my java classes.

Yesterday I created a table in mysql and managed to (after a lot of messing around) get it to generate the code for this table.

Today I have added some tables to the database and tried to generate code for them.

Now I can see these tables in the table filters tab, but I can only see the Primary index fields. I can see all the fields in the table I created yesterday.

When I generate the code, I only get the class for yesterdays tables.

I just dont understand whats going on ..

Heres my hibernate.reveng.xml.

 <?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>
 <table-filter match-name=".*"></table-filter>

</hibernate-reverse-engineering>

Heres my hibernate.cfg.xml.

    <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"&gt;
<hibernate-configuration>
    <session-factory>
  <property name="hibernate.session_factory_name">SessionFactory</property>
        <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
        <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/af</property>
        <property name="hibernate.connection.username">root</property>
        <property name="hibernate.default_catalog">af</property>
        <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
        <property name="show_sql">true</property>
        <property name="hibernate.connection.pool_size">50</property>
        <property name="current_session_context_class">thread</property>
    </session-factory>
</hibernate-configuration>

These tables have identical structures in mySql.

Im just really confused now. How do I get all my tables to be generated?

A: 

Ok, I have worked it out.

It seems Hibernate tools do not like tablenames to contain an uppercase letter in them.

If I rename all my tables to be lower case, it all works fine!

Mongus Pong
This did not work for me
Juan Manuel
Are you getting the same symptoms?
Mongus Pong