-->
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.  [ 4 posts ] 
Author Message
 Post subject: Prevent Hibernate from adding db-constraints
PostPosted: Thu Nov 09, 2006 5:48 am 
Newbie

Joined: Wed May 24, 2006 7:28 am
Posts: 4
Hibernate version:
3.2

Name and version of the database you are using:
H2

Hi,

Is it possible to prevent Hibernate completely from adding constraints to the database?

For application-purposes we need to delete objects manually from the database. Because this can be done ignoring the domain-structure, it would be much easier without database-level constraints, as the constraints are enforced by the domain-logic anyway.

Best regards and thanx for your help,

Markus & Sandro


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 09, 2006 5:58 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
foreign-key="none"

but that is *definitly* not recommended to use just because "its hard to delete objects with constraints"

There are very good reasons why it should be hard ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 09, 2006 6:04 am 
Newbie

Joined: Wed May 24, 2006 7:28 am
Posts: 4
Thanx for your answer, Max

The reason for this is the following: Our application allowes the deletion of huge amounts of data (more than can reside in memory), but still provides full undo/redo. Our solution: We flag the deleted data, so that it is recognised from application logic as deleted, but still can be resurected. When the app is closed, our manual deletion comes into play.

Any comments on this technique are highly appreciated :)

Greez,

Markus & Sandro


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 09, 2006 6:10 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
that still isn't a reason for disabling constraints.

_________________
Max
Don't forget to rate


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