-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 12 posts ] 
Author Message
 Post subject: Could not revenge tables with underscore
PostPosted: Thu Jan 04, 2007 6:10 am 
Newbie

Joined: Thu Jan 04, 2007 6:03 am
Posts: 6
Location: Italy
Hi,
I'm working with hibernate tools to reveng Postgres Tables to create hbm mappings and java classes.

My DB has about 20 tables, some tables has an "_" in the name like: "applicazione_has_domanda"

I noticed that hibernate tools strips "_" from the name of the table to become "applicazioneHasDomanda"

When I reveng the whole db hibernet tools does not reveng tables with "_" inside but when I ask to reveng only tables with "_" hbm files are generated correctly.

Is this a known bug or did I forget something?

Thanks,
fabio


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 04, 2007 6:21 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
I don't understand your question/problem.

What do you mean by "correctly" as opposed to the whatever you see it actually do ?

And we don't remove anything from tablenames; we do a class name generation *based* on the tablename and that will by default camelcase it (which involves removing '_' and capitalize the next word)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: That's an example
PostPosted: Thu Jan 04, 2007 6:49 am 
Newbie

Joined: Thu Jan 04, 2007 6:03 am
Posts: 6
Location: Italy
This is my simple revenge.xml for my postgres db:

<table-filter match-name="messaggio" match-schema="public" />
<table-filter match-name="utente" match-schema="public" />
<table-filter match-name="progetto" match-schema="public" />
<table-filter match-name="utente_has_modulotto" match-schema="public" />-->
<table-filter match-name="files" match-schema="public" />-->
<table-filter match-name="applicazione" match-schema="public" />
<table-filter match-name="applicazione_has_files" match-schema="public" />
<table-filter match-name="certificazione" match-schema="public" />
<table-filter match-name="destinazione" match-schema="public" />
<table-filter match-name="domanda" match-schema="public" />
<table-filter match-name="domandaprogetto" match-schema="public" />
<table-filter match-name="fileappoggio_has_domanda" match-schema="public" />
<table-filter match-name="item" match-schema="public" />
<table-filter match-name="lingua" match-schema="public" />
<table-filter match-name="lotto" match-schema="public" />
<table-filter match-name="modulo" match-schema="public" />
<table-filter match-name="moduloprogetto" match-schema="public" />
<table-filter match-name="moduloprogetto_has_fileappoggio" match-schema="public" />
<table-filter match-name="modulotto" match-schema="public" />
<table-filter match-name="passaggiodistato" match-schema="public" />
<table-filter match-name="passaggiodistato_has_ruolo" match-schema="public" />
<table-filter match-name="projectmanager" match-schema="public" />
<table-filter match-name="ruolo" match-schema="public" />
<table-filter match-name="ruolocontrollato" match-schema="public" />
<table-filter match-name="software" match-schema="public" />
<table-filter match-name="software_has_modulo" match-schema="public" />
<table-filter match-name="softwaresuite" match-schema="public" />
<table-filter match-name="stato" match-schema="public" />
<table-filter match-name="syllabus" match-schema="public" />
<table-filter match-name="templatemcq" match-schema="public" />
<table-filter match-name="tipoattivita" match-schema="public" />
<table-filter match-name="tipoutente" match-schema="public" />
<table-filter match-name="transizione" match-schema="public" />
<table-filter match-name="utilizzo" match-schema="public" />
<table-filter match-name="domanda_stato" match-schema="public" />
<table-filter match-name="domanda_syllabus" match-schema="public" />
<table-filter match-name="moduloprogetto_item" match-schema="public" />
<table-filter match-name="progetto_domanda" match-schema="public" />

When I run it hibernate tools skips all tables with "_" in the name, and it does not generate hbm files for them. For example it does not generate hbm for "software_has_modulo", but it correctly generates hbm for Utilizzo.hbm.

To generate hbm for tables which name contains "_" I have to remove from reveng.xml all other tables.

I hope I explained my problem better.

Thanks,
fabio


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 04, 2007 6:56 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
you snippet contains partial/non-valid comment tags.

Please show *correct* reveng.xml that gives you _ tables and a correct one that does not give it to you. (casing is important)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: reveng could not reverse some tables
PostPosted: Fri Jan 05, 2007 10:55 am 
Newbie

Joined: Thu Jan 04, 2007 6:03 am
Posts: 6
Location: Italy
this is my standard reveng.xml:

