-->
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.  [ 10 posts ] 
Author Message
 Post subject: Column mapping ignored if colum is not presented in a table
PostPosted: Mon Jan 16, 2006 5:07 pm 
Newbie

Joined: Tue Nov 15, 2005 12:25 pm
Posts: 15
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

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:

I am trying to use reverse engineering to generate mapping and java code for "virtual" column, column which actually not in a schema.
But tool ignores mapping for this kind of columns.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 16, 2006 5:41 pm 
Hibernate Team
Hibernate Team

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

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Reverse engineering
PostPosted: Mon Jan 16, 2006 6:34 pm 
Newbie

Joined: Tue Nov 15, 2005 12:25 pm
Posts: 15
Max.

We need to generate Hibernate mappings from 3rd party xml file and then generate database schema from those files.
Can we use reverse engineering for this ?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 16, 2006 6:40 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
there are no direct support for reverse engineering "xml files" since its pretty impossible to deduce the "row" structure.

if you do know how to deduce it then look into implementing a custom MetaDataDialect and a custom ReverseEngineeringStrategy.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Where to specify MetaDataDialect class
PostPosted: Wed Jan 18, 2006 7:11 pm 
Newbie

Joined: Tue Nov 15, 2005 12:25 pm
Posts: 15
Max.

Thanks for reply. If I write custom MetaDataDialect class where in configuration it should be specified ?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 18, 2006 7:41 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
at the moment you need to set the property hibernatetool.metadatadialect to the class name

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: MetaDataDialect
PostPosted: Thu Jan 19, 2006 4:35 pm 
Newbie

Joined: Tue Nov 15, 2005 12:25 pm
Posts: 15
Max.

I am sorry. But in what file property hibernatetool.metadatadialect should be specified ?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 19, 2006 4:41 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
in any place where it will put into the Configuration properties.

That is:
System.properties
hibernate.cfg.xml
hibernate.properties
<property> tags in the HibernateTool's (i'm not totally sure that the last one here will work, but it should ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Access to configuration
PostPosted: Fri Feb 10, 2006 12:32 pm 
Newbie

Joined: Tue Nov 15, 2005 12:25 pm
Posts: 15
Dear Max.

We implemented our custom MetaDataDialect class where we read
meta data from external xml file and it works just fine.
Thank you very much for flexibility of your design which gives ability
to be independent from database schema metadata.
Just one issue left. We had to hardcode file name of our xml file.
Is it a way to get access to Configuration object from metadata dialect class.
This way we could put file name in configuration file.
Or may be you can advice on better way to do this ?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 10, 2006 1:22 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
nice to see the flexibility being used ;)

currently i am not much for handing in a Configuration object to the MetaDataDialect since it is actually used to build another Configuration.

But we already pass some objects into the configure method and we could probably generalize that so you get a "ReverseEngineringConfiguration" kinda interface which would have getProperty() that we could delegate to the configuration from where the MetaDataDialect were created.

Put it in jira and i'll look at it.

_________________
Max
Don't forget to rate


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