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.  [ 1 post ] 
Author Message
 Post subject: [beginner] Java -> Schema
PostPosted: Fri Dec 18, 2009 5:38 am 
Newbie

Joined: Fri Dec 18, 2009 5:27 am
Posts: 1
hi,
I know how to generate entity beans, daos etc from *existing* database using Jboss Tools for Eclipse, but i can't get how to from annotated beans and existing hibernate.cfg.xml (jdbc connection, mapping class=... etc) generate schema for *new* database :(

How to do that in eclipse ???

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
      "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
      "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
    <session-factory name="sessionFactory">
        <property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
        <property name="hibernate.connection.password">postgres</property>
        <property name="hibernate.connection.url">...</property>
        <property name="hibernate.connection.username">...</property>
        <property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
        <mapping class="net.marioosh.wicket.start1.model.User"/>
        ...
        <mapping class="net.marioosh.wicket.start1.model.Group"/>
    </session-factory>
</hibernate-configuration>

@Entity
@Table(name="tuser")
public class User implements Serializable{
   private int idUser;
   private String login;
   private String pass;

   public int getIdUser() {
      return idUser;
   }
   
   @Id
   public void setIdUser(int idUser) {
      this.idUser = idUser;
   }
            ...
}


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.