-->
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: Mapping table with great number of columns
PostPosted: Wed Mar 08, 2006 12:43 pm 
Newbie

Joined: Wed Mar 08, 2006 11:29 am
Posts: 2
Hi!

Our corporate database contains tables with great number of columns, in many cases more than 255. As far as i know, the full constructor of the java class that is used for mapping a table in Hibernate should accept as many parameters as the number of the table columns (at least at the simplest case, with no composite keys etc.). In our case, writing a class constructor with more than 255 parameters would yield a compilation error, due to the restrictions in java about maximum number of parameters in a method.

On the other hand, if i want to use the session.load or session.get methods for retrieving a whole row from these tables, i must define the full constructor of the mapping class.(Please correct me if i am wrong.)

Is there any way to bypass these restrictions? I have thought of using report queries, but it doesn't seem as a good idea to add all the mapping class fields in the select statement.

Thanks in advance.


Top
 Profile  
 
 Post subject: hmm
PostPosted: Wed Mar 08, 2006 1:23 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
There is no need for such constructor unless you want to create objects in the HQL queries as
select new MyObject( ... ) from ...

H is happy with no-argument constructors and sets properties via setters or directly if field access is specified.

session get() and load do work.

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


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.