-->
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.  [ 8 posts ] 
Author Message
 Post subject: Mapping...doubt
PostPosted: Thu Aug 18, 2005 7:16 am 
Newbie

Joined: Thu Mar 10, 2005 10:41 am
Posts: 7
Hello all,

Is it possible to map multiple tables using one class.
All the tables are having identical structure.(same columns and keys)
Only one will be present while starting the program for first time.
Others are need to be added runtime.

If possible,plz let me know how???

Thanks & Regards
Jijo Vincent


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 18, 2005 8:04 am 
Regular
Regular

Joined: Thu Apr 14, 2005 2:15 pm
Posts: 66
Yes, you can create several mapping files.
Then, you can create session factories mencioning the other mapping files.
Ex:
SessionFactory sessions = new Configuration()
.configure("/hibernate-config/configuration1.cfg.xml")
.buildSessionFactory();

--
If this works, rate me!


Top
 Profile  
 
 Post subject: If see a similar message in this forum
PostPosted: Thu Aug 18, 2005 8:05 am 
Beginner
Beginner

Joined: Fri May 13, 2005 9:39 am
Posts: 21
Hi,
I ve see another message in the forum talking about aliases.

take a look to Working with "entity-name"

regards.


Top
 Profile  
 
 Post subject: Re: If see a similar message in this forum
PostPosted: Thu Aug 18, 2005 8:09 am 
Beginner
Beginner

Joined: Fri May 13, 2005 9:39 am
Posts: 21
XOrangoutan wrote:
Hi,
I ve see another message in the forum talking about aliases.

take a look to Working with "entity-name"

regards.


Why do you have to create tables dynamically in fact? Is it really necessary?


Top
 Profile  
 
 Post subject: Re: If see a similar message in this forum
PostPosted: Thu Aug 18, 2005 11:46 pm 
Newbie

Joined: Thu Mar 10, 2005 10:41 am
Posts: 7
Thank you for the reply.

It is a real-time application.
500 records(even more) may be entered into the table in every minute.
It will be difficult to retrieve data from the table when it is too large(say 10 million records).
So i am trying to create the table at the start of every month.

if u have any other idea plz let me know that.

Thanks & regards
Jijo Vincent






XOrangoutan wrote:
XOrangoutan wrote:
Hi,
I ve see another message in the forum talking about aliases.

take a look to Working with "entity-name"

regards.


Why do you have to create tables dynamically in fact? Is it really necessary?

_________________
Jijo Vincent


Top
 Profile  
 
 Post subject: Reporting tables?
PostPosted: Fri Aug 19, 2005 3:05 am 
Beginner
Beginner

Joined: Fri May 13, 2005 9:39 am
Posts: 21
Hi,
So you use one table in which your real time results are stored and another tables in which you archive results month per month.
We have quite the same problem with statistics of use of our Knowledge mgt tool. Each year we copy (manually) data stored in the table STATS in STATS_YEARN.

I advise you not to mix actual data treatment with archived data.
Create a mapping to you actual data table, build a view in your database (that you can create dynamically, depending on the willing data (for example, if user want to see evolution from march05 to june05 or that follows the evolution of archive) and create a specific mapping of this view. The structure (columns) and the name of the dynamic view have to be immutable.


Test this proposition to see performances, try as more as possible to optimize you query (index, ...), maybe it would be easier than to map a lot of tables to 1 object.

Regards.


Top
 Profile  
 
 Post subject: Re: Reporting tables?
PostPosted: Fri Aug 19, 2005 4:16 am 
Newbie

Joined: Thu Mar 10, 2005 10:41 am
Posts: 7
Thanks..

I think i am irritating u a bit...i don't mind.

is it possible to create view,index etc using hibernate for all databases it support..?

my application is not limited to a particular database(type).

Rgrds
Jijo Vincent





XOrangoutan wrote:
Hi,
So you use one table in which your real time results are stored and another tables in which you archive results month per month.
We have quite the same problem with statistics of use of our Knowledge mgt tool. Each year we copy (manually) data stored in the table STATS in STATS_YEARN.

I advise you not to mix actual data treatment with archived data.
Create a mapping to you actual data table, build a view in your database (that you can create dynamically, depending on the willing data (for example, if user want to see evolution from march05 to june05 or that follows the evolution of archive) and create a specific mapping of this view. The structure (columns) and the name of the dynamic view have to be immutable.


Test this proposition to see performances, try as more as possible to optimize you query (index, ...), maybe it would be easier than to map a lot of tables to 1 object.

Regards.

_________________
Jijo Vincent


Top
 Profile  
 
 Post subject: Re: Reporting tables?
PostPosted: Fri Aug 19, 2005 4:27 am 
Beginner
Beginner

Joined: Fri May 13, 2005 9:39 am
Posts: 21
No you don't irritating me, I've made the choice to post an answer.

I don't know if it is possible to create a view thru Hibernate.
I think HQL is only a LMD (french abbr for Data Manipulation Language)
but by using SQL standards for Data Definition (CREATE, ALTER, etc...)
no matter the type of the database (except for MSACCESS ;-)}).
You use the connection given by your hibernate session and you work with the good old JDBC Connection to launch your queries of Data Def.

To be Tested

meet_jijo wrote:
Thanks..

I think i am irritating u a bit...i don't mind.

is it possible to create view,index etc using hibernate for all databases it support..?

my application is not limited to a particular database(type).

Rgrds
Jijo Vincent


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