-->
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: Default Values
PostPosted: Mon Jan 30, 2006 3:40 pm 
Newbie

Joined: Tue Nov 15, 2005 12:25 pm
Posts: 15
Hibernate tool with reverse engineering option ignores default column values.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 30, 2006 4:08 pm 
Hibernate Team
Hibernate Team

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

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Default columns values
PostPosted: Wed Feb 01, 2006 12:22 pm 
Newbie

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

I am trying to reverse engineer Sybase database where table columns have default values. But tools ignores them.

In sql script created by tool I don't see anyattempts to create defaults.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 01, 2006 2:06 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
put a request in jira, but not sure if it actually should look for defaults. what is the usecase ? specifying them only make sense if you run with dynamic-insert

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 01, 2006 8:16 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
I am not sure the fact that db defaults do not play a role unless the domain object is mapped as dynamic-insert is well known. I was thinking though it would be interesting to use them as a value used as the default values in the POJO fields. This way it applies for the 95% of use cases.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 01, 2006 8:24 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
well, using the default-value in the pojo fields is risky. we would need to d o a lot of typeconversion checks to make it not-fail.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 02, 2006 9:48 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
It its a part of the databases meta data then we know it can be reasonably converted the to correct type. The rules are finite as they are the same as the database and we already know how the convert a DB type to a java type. I am not sure its all that hard - maybe it is... I will think about a little more.
Its quite likely it just not worth the effort.


Top
 Profile  
 
 Post subject: Defaults
PostPosted: Mon Feb 27, 2006 1:20 pm 
Newbie

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

Any plans to implement reverse engineering of default values?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 27, 2006 2:02 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
none currently since i'm not sure it is really worth it. You do know the default value is *only* used for schema generation currently, thus not really usefull when you are reverse engineering from an existing schema.

Contribution welcome that makes it optionally to do (both when doing the actual reverse engineering and code generation)

_________________
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.  [ 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.