-->
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: Referental Integrity
PostPosted: Sat Jan 10, 2004 5:53 pm 
Newbie

Joined: Sat Jan 10, 2004 5:45 pm
Posts: 12
Location: Hong Kong
Hello.

I'd like to ask is it possible to make Hibernate work without referential integrity?

For the case we face there's a running DBMS and it's the one without referential integrity defined. We have no right to change it.

For some version of DBMS such as MySQL there's no referential integrity. We want the mapping do be done without that.

How can we deal with those case?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 10, 2004 5:55 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Well, where is the Problem? If there are no foreign key constraints, hibernate won't violate any. I don't undestand your problem.


Top
 Profile  
 
 Post subject: Re: Referental Integrity
PostPosted: Mon Jan 12, 2004 6:54 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
wsr wrote:
I'd like to ask is it possible to make Hibernate work without referential integrity?

Yes

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 16, 2004 5:52 am 
Newbie

Joined: Sat Jan 10, 2004 5:45 pm
Posts: 12
Location: Hong Kong
The problem is sometimes hibernate will generate the Integrity Constraints SQL Statements in the DDL. Then there will be some problem for those databases which don't support such constraints. e.g. some older version of MySQL.

Is there anyway of making the Integrity Constraints DLL generation an option step?

e.g. imagine the schemaexport can accept a parameter that omit the integrity constraints DDL generation, then it will generate only the create table statements. And the actual integrity is managed by the Hibernate API as specified in the mapping xml file.

Is it possible doing something like that? Or any other alternatives?

Thx.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 16, 2004 5:56 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Hum, I don't know about the SchemaExport, but for sure Hibernate core don't need referencial integrity

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 16, 2004 5:58 am 
Newbie

Joined: Sat Jan 10, 2004 5:45 pm
Posts: 12
Location: Hong Kong
wsr wrote:
The problem is sometimes hibernate will generate the Integrity Constraints SQL Statements in the DDL. Then there will be some problem for those databases which don't support such constraints. e.g. some older version of MySQL.

Is there anyway of making the Integrity Constraints DLL generation an option step?

e.g. imagine the schemaexport can accept a parameter that omit the integrity constraints DDL generation, then it will generate only the create table statements. And the actual integrity is managed by the Hibernate API as specified in the mapping xml file.

Is it possible doing something like that? Or any other alternatives?

Thx.


Some background information: one objective of the software project that I am working on is to support as many kinds of DBMS as possible. Our team has insight on Hibernate having such edge. So we try to adpot it.

The success of this decision relys on how Hibernate generate DDL for a specific kinds of database in different versions.

Can we consider all the DB type and its version by changing the SQLDialect class supplied in the configuration?

Thx.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 16, 2004 6:11 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
You have to suppose:
- good support of SQL by your underlying DB (those having a dialect are, see http://www.hibernate.org/Documentation/CompatibilityGuide)
- not too bad JDBC driver

Dialect is done to customize Hibernate relation to DB, so I guess the answer to your question is yes.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 16, 2004 4:01 pm 
Newbie

Joined: Sat Jan 10, 2004 5:45 pm
Posts: 12
Location: Hong Kong
From Hibernate Compatbility Guide: It is highly likely that most features of Hibernate (ie. everything except schema generation) will work perfectly with many other relational databases.

So does it mean given we can define the DDL in advance (without Referential Integrity DDL) and then have a corresponding Mapping file (with Referential Integrity) then the intrgration will still be successful?

But using this method, we can not let the hibernate to select a good mapping for some "risky" types such as date, which different DBMS's implementation on that is quite difficult.

Is there any suggestion on this situation.

p.s.
- date is entensively used throughout the project. So it's highly desirable to delegate the responibility of selecting the suitable date type for different database, where the type of database in some sense unknown in advance. (assuming that we are going to support all database that is supported by Hibernate, given an not-too-bad JDBC driver)

- How do we know if a JDBC driver is not-too-bad? How do we measure or judge its capabilities?

Thx.


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.