<table-filter match-name="messaggio" match-schema="public" />
<table-filter match-name="utente" match-schema="public" />
<table-filter match-name="progetto" match-schema="public" />
<table-filter match-name="utente_has_modulotto" match-schema="public" />
<table-filter match-name="files" match-schema="public" />
<table-filter match-name="applicazione" match-schema="public" />
<table-filter match-name="applicazione_has_files" match-schema="public" />
<table-filter match-name="certificazione" match-schema="public" />
<table-filter match-name="destinazione" match-schema="public" />
<table-filter match-name="domanda" match-schema="public" />
<table-filter match-name="domandaprogetto" match-schema="public" />
<table-filter match-name="fileappoggio_has_domanda" match-schema="public" />
<table-filter match-name="item" match-schema="public" />
<table-filter match-name="lingua" match-schema="public" />
<table-filter match-name="lotto" match-schema="public" />
<table-filter match-name="modulo" match-schema="public" />
<table-filter match-name="moduloprogetto" match-schema="public" />
<table-filter match-name="moduloprogetto_has_fileappoggio" match-schema="public" />
<table-filter match-name="modulotto" match-schema="public" />
<table-filter match-name="passaggiodistato" match-schema="public" />
<table-filter match-name="passaggiodistato_has_ruolo" match-schema="public" />
<table-filter match-name="projectmanager" match-schema="public" />
<table-filter match-name="ruolo" match-schema="public" />
<table-filter match-name="ruolocontrollato" match-schema="public" />
<table-filter match-name="software" match-schema="public" />
<table-filter match-name="software_has_modulo" match-schema="public" />
<table-filter match-name="softwaresuite" match-schema="public" />
<table-filter match-name="stato" match-schema="public" />
<table-filter match-name="syllabus" match-schema="public" />
<table-filter match-name="templatemcq" match-schema="public" />
<table-filter match-name="tipoattivita" match-schema="public" />
<table-filter match-name="tipoutente" match-schema="public" />
<table-filter match-name="transizione" match-schema="public" />
<table-filter match-name="utilizzo" match-schema="public" />
<table-filter match-name="domanda_stato" match-schema="public" />
<table-filter match-name="domanda_syllabus" match-schema="public" />
<table-filter match-name="moduloprogetto_item" match-schema="public" />
<table-filter match-name="progetto_domanda" match-schema="public" />

With this files hibernate tools does not create hbm for:
applicazione_has_files
utente_has_modulotto
fileappoggio_has_domanda
moduloprogetto_has_fileappoggio
software_has_modulo
passaggiodistato_has_ruolo

but it works with:
moduloprogetto_item
domanda_stato
domanda_syllabus

if for example I remove from previous reveng.xml list the line:
<table-filter match-name="files" match-schema="public" />

hibernate tools creates hbm for:
fileappoggio_has_domanda
moduloprogetto_has_fileappoggio

if I use <table-filter> with wildcards hbm for
moduloprogetto_has_fileappoggio and others are not created

I cant understand the reason... do you know a reason why there could be this problem? Do you need a backup of my postgres db?

Thank you,
fabio


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 05, 2007 12:31 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
it looks weird i must say....if you can give a copy of the schema then it would help.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: database
PostPosted: Fri Jan 05, 2007 1:51 pm 
Newbie

Joined: Thu Jan 04, 2007 6:03 am
Posts: 6
Location: Italy
how can i send you a copy of the db?
thanks,
fabio


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 06, 2007 5:16 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
doesn't postgressql have some schema structure dumper which generates a file i can import ? you can send the file to the email adress available on the left side under my name (via the email icon)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 08, 2007 11:34 am 
Newbie

Joined: Thu Jan 04, 2007 6:03 am
Posts: 6
Location: Italy
uhm... maybe I'm asking a stupid thing...
Under your name I cant find your email...

thanks,
fabio


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 08, 2007 2:08 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
ah emails ain't visible for all ( of course ;)

send to max at hibernate.org

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 15, 2007 3:10 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Hi,

I got your schema and there is very simply explanation for those tables not being generated as entities.

They are detected as many-to-many tables and thus mapped as such.

You can disable that in eclipse ui if you do not want that; for ant you can look in the docs to see the attribute to set to control it.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 25, 2007 6:59 pm 
Newbie

Joined: Thu Jan 04, 2007 6:03 am
Posts: 6
Location: Italy
max wrote:
Hi,

I got your schema and there is very simply explanation for those tables not being generated as entities.

They are detected as many-to-many tables and thus mapped as such.

You can disable that in eclipse ui if you do not want that; for ant you can look in the docs to see the attribute to set to control it.



Thank you very much!

fabio


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 12 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.