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: Créer une colonne
PostPosted: Mon Mar 19, 2007 4:01 am 
Beginner
Beginner

Joined: Wed Mar 14, 2007 4:29 am
Posts: 33
Bonjour,

je n'arrive pas a créer une colonne pour une table existante.
J'ai essayé avec schemaExport, qui crée bien la colonne mais il efface le contenu de la table.

Une idée ?

Merci


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 19, 2007 8:45 am 
Expert
Expert

Joined: Thu Sep 04, 2003 8:23 am
Posts: 368
Normalement tu dois avoir configuré quelque part
Code:
hibernate.hbm2ddl.auto=update

et dans ce cas ta base est mise à jour au lancement mais je ne sais pas si c'est ça que tu veux

_________________
Seb
(Please don't forget to give credits if you found this answer useful :)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 19, 2007 8:52 am 
Beginner
Beginner

Joined: Wed Mar 14, 2007 4:29 am
Posts: 33
Salut,

ca pourrait correspondre, mais je ne vois pas cet accesseur....?
J'ai accès à NHibernate.Tool.hbm2ddl, mais il ne contient que AdoColumn, AdoTable et SchemaExport

:(


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 21, 2007 12:03 pm 
Beginner
Beginner

Joined: Wed Mar 14, 2007 4:29 am
Posts: 33
bon ben une solution:

IDbCommand command = factory.ConnectionProvider.GetConnection().CreateCommand();
command.CommandText = "alter table matable add test integer";
command.CommandType = CommandType.Text;
command.ExecuteNonQuery();

pas top mais bon


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.