-->
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.  [ 2 posts ] 
Author Message
 Post subject: How to separate column size data from my code with Hibernate
PostPosted: Tue Apr 27, 2004 2:00 am 
Newbie

Joined: Sun Oct 12, 2003 6:33 pm
Posts: 7
Hi all,

I am designing an application using MaxDB and Hibernate.
Persistence has never been my strength so I am struggling to make a decent and maintainable system design.

My question might be rather simple to some of you. My schema has a table with several String columns, each with size 255. In my application, I must ensure objects are not created having the matching property with length greater than this max size. For example, for setter name of class Person, an IllegalArgumentException is throw is the give name has over 255 chars.

In a scenario with many tables, each having their own size constraints, I foresee a maintainance nightmare to keep the java code synchronized with the database schema, should I decide to alter the columns size.

I tried using Text columns but MaxDB has limitations on such type in the sense that I cannot query their values.

Could someone provide me some hint on what would be a better approach, and if Hibernate could somehow help me keeping this concern isolated from my application code?

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 27, 2004 4:37 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Maybe you can read mibernate metadata at runtime to find the actual column size.

_________________
Emmanuel


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