-->
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.  [ 5 posts ] 
Author Message
 Post subject: SchemaUpdate and Annotations
PostPosted: Thu Mar 03, 2005 5:30 pm 
Senior
Senior

Joined: Tue Mar 02, 2004 6:17 pm
Posts: 151
Err, this is an odd question, but what happens to SchemaExport/SchemaUpdate with Hibernate3 and annotations? They used to take XML mapping files as input but as far as I can see, there is no way to generate XML files when using annotations (i.e. the mapping is read directly from annotations). Do we not need Schema* anymore for some reason?

Also, I noticed that Hibernate3 RC1 shiped with SchemaExport/SchemaUpdate still refering to Hibernate2 files. I assume this is a bug?

Thanks,
Gili


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 03, 2005 7:06 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
we have a new ant task that handles that. will be released soon.

what do you mean they refer h2 files ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 03, 2005 8:16 pm 
Senior
Senior

Joined: Tue Mar 02, 2004 6:17 pm
Posts: 151
max wrote:
we have a new ant task that handles that. will be released soon.

what do you mean they refer h2 files ?


The batch files contain references to hibernate2.jar. What are we supposed to do until the Ant task is released? Is it currently impossible to export the schema if we are using annotations?

Thanks,
Gili


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 04, 2005 5:44 am 
Beginner
Beginner

Joined: Mon Dec 15, 2003 5:25 am
Posts: 48
Location: Delhi, India
max wrote:
we have a new ant task that handles that. will be released soon.


I have tried SchemaExport with annotations like below and it works.

Code:
    Configuration config = new AnnotationConfiguration().
    addPackage("a.b.c")
    .addAnnotatedClass(Foo.class)
    .addAnnotatedClass(Baz.class)
    .setProperty("hibernate.dialect", "org.hibernate.dialect.OracleDialect")
    .setProperty("hibernate.connection.driver_class", "oracle.jdbc.driver.OracleDriver")
    .setProperty("hibernate.connection.url", "jdbc:oracle:thin:@mymachine:1521:orcl")
    .setProperty("hibernate.connection.username", "me")
    .setProperty("hibernate.connection.password", "my")
    .setProperty("hibernate.connection.pool_size", "1");
   
    SchemaExport schExp = new SchemaExport(config);
    schExp.setDelimiter(";");
    schExp.setOutputFile("HibSchema.sql");
    schExp.create(true, false);


Is it the right way of exporting schema or we have to wait for new ant task?

_________________
Vinod K. Singh


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 04, 2005 6:43 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
that is what the new ant task does.

_________________
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.  [ 5 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.