-->
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.  [ 18 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Generate comments from oracle database using Hibernate tools
PostPosted: Thu Feb 22, 2007 12:31 am 
Newbie

Joined: Wed Feb 21, 2007 3:09 am
Posts: 16
Hi all,

While doing reverese engineering using hibernate tools, i am unable to retrieve database(oracle) table/column comments into my POJOs.

Any help is greatly apreciated.

Regds,
Ramesh K.[/url][/list]


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 22, 2007 3:00 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
which version of the tooling ?


b8, remember to enable comment fetching on the jdbc url (can't remember it, but its oracle specific)

b9 has a oracle tuned metadata dialect that should fetch the comments (and also more efficiently than the built in support in oracle drivers)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 22, 2007 5:29 am 
Newbie

Joined: Wed Feb 21, 2007 3:09 am
Posts: 16
I am using b9a version.
I am setting metadata dialect as follows:
<property name ="hibernatetool.metadatadialect">org.hibernate.cfg.rveng.dialect.JDBCMetaDataDialect</property>

I added above line in hibernate.cfg.xml file.

But still i am unable to retrieve comments from oracle database.

Is this the right way.

Regds,
Ramesh K.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 22, 2007 6:23 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
by putting that line you explicitly disable the oracle optimized metadatadialect. remove the line (or list the oracle specific metadatadialect)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 22, 2007 7:15 am 
Newbie

Joined: Wed Feb 21, 2007 3:09 am
Posts: 16
Thanks for quick response.

<property name
="hibernatetool.metadatadialect">org.hibernate.cfg.rveng.dialect.OracleMetaDataDialect</property>

I tried with the above option also. But not generating comments.

If possible, do corrections in the following .cfg.xml file code snippet.

<property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect
</property>-->
<property name="hibernatetool.metadatadialect">org.hibernate.cfg.reveng.dialect.OracleMetaDataDialect</property>
<property name="hibernate.connection.remarksReporting">true</property>


Regs,
Ramesh k.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 22, 2007 7:17 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hmm should work. did you try and enable the comment support in the driver ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 22, 2007 7:29 am 
Newbie

Joined: Wed Feb 21, 2007 3:09 am
Posts: 16
HI..

How to enable the comment support in the driver. where to do this.
If you guide me how to do this, it is greatly appreciated.

Thanks,
Ramesh K.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 22, 2007 7:31 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
didn't notice the remarksupport property.

try and set it and use the JDBCMetaDataDialect.

btw. how are you testing wether it works or not ?

it will only show up in hbm2doc and hbm2hbmxml in the table and column comment parts.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 22, 2007 7:39 am 
Newbie

Joined: Wed Feb 21, 2007 3:09 am
Posts: 16
POJOs and Hibernate mapping files are generated without comments.
If everything is fine, hibernatetool will add javadoc comments in both mapping files and POJOs, but this is not the case.

I tried with JDBCMetaDataDialect also.

Regds,
Ramesh K.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 22, 2007 7:41 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
I can only say that when I run it here the comments end up in table and column comment attributes. It does not show up in pojo's by default.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 22, 2007 7:51 am 
Newbie

Joined: Wed Feb 21, 2007 3:09 am
Posts: 16
Some Improvement..
Comments are added in .hbm.xml file

<property name="dateTime" type="date">
<column name="DATE_TIME" length="7" not-null="true">
<comment>Date &amp; Time of insertion or modification</comment>
</column>
</property>

Like above, for every column comments are added. But they are not reflected in POJOs.


Thanks for your quick replies.

Regds
Ramesh K.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 22, 2007 7:56 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
ok - so that is expected. what setup generated that ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 22, 2007 7:58 am 
Newbie

Joined: Wed Feb 21, 2007 3:09 am
Posts: 16
Hi
<property name="businessType" type="string">
<meta attribute="field-description" inherit="false">Business Type. eg: R&amp;D, Diagnostic.</meta>
<column name="BUSINESS_TYPE" length="25" />
</property>

Somehow above tag should be generated in hbm.xml file rather than

<property name="dateTime" type="date">
<column name="DATE_TIME" length="7" not-null="true">
<comment>Date &amp; Time of insertion or modification</comment>
</column>
</property>



Thanks
Ramesh K.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 22, 2007 8:03 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
no not by default - because the comment is actually for the column not the field.

Anyhow - you can make that happen if you want to by changing the templates.

btw. my question still stand...what configuration did you end up using to get the comments?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 22, 2007 8:14 am 
Newbie

Joined: Wed Feb 21, 2007 3:09 am
Posts: 16
Hi

The following combination is working.

<property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="hibernate.connection.remarksReporting">true</property>

Or

<property name="hibernatetool.metadatadialect">org.hibernate.cfg.reveng.dialect.OracleMetaDataDialect</property>

or

<property name="hibernatetool.metadatadialect">org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect</property>


For JDBCMetaDataDialect and OracleMetaDataDialet, we need to to set "remarksReportingProperty" to true.

How to change the templates, where to do this? Any clue.

Thanks for replies.

Regds,
Ramesh K.
[/b]


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 18 posts ]  Go to page 1, 2  Next

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.