Reverse engineering a legacy database Hibernate mapping metadata (Kids web site)
Reverse engineering a legacy database Hibernate mapping metadata has many more options, most of which are related to reverse engineering, as to how XML mapping files, Java code, or even whole application skeletons can be generated automatically from an existing database schema. We ll first show you how to write an Ant target that can load an existing database into a Hibernate metadata model. Next, you ll apply various exporters and produce XML files, Java code, and other useful artifacts from the database tables and columns. 2.3.1 Creating a database configuration Let s assume that you have a new WORKDIR with nothing but the lib directory (and its usual contents) and an empty src directory. To generate mappings and code from an existing database, you first need to create a configuration file that contains your database connection settings: hibernate.dialect = org.hibernate.dialect.HSQLDialect hibernate.connection.driver_class = org.hsqldb.jdbcDriver hibernate.connection.url = jdbc:hsqldb:hsql://localhost hibernate.connection.username = sa Store this file directly in WORKDIR, and name it helloworld.db.properties. The four lines shown here are the minimum that is required to connect to the database and read the metadata of all tables and columns. You could have created a Hibernate XML configuration file instead of hibernate.properties, but there is no reason to make this more complex than necessary. Write the Ant target next. In a build.xml file in your project, add the following code:
If you are looking for cheap and quality webhost to host and run your website check Jboss Web Hosting services.