-->
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.  [ 9 posts ] 
Author Message
 Post subject: hibernate tool 3.0 alpha 4 & Oracle 10g & DMSYS tabl
PostPosted: Wed Aug 24, 2005 8:57 am 
Newbie

Joined: Wed Aug 24, 2005 8:47 am
Posts: 5
Hi,

I am using hibernate-tool alpha4 ajr reveng tool.
I am getting a funny exception:
[hibernatetool] WARNING: Exception while trying to get indexinfo on CTXSYS.CTX_C
LASSES=ORA-01702: a view is not appropriate here
...
[hibernatetool] WARNING: Exception while trying to get indexinfo on DMSYS.DM$SETTINGS_MAP=ORA-01031: insufficient privileges [hibernatetool] 2005.08.24. 14:41:35 org.hibernate.cfg.reveng.JDBCReader processIndices [hibernatetool] WARNING: Exception while trying to get indexinfo on DMSYS.DM$SETTING_ARRAY=ORA-01031: insufficient privileges [hibernatetool] 2005.08.24. 14:41:35 org.hibernate.cfg.reveng.JDBCReader processPrimaryKey [hibernatetool] WARNING: The JDBC driver didn't report any primary key columns in DM_ALGORITHM_SETTINGS [hibernatetool] 2005.08.24. 14:41:35 org.hibernate.cfg.reveng.JDBCReader processIndices [hibernatetool] WARNING: Exception while trying to get indexinfo on DMSYS.DM_ALGORITHM_SETTINGS=ORA-01702: a view is not appropriate here BUILD FAILED E:\tools\hibernate-tool\build.xml:33: org.hibernate.cfg.JDBCBinderException: org.hibernate.mapping.Column(AO_OBJ_ID) already exists in DMSYS.DM_APPLY_CONTENT_ITEM
It seems that hibernate-tool tries to read some system tables for some funny reason. Is it a desired behaviour? SHould this table be excluded, if yes how? if not what am I missing.
Here is my reveng.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-reverse-engineering SYSTEM "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd" >

<hibernate-reverse-engineering>

<table-filter match-name="BIN$.*" exclude="true" /> <!-- is recycle bin tables in Oracle -->
<table-filter match-name="DM_*" match-schema="DMSYS" exclude="true" /> <!-- is recycle bin tables in Oracle -->
<table-filter match-name="CTX_*" exclude="true" /> <!-- is recycle bin tables in Oracle -->
<table-filter match-name="DR_*" exclude="true" /> <!-- is recycle bin tables in Oracle -->
</hibernate-reverse-engineering>

Also

I am calling hibernate-tool from build.xml in the following way:
target name="generate" >
<hibernatetool destdir="\generate">
<jdbcconfiguration configurationfile="hibernate.cfg.xml" revengfile="hibernate.reveng.xml" /> <!-- database settings are read from hibernate.cfg.xml and/or via propertyfile if provided -->
<hbm2java ejb3="false" /> <!-- generate default .java files with EJB3 annotations -->
</hibernatetool>
</target>

Any help welcomed. Thanx.

Balint

ps: Sorry if it was already answered. I couldn't find similar topic


Hibernate version:

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:

_________________
Balint Halasz


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 24, 2005 10:24 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
you are on the right track - use .* not just *

we should probably include some good default excludes for specific databases....

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 24, 2005 10:39 am 
Newbie

Joined: Wed Aug 24, 2005 8:47 am
Posts: 5
thanks a lot, now I filter out those :) and got hundreds of other :(
may be an "include" would also be useful in the config instead of writing one hunred "exclude" or may I have to restrict somehow the visiblity of system tables...I am not a dba unfortunetly

_________________
Balint Halasz


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 24, 2005 10:50 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
so - what is wrong with doing an exclude at the bottom against match-catalog=.*,match-schema=.*,match-name=.* ? :)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 24, 2005 10:57 am 
Newbie

Joined: Wed Aug 24, 2005 8:47 am
Posts: 5
OK, but in this way I would exclude everything, not including my 5 tables :(,or not can you send me please a sample reverseeng.xml including how I can exclude the unwanted tables and include those which I would like to reverseenginer? Thx
Balint

ps: how can i rate?

_________________
Balint Halasz


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 24, 2005 11:08 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Code:
<table-filter match-name="BIN$.*" exclude="true" />  <!-- BIN$ is always bad -->
<table-filter match-schema="PUT_YOUR_SCHEMANAME_HERE" match-name=".*" exclude="false" />
<table-filter match-catalog=".*" match-schema=".*" match-name=".*" exclude="true" />  <!-- Dont want anything else -->

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 25, 2005 4:27 am 
Newbie

Joined: Wed Aug 24, 2005 8:47 am
Posts: 5
hey, thanx a lot :) I am really getting there (although it still tries to run the generator on DUAL, but i think something wrong either in the DB configuration or user rights), however I now got a new exception

java.lang.NoSuchMethodError: org.hibernate.mapping.Table.createForeignKey(Ljava/
lang/String;Ljava/util/List;Ljava/lang/String;Ljava/util/List;)Lorg/hibernate/ma
pping/ForeignKey;

Is this class should be hibernate3.jar I guess. I have decoded the class and it doesn't contain this method. Do I need another class. It is also not in the hibernate-tool.jar? What else do I need

cglib2.jar
commons-collections.jar
commons-logging.jar
dom4j-1.6.1.jar
ehcache.jar
hibernate-tools.jar
hibernate3.jar
hibernateconsole.jar
jtidy-r8-21122004.jar
l2fprod-common.jar
ojdbc14.jar
velocity-1.4.jar
velocity-tools-generic-1.1.jar

_________________
Balint Halasz


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 25, 2005 4:30 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
use the hibernate3.jar from the plugin - its using a 3.1 version that has some new schema features

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 25, 2005 4:36 am 
Newbie

Joined: Wed Aug 24, 2005 8:47 am
Posts: 5
OK. Now its working!!! :)

_________________
Balint Halasz


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 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.