-->
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: create new object mapping
PostPosted: Tue Jul 06, 2004 5:37 am 
Newbie

Joined: Tue Jul 06, 2004 4:40 am
Posts: 9
Location: Slovakia
hi all
I have one problem.
I have hibernate aplication and I have to create new object mapipng.
I used this code:

Code:
HibernateProvider.refresh();
SchemaExport se = new SchemaExpor(HibernateProvider.getConfiguration());
se.drop(true, true);
se.create(true, true);
HibernateProvider.getSession().connection().commit();


but until now I have to keep data in tables, so dropping is impossible...


and SchemaUpdate doesn't work correctly...

Code:
Session session = HibernateProvider.getSession();
SchemaUpdate su = new SchemaUpdate( HibernateProvider.getConfiguration());
su.execute( true, false);
session.flush();
session.connection().commit();


any help please?

thanx


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 06, 2004 5:45 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
SchemaUpdate is not really useful, and if it will be one day, should be only used in development. Use manual schema evolution, this means, modify the database schema by hand.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 06, 2004 7:46 am 
Newbie

Joined: Tue Jul 06, 2004 4:40 am
Posts: 9
Location: Slovakia
thanks,
but there is problem, when i want to use some not-object variables (int, char), I have to use Object wrappers (Integer, Character), when I create it with SQL DDL... (The fields are not marked as not-null...).
Am I doing something wrong?

+really is not possible to tell Hibernate to create one object... (drop table manually and create it by hibernate)?

thanks
CoPLaS


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.