-->
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.  [ 5 posts ] 
Author Message
 Post subject: can we use two database in single query
PostPosted: Wed Mar 12, 2008 1:28 am 
Newbie

Joined: Wed Mar 12, 2008 1:09 am
Posts: 4
Hi,

I am new in Hibernate. I am using mysql verrsion 5. I wrote one query to fetech records from two tables. Tables are in different databases.

Is it possible in Hibernate

Thanks


Top
 Profile  
 
 Post subject: What about Hibernate Shards?
PostPosted: Wed Mar 12, 2008 4:39 am 
Newbie

Joined: Tue Mar 11, 2008 6:41 pm
Posts: 8
Location: France
Did you take a look at Hibernate Shards?

Summary:
You can't always put all your relational data in a single relational database. Sometimes you simply have too much data. Sometimes you have a distributed deployment architecture. Sometimes the lawyers say "no" (or more likely, "NOOO!"). Whatever your reasons, talking to multiple relational databases inevitably complicates the development of your application. Hibernate Shards is a framework that is designed to encapsulate and minimize this complexity by adding support for horizontal partitioning to Hibernate Core.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 12, 2008 5:25 am 
Regular
Regular

Joined: Thu Oct 13, 2005 4:19 am
Posts: 98
Shards is usefull if you 're looking for horizontal partitioning (for example a Person record is in a different database dependend on where he lives).
That doesn't sound like your use case.

As far as I know, an entitymanager is for only 1 datasource (so 1 database), so you can't do that directly.
You can use different entitymanagers, but you 'll have to name your entitymanger's persistence unit with @PersitentContext(persistentUnitName = ...) but you still won't be able to run a single query over 2 entitymanagers.

_________________
http://www.ohloh.net/accounts/ge0ffrey


Top
 Profile  
 
 Post subject: can i use MySQL INET_NTOA() function in Hibernate
PostPosted: Wed Mar 12, 2008 7:48 am 
Newbie

Joined: Wed Mar 12, 2008 1:09 am
Posts: 4
Hi Friends,

Thanks for your valuable advice.

I need another clarification.

can I use MySQL INET_NTOA() function in Hibernate

Thanks


Last edited by Muralidharan on Wed Mar 12, 2008 7:55 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: can i use MySQL INET_NTOA() function in Hibernate
PostPosted: Wed Mar 12, 2008 7:50 am 
Newbie

Joined: Wed Mar 12, 2008 1:09 am
Posts: 4
Hi Friends,

any one give me the details about registerFunction()

Thanks


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