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.  [ 3 posts ] 
Author Message
 Post subject: Delete rows from existing DB without Asking
PostPosted: Mon Apr 14, 2008 10:29 am 
Newbie

Joined: Mon Apr 14, 2008 10:04 am
Posts: 2
Hibernate version: 2.0.0.Alpha1

Name and version of the database you are using: Oracle 10g release 2

Hi,

I'm trying to use NHibernate for a new Projet with an existing DB that I can't modify.

I've made some Entities and mappings with Unit Tests (NUnit 2.2) .

On the first test I've tried (just getting the list of all the entities from one table), Nhibernate deleted all the rows of my table and the columns I didn't use in my mapping file (some columns are not needed for my application). It's like it dropped all the existing tables and created a new version of them based on the mapping file.

Some explanations would be helpful ...

Must I map all the fields of the tables I will be using ??
Can't I keep my existing Rows ?? (A bit annoying ...)

Thanks for your help.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 14, 2008 10:31 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
What are you doing ? Post your code when you create the session factory. Do you use SchemaExport ?

_________________
--Wolfgang


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 14, 2008 11:33 am 
Newbie

Joined: Mon Apr 14, 2008 10:04 am
Posts: 2
OUCH !

Didn't see this ... !

That will teach me not to copy/paste from samples without understanding what I am doing ... !

Yes, I was doing ShemaExport ... !

Sorry for the stupid question ... sometimes the errors are so big that it is blinding us !


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